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

조회 수: 4 (최근 30일)
Rick
Rick 2012년 11월 5일
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
Wayne King
Wayne King 2012년 11월 5일
You should give us the sizes of rename(), xorigin, d, 1theta and threeD.image.rename
Rick
Rick 2012년 11월 5일
Oh, I just found out the error. Its suppose to be (rename) instead of rename.
Thanks!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by