How do i link my menu bar function to my for loop. [Error indicates Not Enough Input argument]
이전 댓글 표시
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
Ganesh Hegade
2016년 11월 23일
Do you want to link the above program to GUI Menu bar ? or where you want to call this function. ?
Kenneth Tan
2016년 11월 23일
편집: Kenneth Tan
2016년 11월 23일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!