Answered

While loop for testing the end of vector (Matlab)

If you know that it's 1-dimensional, you can use numel(vector) which returns the length of your vector. Also useful to know i...

While loop for testing the end of vector (Matlab)

If you know that it's 1-dimensional, you can use numel(vector) which returns the length of your vector. Also useful to know i...

13 días ago | 1

Answered

Finding numChanges in array

Replace for i=1;length(V) with for ii = 1:length(V) The semicolon -> colon is a typo I suspect, and i has a built in value s...

Finding numChanges in array

Replace for i=1;length(V) with for ii = 1:length(V) The semicolon -> colon is a typo I suspect, and i has a built in value s...

13 días ago | 1

| accepted

Answered

How to plot a graph in nm

Your method works perfectly well. An alternative option would be theta = 10 wavelength = [500:10:700] m = 1 d = (m.*waveleng...

How to plot a graph in nm

Your method works perfectly well. An alternative option would be theta = 10 wavelength = [500:10:700] m = 1 d = (m.*waveleng...

25 días ago | 1

| accepted

Answered

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 10-by-10. not sure why i am getting this error

Biot_top is size 10x10. dtMat(1,j) is size 1x1. This means the LHS of your line is 1x1, and the RHS is 10x10, so you can't make ...

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 10-by-10. not sure why i am getting this error

Biot_top is size 10x10. dtMat(1,j) is size 1x1. This means the LHS of your line is 1x1, and the RHS is 10x10, so you can't make ...

26 días ago | 0

| accepted

Answered

How to create one errorbar for multiple data points?

If I understand you right, could you do something like figure; hold on plot(x, y, 'bx') errorbar(mean(x), mean(y), std(y), 'k...

How to create one errorbar for multiple data points?

If I understand you right, could you do something like figure; hold on plot(x, y, 'bx') errorbar(mean(x), mean(y), std(y), 'k...

26 días ago | 1

| accepted

Answered

Graph with similar axis value with the value given

You want xticks and yticks. As a note: you need the vectors to be in ascending order, and your second tickmark vector isn't. so...

Graph with similar axis value with the value given

You want xticks and yticks. As a note: you need the vectors to be in ascending order, and your second tickmark vector isn't. so...

27 días ago | 0

Answered

Does MathWorks have software for rocket trajectory modeling at supersonic speed?

The Aerospace toolbox is likely to be the closest to what you want. I don't use it so don't know much about it, but it seems to ...

Does MathWorks have software for rocket trajectory modeling at supersonic speed?

The Aerospace toolbox is likely to be the closest to what you want. I don't use it so don't know much about it, but it seems to ...

27 días ago | 0

Answered

converting degrees and radian

Something like option = input("Type A for degree to radians, and B for radians to degrees: ", 's') if option == "A" degs ...

converting degrees and radian

Something like option = input("Type A for degree to radians, and B for radians to degrees: ", 's') if option == "A" degs ...

28 días ago | 0

Answered

How can I plot histogram?

Simply googling "matlab histogram" would have answered your question. That link is for the documentation for histogram. histog...

How can I plot histogram?

Simply googling "matlab histogram" would have answered your question. That link is for the documentation for histogram. histog...

alrededor de 1 mes ago | 0

Answered

Double for loop is not working properly

k will take the values [1 2]. For the first iteration of k, it stores data{1,1}(:,14) in ch{1,n}. The second time around, it wil...

Double for loop is not working properly

k will take the values [1 2]. For the first iteration of k, it stores data{1,1}(:,14) in ch{1,n}. The second time around, it wil...

alrededor de 1 mes ago | 0

| accepted

Answered

Uneven linspacing of an array

If I understand right, you have a vector len, and you want to have a vector x such that diff(x)=len. In that case, you can use t...

Uneven linspacing of an array

If I understand right, you have a vector len, and you want to have a vector x such that diff(x)=len. In that case, you can use t...

alrededor de 1 mes ago | 0

Answered

Problem with running a Matlab code.

Clear your variables by putting the command clear at the start of your programme. It's almost certainly holding onto variable...

Problem with running a Matlab code.

Clear your variables by putting the command clear at the start of your programme. It's almost certainly holding onto variable...

alrededor de 1 mes ago | 0

| accepted

Answered

How Create a vector given size(N) and the value of the max element(M)?

Are those the only conditions? linspace(1, M, N) has N values which range from 1 to M.

How Create a vector given size(N) and the value of the max element(M)?

Are those the only conditions? linspace(1, M, N) has N values which range from 1 to M.

alrededor de 1 mes ago | 0

| accepted

Answered

Using sample code but returning a blank plot

You create a label and a title for a plot, but at no point do you feed it actual data to plot. Why would it do anything but prod...

Using sample code but returning a blank plot

You create a label and a title for a plot, but at no point do you feed it actual data to plot. Why would it do anything but prod...

alrededor de 1 mes ago | 0

Answered

Create a Slanted Linspace Matrix

If you have the signal processing toolbox, the buffer command will do exactly what you want. If not, something like x = linsp...

Create a Slanted Linspace Matrix

If you have the signal processing toolbox, the buffer command will do exactly what you want. If not, something like x = linsp...

alrededor de 1 mes ago | 0

Answered

log ticks on Y-axis

set(gca, 'YScale', 'log') Is this what you mean?

log ticks on Y-axis

set(gca, 'YScale', 'log') Is this what you mean?

alrededor de 1 mes ago | 0

| accepted

Answered

error message how to solve !?

The error message is exactly what it says. You defined a function, which is not defined if one of your inputs is a function hand...

error message how to solve !?

The error message is exactly what it says. You defined a function, which is not defined if one of your inputs is a function hand...

alrededor de 1 mes ago | 0

Answered

MATLAB isn't working to generate figures

Use hold on and hold off when generating figures. I've not used imshow before, but I'll guess that each time you generate a figu...

MATLAB isn't working to generate figures

Use hold on and hold off when generating figures. I've not used imshow before, but I'll guess that each time you generate a figu...

alrededor de 1 mes ago | 0

Answered

How to add a NaN row at the beginning columns of a table?

for jj = 1:5 A(:,jj) = [NaN([jj 1]); B(1:end-jj)] A(T.id(1:end) ~= [NaN([jj 1]); T.id(1:end-jj)], jj) = NaN; end I h...

How to add a NaN row at the beginning columns of a table?

for jj = 1:5 A(:,jj) = [NaN([jj 1]); B(1:end-jj)] A(T.id(1:end) ~= [NaN([jj 1]); T.id(1:end-jj)], jj) = NaN; end I h...

alrededor de 2 meses ago | 1

| accepted

Answered

signal to noise ratio (SNR)

According to the documentation, "r = snr(x,y) returns the signal-to-noise ratio (SNR) in decibels of a signal, x, by computing ...

signal to noise ratio (SNR)

According to the documentation, "r = snr(x,y) returns the signal-to-noise ratio (SNR) in decibels of a signal, x, by computing ...

alrededor de 2 meses ago | 0

| accepted

Answered

How can I get archived documentation for a R2012b release?

As per the other answer, 2012b doesn't have easily accessed documentation. I have found, however, the 2012b release notes in thi...

How can I get archived documentation for a R2012b release?

As per the other answer, 2012b doesn't have easily accessed documentation. I have found, however, the 2012b release notes in thi...

alrededor de 2 meses ago | 0

Answered

How to Integrate ?

Wolfram alpha is useful here to show you what can be done. If you click that link you'll see that I asked it to do which is ...

How to Integrate ?

Wolfram alpha is useful here to show you what can be done. If you click that link you'll see that I asked it to do which is ...

alrededor de 2 meses ago | 0

Answered

Min and max value of many results

Good news! Matlab has built in min and max commands. So it's pretty straightforward to define them and store them in a vector: ...

Min and max value of many results

Good news! Matlab has built in min and max commands. So it's pretty straightforward to define them and store them in a vector: ...

alrededor de 2 meses ago | 1

Question

Is it possible to include LaTeX expressions as text in my code?

I have a piece of code, where some of the variables can have their values chosen by me as and when I want. The values have very ...

alrededor de 2 meses ago | 2 answers | 0

Answered

What is the difference between matlab download R2020a and R2020b?

Here are the release notes for 2020b. There likely isn't much to change for most people, when I updated from 2020a to 2020b I di...

What is the difference between matlab download R2020a and R2020b?

Here are the release notes for 2020b. There likely isn't much to change for most people, when I updated from 2020a to 2020b I di...

alrededor de 2 meses ago | 0

| accepted

Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values. (Slution of equation of motion with runge kutta 4)

t(1), q(1) and dqdt(1) are all zero. Matlab indexing starts at 1, so when you assign k_11 = y1_2nd(t(i),q(i),dqdt(i)) it trie...

Index in position 1 is invalid. Array indices must be positive integers or logical values. (Slution of equation of motion with runge kutta 4)

t(1), q(1) and dqdt(1) are all zero. Matlab indexing starts at 1, so when you assign k_11 = y1_2nd(t(i),q(i),dqdt(i)) it trie...

alrededor de 2 meses ago | 0

Answered

I want the graph of the function only show the part where x>0

You want xlim. Give it one limit and it can calculate the other, or use xlim(0, length(y)).

I want the graph of the function only show the part where x>0

You want xlim. Give it one limit and it can calculate the other, or use xlim(0, length(y)).

alrededor de 2 meses ago | 1

Answered

max and min row from an array

The built in min and max commands have the ability to return the index of the largest and smallest values in an array. The docum...

max and min row from an array

The built in min and max commands have the ability to return the index of the largest and smallest values in an array. The docum...

alrededor de 2 meses ago | 0

Answered

How to change dot's place in fractional number

Multiply by 100? x1 = 0.25; x2 = x1 * 100; disp(x2) 25

How to change dot's place in fractional number

Multiply by 100? x1 = 0.25; x2 = x1 * 100; disp(x2) 25

alrededor de 2 meses ago | 1

| accepted

Question

How do I find out what specifically is causing the error "Matrix is close to singular or badly scaled" in the sgolay function?

I'm using the sgolay function from the Signal Processing toolbox to calculate some derivatives. The function is inside a loop as...

alrededor de 2 meses ago | 1 answer | 0