Info
This question is closed. Reopen it to edit or answer.
how to form loop to jump from one element of matrix to other element.
2 views (last 30 days)
Show older comments
Hi friends,
N_temp_failure= [ 938 945 955 2002 2003 4565 4566 4567 ];
Nx=937;
while Nx<=4567 ( i mean last element of N_temp_failure ).
Nx=Nx+0.001;
if Nx ==938
Nx= 945-1; (i mean it should jump to second element of N_temp_failure subtracted by 1 )
else
Nx=Nx;
end
end
it should repeat after Nx reaches every element of N_temp_failure, until it reaches the last element. N_temp_failure will always be in ascending order.
Please help me,
Advance Thanks Jagadesh Rao Thalur
2 Comments
Answers (1)
Manoj
on 21 Nov 2014
Does this do what you want ?
N_temp_failure= [ 938 945 955 2002 2003 4565 4566 4567 ];
for ii=1:size(N_temp_failure,2)-1
Nx=N_temp_failure(ii)-1;
while Nx <= N_temp_failure(end);
Nx=Nx+0.001;
if Nx==N_temp_failure(ii)
Nx=N_temp_failure(ii+1)-1;
else
Nx=Nx;
end
end
end
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!