calling a funcion in a loop and replacing input variable with output variable
So I have the funcion:
function y=function_for_Ex6a(x)
% This is a simple function
y=4*(1-cos(x)).^2+x.^3;
end
And I want to use a for loop to run through this function 100 times with an initial input of x=4. I need the output value of y to replace the input value for each interation. Any ideas? Please don’t just send links to other websites. Thanks.So I have the funcion:
function y=function_for_Ex6a(x)
% This is a simple function
y=4*(1-cos(x)).^2+x.^3;
end
And I want to use a for loop to run through this function 100 times with an initial input of x=4. I need the output value of y to replace the input value for each interation. Any ideas? Please don’t just send links to other websites. Thanks. So I have the funcion:
function y=function_for_Ex6a(x)
% This is a simple function
y=4*(1-cos(x)).^2+x.^3;
end
And I want to use a for loop to run through this function 100 times with an initial input of x=4. I need the output value of y to replace the input value for each interation. Any ideas? Please don’t just send links to other websites. Thanks. looping variables MATLAB Answers — New Questions