Borrar filtros
Borrar filtros

How to assign output to columns of an array/matrix?

3 visualizaciones (últimos 30 días)
Rick
Rick el 5 de Nov. de 2012
Hi all,
I am trying to store the output in an array/matrix of 3 columns.
d = sqrt(((rename(:,1) - xorigin).^2) + ((rename(:,2) - yorigin).^2));
for i=1:numel(rename(:,1))
threeD.image.rename(:,1) = d .* cos(ltheta);
threeD.image.rename(:,2) = d .* sin(ltheta);
threeD.image.rename(:,3) = rename(i,1);
end
When i do this, it keeps telling me that I have this error: "Subscripted assignment dimension mismatch" I am not sure whether am I assigning it correctly. How can I solve this?
Thanks in advance!
  2 comentarios
Wayne King
Wayne King el 5 de Nov. de 2012
You should give us the sizes of rename(), xorigin, d, 1theta and threeD.image.rename
Rick
Rick el 5 de Nov. de 2012
Oh, I just found out the error. Its suppose to be (rename) instead of rename.
Thanks!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing 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