PDA

View Full Version : Quick MATLAB question




R.Youden
Feb 8, 2007, 04:39 AM
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
Feb 8, 2007, 05:47 AM
in scilab, it would be blah(2:$) IIRC in matlab that would be spelled blah(2:end)

atszyman
Feb 8, 2007, 06:51 AM
I think this would do it:

a= [1 2 3 4];
b=a(2:4);

R.Youden
Feb 8, 2007, 07:09 AM
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.