How do i link my menu bar function to my for loop. [Error indicates Not Enough Input argument]
Ältere Kommentare anzeigen
function [Agelessthan25,Agebetween25to50,Ageabove50]= Agecategory(AgeofCasualty)
Agelessthan25=0;
Agebetween25to50=0;
Ageabove50=0;
for x=(1:length(AgeofCasualty));
curage = AgeofCasualty(x);
if curage < 25
Agelessthan25= Agelessthan25 + 1;
elseif curage >= 25 & curage < 50;
Agebetween25to50 =Agebetween25to50 +1;
else curage >= 50;
Ageabove50 = Ageabove50 +1;
end
end
fprintf('Agelessthan25 is %d\n', Agelessthan25)
fprintf('Agebetween25to50 is %d\n', Agebetween25to50)
fprintf('Ageabove50 is %d.0\n', Ageabove50)
end
2 Kommentare
Ganesh Hegade
am 23 Nov. 2016
Do you want to link the above program to GUI Menu bar ? or where you want to call this function. ?
Kenneth Tan
am 23 Nov. 2016
Bearbeitet: Kenneth Tan
am 23 Nov. 2016
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!