Run a loop through multiple matrices
Show older comments
Hi, I have 15 matrices, say A1, A2 and so on.. I want to remove all the values below 0.10 and above 0.30 from all of these matrices. Then, I want to replace all of those places with NaN. Can someone please help me with this?
This might be basic, but I am very new to matlab or any kind of coding. Thanks! NK
Accepted Answer
More Answers (1)
Amit
on 16 Jan 2014
Something like this:
for i = 1:5
eval(['A' num2str(i) '(' 'A' num2str(i) '<0.1 | A' num2str(i) '>0.3)' '=' 'NaN'])
end
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!