I have tried everything and I have no luck.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fsadf
1 Kommentar
James Tursa
am 4 Okt. 2016
Please show what you have done so far, and ask specific questions about where you are having problems.
Antworten (1)
Sima
am 4 Okt. 2016
What have you tried?
You don't need a loop in Matlab, length(find(X>10)) will give you the number of elements in X that are greater than 10.
disp will display whatever string you give it and mat2str will convert any matrix to a string.
2 Kommentare
Sima
am 4 Okt. 2016
it's not as efficient but you can do:
larger_than_ten=0;
for i=1:length(X)
if (X(i)>10)
larger_than_ten=larger_than_ten+1;
end
end
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!