Write a program using matlab Write a recursive function that
Write a program using matlab. Write a recursive function that prints the numbers 1...n in descending order.
Solution
script.m--------
n=input(\'enter n :\')
function f = rec_desc(n)
if(n>1)
fprintf(\"%d\",n)
rec_desc(n-1)
end
end
%call recursive function
rec_desc(n)
