MATLAB: Hi,I have a question about displaying perfectnumbers

homeworkMATLABscript

I have done the script to display perfect numbers between these two numbers however my command keeps telling me that I have an undefined function or variable 'isperfect' hope someone could help me solve the issue ><
a=input('enter minimun integer number>1:');
b=input('Enter maximun integer number:');
fprintf('perfect numbers between %d and %d are:',a,a);
for i=a:b
if isperfect(i)~=0
fprintf('%d',i)
end
end

Best Answer

You need to write the function "isperfect". MATLAB isn't finding it on your path.
Also, you have a typo. That second number in your "between" should be b, not a.
Related Question