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
MATLAB: How do i link the menu bar function to the for loop. [Error indicates Not Enough Input argument]
for loopsfunctionsloopsmenu functionmodular script
Related Question
- Keep getting error message for making a script for checking the value of a number between 100&200
- How to pass input parameter in a function handle
- What does this error means-“Function definitions are not permitted at the prompt or in scripts.”
- Compatibility or syntax issue while running a 2014 script
- Add Image to a button
Best Answer