Azzera filtri
Azzera filtri

How to determine output dimension of refproparray

1 visualizzazione (ultimi 30 giorni)
Fotis
Fotis il 13 Ott 2015
Risposto: Rohit Kudva il 21 Ott 2015
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 ]??

Risposte (1)

Rohit Kudva
Rohit Kudva il 21 Ott 2015
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

Community Treasure Hunt

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

Start Hunting!

Translated by