Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit:

String parsing

Asked by Pradip Gupta on 2 Jun 2012

My text is of the form a='1233.44,56,78,Earth'. Now i want b=1233.44,56,78 and c=Earth. how can i do that?


Pradip Gupta


No products are associated with this question.

1 Answer

Answer by Walter Roberson on 2 Jun 2012
Accepted answer
   lastc = find(a  == ',', 1, 'last');
  b = a(1:lastc-1);
  c = a(lastc+1:end);


Walter Roberson

Contact us