Number of observed responses

3 views (last 30 days)
Dipesh
Dipesh on 3 Nov 2012
Lets say that randomley I choose 10 values, for 'y'. Here, I am saying that the total number of y's is 10 (as opposed to y1 + y2 + ...).
How would I find out this in Matlab?
I have assigned random amounts of y to be picked, but the codes I know are total and sum and everytime I do total(y) or sum(y), it adds up all the y numbers (y` + y2 + ... yn) instead of telling me the answer 'n' (how many there are).
How do I find this out?
Thank you
EDIT: I think this would be called the number of observed values/responses.

Accepted Answer

Walter Roberson
Walter Roberson on 3 Nov 2012
length(y) or numel(y)

More Answers (0)

Categories

Find more on Get Started with MATLAB 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!