Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 8, 2007, 04:39 AM   #1
R.Youden
macrumors 68020
 
R.Youden's Avatar
 
Join Date: Apr 2005
Quick MATLAB question

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.
R.Youden is offline   0 Reply With Quote
Old Feb 8, 2007, 05:47 AM   #2
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
in scilab, it would be blah(2:$) … IIRC in matlab that would be spelled blah(2:end)
iMeowbot is offline   0 Reply With Quote
Old Feb 8, 2007, 06:51 AM   #3
atszyman
macrumors 68020
 
atszyman's Avatar
 
Join Date: Sep 2003
Location: The Dallas 'burbs
Send a message via AIM to atszyman
I think this would do it:

a= [1 2 3 4];
b=a(2:4);
__________________
"I don't want kids who are thinking about going into mathematics to think that they have to take drugs to succeed." - Paul Erdös
Every little bit helps, put your spare CPU cycles to good use, join the
MacRumors Folding@Home team! Get the widget
atszyman is offline   0 Reply With Quote
Old Feb 8, 2007, 07:09 AM   #4
R.Youden
Thread Starter
macrumors 68020
 
R.Youden's Avatar
 
Join Date: Apr 2005
Quote:
Originally Posted by atszyman View Post
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.
R.Youden is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
quick question mrgreeneyes Community Discussion 6 Apr 6, 2014 08:29 AM
OS X: Quick Question for those in the Know (I'm not) Irishman Mac and PC Games 4 Jan 22, 2014 09:58 PM
OS X quick question : hamiltonDSi OS X 10.8 Mountain Lion 1 Jan 20, 2013 04:11 AM
Matlab help rokusho1 Mac Basics and Help 2 Nov 8, 2012 06:19 PM
Quick Question ARF900 iPhone Tips, Help and Troubleshooting 1 Sep 26, 2012 09:17 PM

Forum Jump

All times are GMT -5. The time now is 09:57 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC