how to calculate standard deviation of 1D array?
Show older comments
i have an array A.
A=[1 2 3 4];
s=std(A);
Error: Index exceeds matrix dimensions.
- sometimes std says: Subscript indices must either be real positive integers or logicals.
- and also what is the difference in std and std2.
Accepted Answer
More Answers (3)
John D'Errico
on 10 Jul 2014
1 vote
How? Use std to compute a standard deviation. Read the help.
DON'T NAME YOUR VARIABLE STD. If you do, you will get that error message!
As far as the difference between std and std2, MATLAB does not have a std2 function in it. Maybe somebody you know has written a std2 code. I can't guess.
1 Comment
Star Strider
on 10 Jul 2014
The std2 function is in the Image Processing Toolbox.
Ayush
on 10 Jul 2014
0 votes
Ken Irok
on 20 Feb 2019
0 votes
Hi, I have a 74 row of array stored in my workplace called "feat". How do I calculate the std and mean for each column in that array? Say there is 6 different columns inside that array of workplace.
1 Comment
Star Strider
on 20 Feb 2019
Read the documentation for std and mean.
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!