Number of observed responses

5 vues (au cours des 30 derniers jours)
Dipesh
Dipesh le 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.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by