Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Save FOR loop values in a matrix or a vector
조회 수: 1 (최근 30일)
이전 댓글 표시
I have the following function with two FOR loops:
function Y = rot_mat(X)
n = sqrt(numel(X))
for x = 1:n
for y = 1:n
x_rot = x+y-1
y_rot = n-x+y
end
end
I am trying to save all the n x n values [x_rot, y_rot] in a vector or a n x n matrix. Could anyone, please, give me a hint on how to do that?
댓글 수: 0
답변 (1개)
Image Analyst
2014년 7월 3일
편집: Image Analyst
2014년 7월 3일
Use x_rot(x,y) and y(rot(x,y).
By the way, you need to assign Y or else your function cannot be called.
댓글 수: 3
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!