this is edited my script:
function[s,m]=collatz()%This function will show the steps and maxvalue of even and odd natural
%numbers. It will show the number of steps needed for the number num to
%reach 1. It will show the maxvalue in the list
%Even numbers will be divided by 2
%Odd numbers will be multiplied by 3 and add to by one
%Both will run as long as the result is greater than 1
clcs=0m=?while x>1 if mod(x,2)==0 %shows x(natural number is even)
x=x/2 elseif mod(x,2)==1 %shows x(natural number is odd)
x=x*3+1 endends=s+1;m=max(?)?
The script above is what I understood from my professor's comments, but I am still lost the m(maxvalue) and what he is saying about my x value. Sorry if the picture is blurry or sideways.
Best Answer