How to edit each matrices in a cell?
Mostra commenti meno recenti
Hello,
I have a 50x27 matrix that contains values between 0 and 55. I have been trying to create seperate matrices dependant on intervals of the matrix values. For example, I want to create matrix A that contains all the values between 0 and 5. Then matrix B that contains values between 5 and 10. Matrix C between 10 and 15...and so on. I have started the code below. NTG_MeanEmpty is a 50x27 matrix with values between 0 and 55.
L1 = 0:5:50;
L2 = 5:5:55;
n = 10;
Analysis = cell(n, 1);
for k = 1:n;
for m = 1:10;
for i = 1:50;
for j = 1:27;
if NTG_MeanEmpty(i,j) >= L1(1,m) & NTG_MeanEmpty(i,j) < L2(1,m);
Analysis{k,1}(i,j) = 1;
else Analysis{k,1}(i,j) = 0;
end
end
end
end
end
When I run the code it seems that the matrices contained within the 10x1 cell are not populated with any data. Please could you advise on any errors in this code, or suggest an alternative method?
Thank you.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!