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)

Write a program using matlab. Write a recursive function that prints the numbers 1...n in descending order.Solutionscript.m-------- n=input(\'enter n :\') funct

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site