MATLAB:
I want to plot a function from 1:10000 as x values and aFUNCTION as y values, How do I call the function to use as y valuesfrom 1:10000 input?
Function:
function [N, mx] = collatz(x)
X = x;
N = 0;
mx = x;
while X ~= 1
if mod(X,2) % X is odd
X = 3*X+1;
else
X = X/2;
end
N = N+1;
if X > mx
mx = X;
end
end
Expert Answer
An answer will be send to you shortly. . . . .