How to read an array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Suppose I have an Array called Heart_Rates containing a few values in it. And I have written following code to read it and categorize its elements and display only their file names.
for b=1:length(Heart_Rates)
if Heart_Rates(b)>=60 || Heart_Rates(b)<=80
Normal(1,:)=filenames{b};
elseif Heart_Rates(b)>80 || Heart_Rates(b)<100
Abnormal(1,:)=filenames{b};
else Heart_Rates(b)>=100
Atrial_Fibrillation(1,:)=filenames{b};
end
end
But I am not getting the proper output. Can u please tell me what is the proper code to correct it?
0 Kommentare
Antworten (1)
Walter Roberson
am 4 Mai 2016
mask = Heart_Rates(b)>=60 || Heart_Rates(b)<=80;
Normal = filenames(mask);
mask = Heart_Rates(b)>80 || Heart_Rates(b)<100;
Abnormal = filenames(mask);
mask = Heart_Rates(b)>=100;
Atrial_Fibrillation = filenames(mask);
Question: what are you going to do for heart rates below 60?
1 Kommentar
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!