How to determine output dimension of refproparray

조회 수: 1 (최근 30일)
Fotis
Fotis 2015년 10월 13일
답변: Rohit Kudva 2015년 10월 21일
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 ]??

답변 (1개)

Rohit Kudva
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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by