Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to create a for loop and save data from this loop into vector

1 回表示 (過去 30 日間)
Veronika
Veronika 2014 年 11 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by