To compute the factorial of numbers 1 to 10 in MATLAB, we can use a for loop as follows:
main.m77 chars4 lines
Here, we use the factorial
function to compute the factorial of each number ii
in the loop, and print it using the fprintf
function. The output of this code would be:
main.m224 chars11 lines
gistlibby LogSnag