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!