getting the variable size value

I have a variable of size x*y .what matlab command is used to get the x value.

 Accepted Answer

More Answers (1)

To find the size, use size.
[m,n] = size(X)
m = size(X,dim)
So to find the number of rows, you can say
numRows = size(X,1)

1 Comment

thanks for the reply a=size(X,1) is the command i was looking for...

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!