Answered

Run section is not working on 2022a

Take a look at my question and answer here. There was a known bug in R2021b (although not exactly what you describe), but I am ...

Run section is not working on 2022a

Take a look at my question and answer here. There was a known bug in R2021b (although not exactly what you describe), but I am ...

alrededor de 1 mes ago | 0

Answered

How to plot like this????????

There are examples in the documentation for the plot command that are very similar to this, for example: x = 0:pi/10:2*pi; y1 ...

How to plot like this????????

There are examples in the documentation for the plot command that are very similar to this, for example: x = 0:pi/10:2*pi; y1 ...

alrededor de 2 meses ago | 0

| accepted

Answered

My code won't run, error message :Unrecognized function or variable 'ss'. Error in Q4_109 (line 19) Sys=ss(A,B,C,D);

As you can see, I was able to run your code here. I expect you do not have the ss function, which is in the Control System Tool...

My code won't run, error message :Unrecognized function or variable 'ss'. Error in Q4_109 (line 19) Sys=ss(A,B,C,D);

As you can see, I was able to run your code here. I expect you do not have the ss function, which is in the Control System Tool...

alrededor de 2 meses ago | 1

Answered

Datetime won't recognise some cells

Two minor but important changes to your syntax: datetime(data.TimeofDay,'InputFormat','HH:mm:ss.SSS') Note that I used 'Input...

Datetime won't recognise some cells

Two minor but important changes to your syntax: datetime(data.TimeofDay,'InputFormat','HH:mm:ss.SSS') Note that I used 'Input...

alrededor de 2 meses ago | 2

Answered

i want to create a 2 dim matrix which creates 1000 rows vs 1000 columns which will look like a table, if the prime number occur output 1 in the cell and if not prime output 0

I think this does what you want. I used 100 numbers in a 10x10 array to illustrate. Just change N to 1000. N = 10; Prime_matri...

i want to create a 2 dim matrix which creates 1000 rows vs 1000 columns which will look like a table, if the prime number occur output 1 in the cell and if not prime output 0

I think this does what you want. I used 100 numbers in a 10x10 array to illustrate. Just change N to 1000. N = 10; Prime_matri...

alrededor de 2 meses ago | 0

| accepted

Answered

Replace only values in y axis

Does this do what you mean? rng("default") % Data to plot x = 1:10; y = rand(1,10); % 11 arbitrary numeric labels for y...

Replace only values in y axis

Does this do what you mean? rng("default") % Data to plot x = 1:10; y = rand(1,10); % 11 arbitrary numeric labels for y...

alrededor de 2 meses ago | 0

| accepted

Answered

convert a x y z data(1D) to MxN matrix without having NaN values in Z matrix?

If you are using interp3 (or related functions), extrapolated values will automatically be set to NaN, for some interpolation me...

convert a x y z data(1D) to MxN matrix without having NaN values in Z matrix?

If you are using interp3 (or related functions), extrapolated values will automatically be set to NaN, for some interpolation me...

alrededor de 2 meses ago | 0

Answered

How to iterate until a point satisfies a certain condition?

You need to code the condition into a while loop. (I didn't fully understand the condition, so I can't be more specific than th...

How to iterate until a point satisfies a certain condition?

You need to code the condition into a while loop. (I didn't fully understand the condition, so I can't be more specific than th...

alrededor de 2 meses ago | 0

Answered

Changing data from a list to a matrix

Can we make a simplified example, to understand what you mean? Suppose you just have 3 columns of data, and your function is f(x...

Changing data from a list to a matrix

Can we make a simplified example, to understand what you mean? Suppose you just have 3 columns of data, and your function is f(x...

alrededor de 2 meses ago | 0

| accepted

Answered

How to fill surface with interpolated values?

Your code does not seem to have a call to interp2, so I'm not sure what might have gone wrong there. If you did not specify an ...

How to fill surface with interpolated values?

Your code does not seem to have a call to interp2, so I'm not sure what might have gone wrong there. If you did not specify an ...

alrededor de 2 meses ago | 1

Answered

add a row of summary statistics in a table

Here is one way: % The table T = table([10;5],[17;18],'VariableNames',{'visitor','temperature'},'RowNames',{'New York','Chicag...

add a row of summary statistics in a table

Here is one way: % The table T = table([10;5],[17;18],'VariableNames',{'visitor','temperature'},'RowNames',{'New York','Chicag...

alrededor de 2 meses ago | 0

Answered

How can decimals not be rounded

Here is one way: roundTo = 2; % Set this value float_number = 5.126; % User's value % Algorithm roundToPower = 10^roundTo;...

How can decimals not be rounded

Here is one way: roundTo = 2; % Set this value float_number = 5.126; % User's value % Algorithm roundToPower = 10^roundTo;...

2 meses ago | 1

| accepted

Answered

Why I am getting Same p-value, h and stats while using Wilcoxon Rank test for 7 different data set?

That test statistic only depends on the count and relative ordering of the respective set elements. In your case, it looks like ...

Why I am getting Same p-value, h and stats while using Wilcoxon Rank test for 7 different data set?

That test statistic only depends on the count and relative ordering of the respective set elements. In your case, it looks like ...

2 meses ago | 0

Answered

find the best linear regression model using stepwiselm

First, I feel obligated to mention that stepwise regression is often criticized as a technique. This wikipedia article discusses...

find the best linear regression model using stepwiselm

First, I feel obligated to mention that stepwise regression is often criticized as a technique. This wikipedia article discusses...

2 meses ago | 0

| accepted

Answered

Error usin .* Too many output arguments. How to save three variables at the same time in a loop?

Given the image of the calculation you posted, I think you want matrix multiplication, not elementwise multiplication: [V01(a,1...

Error usin .* Too many output arguments. How to save three variables at the same time in a loop?

Given the image of the calculation you posted, I think you want matrix multiplication, not elementwise multiplication: [V01(a,1...

2 meses ago | 0

Answered

Randomly generated numbers do not change themselves with each iteration

Can you post your code? This miniature version of what you described seems to work. rng default format long for l = 1:4 ...

Randomly generated numbers do not change themselves with each iteration

Can you post your code? This miniature version of what you described seems to work. rng default format long for l = 1:4 ...

2 meses ago | 0

Answered

check each element of random vector c=[0, 1, 0, 1,.....n] one by one if value of current element is 0 and previous element is 0 perform this action otherwise another action.

I didn't fully understand what you are trying to do with your code, but I think the following will help you. To find all the lo...

check each element of random vector c=[0, 1, 0, 1,.....n] one by one if value of current element is 0 and previous element is 0 perform this action otherwise another action.

I didn't fully understand what you are trying to do with your code, but I think the following will help you. To find all the lo...

2 meses ago | 0

Answered

How to extract matches from results of a regexp match

Even when using a single character array input along with the 'match' option, MATLAB has to return outputs in a cell array, to b...

How to extract matches from results of a regexp match

Even when using a single character array input along with the 'match' option, MATLAB has to return outputs in a cell array, to b...

2 meses ago | 0

Answered

Overloading math operations on cell arrays

Your question is not perfectly clear to me, but it seems that cellfun might do what you want: A = {1,[2,3;4,5],6}; B = {2,[3,4...

Overloading math operations on cell arrays

Your question is not perfectly clear to me, but it seems that cellfun might do what you want: A = {1,[2,3;4,5],6}; B = {2,[3,4...

2 meses ago | 0

Answered

plotting 2 models on one histogram

Here is a hint to get you started. N = 1000; x1 = randn(N,1); x2 = randn(N,1) + 2; figure hold on histogram(x1) histogr...

plotting 2 models on one histogram

Here is a hint to get you started. N = 1000; x1 = randn(N,1); x2 = randn(N,1) + 2; figure hold on histogram(x1) histogr...

2 meses ago | 0

Answered

Is it suitable to include dependent varible when conducting PCA?

I've never used PCA on time series data, and I had never heard of anyone doing so, but googling PCA time series does turn up som...

Is it suitable to include dependent varible when conducting PCA?

I've never used PCA on time series data, and I had never heard of anyone doing so, but googling PCA time series does turn up som...

2 meses ago | 0

Answered

How to write to in MATLAB, translated from R

String concatenation in MATLAB can be done as "addition": i = 7; "output/" + i + "_script.m"

How to write to in MATLAB, translated from R

String concatenation in MATLAB can be done as "addition": i = 7; "output/" + i + "_script.m"

2 meses ago | 0

Answered

write superscript in string

It could be the interpreter. Does this work for you? R2 = 0.75; t = sprintf('R^2 = %0.2f',R2); title(t,'interpreter','tex') ...

write superscript in string

It could be the interpreter. Does this work for you? R2 = 0.75; t = sprintf('R^2 = %0.2f',R2); title(t,'interpreter','tex') ...

3 meses ago | 0

| accepted

Answered

How to replace non consecutive value on a vector?

Here is an absolutely terrible, obfuscated way to do this: A = [5,5,5,5,5,4,5,5,5,5,4,4,5,5,5,5,4,4,4,5,5,5,5]; SA = char(A)...

How to replace non consecutive value on a vector?

Here is an absolutely terrible, obfuscated way to do this: A = [5,5,5,5,5,4,5,5,5,5,4,4,5,5,5,5,4,4,4,5,5,5,5]; SA = char(A)...

3 meses ago | 0

Answered

Vector as an input in function

a = 2; b = 3; v = [a; b]; f_out = f(v) function out = f(v) out = 5*v(1) + 7*v(2); end

Vector as an input in function

a = 2; b = 3; v = [a; b]; f_out = f(v) function out = f(v) out = 5*v(1) + 7*v(2); end

3 meses ago | 2

Answered

How do I convert a non-normal distribution to an equivalent normal distribution?

A few thoughts that might be useful, if not exactly a complete answer to your question ... First, I hope it is clear that not a...

How do I convert a non-normal distribution to an equivalent normal distribution?

A few thoughts that might be useful, if not exactly a complete answer to your question ... First, I hope it is clear that not a...

3 meses ago | 2

Answered

I am trying to figure out how to plot my data.

You don't say what kind of figure you want. I suggest you look at the MATLAB Plot Gallery. If you see something like what you wa...

I am trying to figure out how to plot my data.

You don't say what kind of figure you want. I suggest you look at the MATLAB Plot Gallery. If you see something like what you wa...

3 meses ago | 0

Answered

roots(x) vs root= interp1(y,x,0)

It's not clear, at least to me, what you mean by "root = interp1 command". But, my best guess is that if you were somehow trying...

roots(x) vs root= interp1(y,x,0)

It's not clear, at least to me, what you mean by "root = interp1 command". But, my best guess is that if you were somehow trying...

3 meses ago | 0

Answered

How to present my outcomes in the form of a confusion matrix

If you have the Statistics and Machine Learning Toolbox, you could use the confusionchart or confusionmat command.

How to present my outcomes in the form of a confusion matrix

If you have the Statistics and Machine Learning Toolbox, you could use the confusionchart or confusionmat command.

3 meses ago | 0

Answered

Defining upper and lower control limits for a graph

Here is a simple example of setting plot limits based on the data. (The last line of code is where I set the limits.) x = 1:50;...

Defining upper and lower control limits for a graph

Here is a simple example of setting plot limits based on the data. (The last line of code is where I set the limits.) x = 1:50;...

3 meses ago | 0