Writing a matlab function- get number of rows
이전 댓글 표시
I'm new to Matlab.
I'm writing a matlab function to which I have given the arguments: Params, X,Y
All 3 are vectors.
I want to find out how many rows vector X has.
What is the corresponding matlab command/inbuilt function?
I was thinking of using :
MStruct = get(DMObj)
PropertyValue = get(DMObj, 'NRows')
Any better suggestions please?
답변 (3개)
Thomas
2012년 3월 5일
Try size(x) to give you the size of the vectors
doc size
Sean de Wolski
2012년 3월 5일
mrows = size(x,1)
Shalini
2012년 3월 5일
0 개 추천
댓글 수: 2
Oleg Komarov
2012년 3월 5일
Have you tried the snippets?
Walter Roberson
2012년 3월 5일
Declaration of variables was addressed in your topic
http://www.mathworks.com/matlabcentral/answers/31248-variable-declaration-in-matlab
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!