Quick MATLAB question

Discussion in 'Mac Programming' started by R.Youden, Feb 8, 2007.

  1. macrumors 68020

    R.Youden

    Joined:
    Apr 1, 2005
    #1
    I am getting very frustrated with Matlab at the moment! I need to take the following matrix:

    [1 2 3 4]​

    and turn it into

    [2 3 4]​

    I can't for the life of me work out how to do it.

    ANy help would be great, thanks.
     
  2. macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #2
    in scilab, it would be blah(2:$) … IIRC in matlab that would be spelled blah(2:end)
     
  3. macrumors 68020

    atszyman

    Joined:
    Sep 16, 2003
    Location:
    The Dallas 'burbs
    #3
    I think this would do it:

    a= [1 2 3 4];
    b=a(2:4);
     
  4. thread starter macrumors 68020

    R.Youden

    Joined:
    Apr 1, 2005
    #4
    Fantastic, thanks.

    I thought it was something like that but I have been sat in-front of Matlab for so long you just loose yourself.
     

Share This Page