How do i link my menu bar function to my for loop. [Error indicates Not Enough Input argument]
Show older comments
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 Comments
Ganesh Hegade
on 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
on 23 Nov 2016
Edited: Kenneth Tan
on 23 Nov 2016
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!