Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

R.Youden

macrumors 68020
Original poster
Apr 1, 2005
2,093
40
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.
 

iMeowbot

macrumors G3
Aug 30, 2003
8,634
0
in scilab, it would be blah(2:$) … IIRC in matlab that would be spelled blah(2:end)
 

R.Youden

macrumors 68020
Original poster
Apr 1, 2005
2,093
40
I think this would do it:

a= [1 2 3 4];
b=a(2: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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.