Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!