Remember to indent the bodies of your IF-THEN and looping structures.
function nf = myfact(n)in the first line of your function. Your function should check the input to make sure n is an integer. If n is an integer, your function should set nf equal to n!, otherwise the function should print an error message and set nf equal to an empty array. To do this, you can do
nf = 1:0;Note that you have already written most of this.
hw15_2.dat. You might find the break command useful. The break command is used to immediately exit a loop. Run the commands below to see how this command works.
for i = 1:10 i if(i > 5) break end end