Trying to make a three line loop that would differentiate x(adsbygoogle = window.adsbygoogle || []).push({}); ^{2}√4x+1 to the nth term starting from the original function (n=0) to the 5th derivative (n=5) and then substitute 2 into the derivatives. Here's what I got

f = @(x) x^{2}√4x+1

For n=[0:5] - As the nth term goes from 0 to 5

disp(num2str(subs(diff(f(x),n),2)))

end

Matlab says that the nth term must be an actual scalar number instead of a variable. I want the nth term to change so how can I do that?

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab Difference Equation Loop?

Loading...

Similar Threads - Matlab Difference Equation | Date |
---|---|

How to spin the colormap in 2 different circles in matlab | Mar 28, 2017 |

Matlab How to make 2D plot of points with different colors? | Dec 13, 2016 |

Matlab Finite difference numerical integration or ode45? | May 17, 2016 |

C++ vs Python vs Mathematica vs Matlab? Whats the difference | Aug 15, 2015 |

Matlab for loop and difference equation question | Mar 30, 2005 |

**Physics Forums - The Fusion of Science and Community**