String parsing

2 次查看(过去 30 天)
skyimager
skyimager 2012-6-2
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?

采纳的回答

Walter Roberson
Walter Roberson 2012-6-2
lastc = find(a == ',', 1, 'last');
b = a(1:lastc-1);
c = a(lastc+1:end);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by