How to determine output dimension of refproparray
3 ビュー (過去 30 日間)
古いコメントを表示
I have a big program where I call refproparray a number of times. I also perform a couple of iritations in the whole program in order to correct some parameters. My problem is that refproparray returns a vector like this [ 1 2 3 4] during the first iteration and a vector like this [ 1;2;3;4] during the second one!!. So basically matlab gives me an error of matrix dimensions when it tries to proceed with calculations because all my other variables are this form [5 6 7 8]. Does anyone know how to solve this issue with refproparray? Make it somehow return all variables like this [5 6 7 8 ]??
0 件のコメント
回答 (1 件)
Rohit Kudva
2015 年 10 月 21 日
Hi Fotis,
'refproparray' doesn't seem to be a MATLAB function but to answer your question in general, you can use the 'size' function to determine the dimensions of a vector
>> z = zeros(4,1);
>> s = size(z)
s =
4 1
Using this function you can determine if the vector returned in of size '1 x N' or 'N x 1'. If it is 'N x 1' you can do a transpose of the vector using 'transpose' function.
>> ztranspose = transpose(z);
>> size(ztranspose)
ans =
1 4
You can then use this vector for your further calculations.
Regards,
Rohit
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!