Converting alphanumeric to numeric format in MATLAB


If would like to turn out string to number elements, you can try this:

Use str2num function to convert a character array to the numeric value represented by that string:

str = '37.294e-1';

val = str2num(str)
val =

The str2double function converts a cell array of strings to the double-precision values represented by the strings:

Note: double elements which are currently represented in string format, they are in {}

c = {'37.294e-1'; '-58.375'; '13.796'};

d = str2double(c)
d =

That’s all,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s