How to determine output dimension of refproparray

1 vue (au cours des 30 derniers jours)
Fotis
Fotis le 13 Oct 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 ]??

Réponses (1)

Rohit Kudva
Rohit Kudva le 21 Oct 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

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by