My current problem refers to the below script and function.
clear; for x=100:145 assfunct1(x); fprintf('x: %d, a: %d, b: %d, c: %d\n', x, a, b, c); end;
&
function [a,b,c] = assfunct1(x)if x<0 || fix(x) ~=x; disp('error, input is not a non negative integer')returnendfor a=1:x b=sqrt(5*a^3); c=sqrt((a+b)^2);end [a,b,c]end>> Assignment1ans = 1.0e+03 * 0.1000 2.2361 2.3361Undefined function or variable 'a'.Error in Assignment1 (line 4)fprintf('x: %d, a: %d, b: %d, c: %d\n', x, a, b, c);
Been trying for hours to work where I have erred, ty for any help you can offer.
Best Answer