Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to create a for loop and save data from this loop into vector
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear all,
I am trying to create FOR loop, because I want to change values (vector R) of variables i and j in my function :
*('(x-j).^2+(y-i).^2<0.1^2','x','y','z')* . And after that I want to save this data into vector Q.
I try to do something, but it doesn´t work...
This is my code:
R = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1];
Q = [1:12];
for j = 1:numel (R)
i = R(j);
R(1,:)>=0 & R(1,:)<=2;
if find(0<i & i<2) == 1
Q = i
else
['x-' num2str(j) '.^2+ (y-' num2str(i) '.^2<0.1^2,' 'x,' 'y,' 'z'];
select_fcn = inline('(x-j).^2+(y-i).^2<0.1^2','x','y','z');
img_2.elem_data = 1 + elem_select(img_2.fwd_model, select_fcn);
output(j)= Q;
end
end
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!