Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB code help

  1. Jun 6, 2009 #1

    I have the following equation, and I want to program it using MATLAB. But it is a recursive function, and it seems that I can not handle it well. So please if any one can help, I will be thankful.


    Attached Files:

  2. jcsd
  3. Jun 7, 2009 #2


    User Avatar
    Science Advisor

    I would suggest you create a 2D matrix of size k (whatever that happens to be / you choose it to be--maybe this is a parameter that your function takes in?), seed the initial values given, and then make copious use of the for or while loops in MATLAB:
    http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/f4-1931.html#brbsthm [Broken]
    http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/f4-1931.html#brbstiw-1 [Broken]
    Last edited by a moderator: May 4, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook