Borrar filtros
Borrar filtros

How to determine output dimension of refproparray

1 visualización (últimos 30 días)
Fotis
Fotis el 13 de Oct. de 2015
Respondida: Rohit Kudva el 21 de Oct. de 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 ]??

Respuestas (1)

Rohit Kudva
Rohit Kudva el 21 de Oct. de 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

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by