How to interpret units from excel sheet data,when reading into MATLAB?

I imported this data from a NI-DAQ task,into excel,in this format.I now need to read this into MATLAB for plotting purposes,However,MATLAB seems to only recognize the data as text. Kindly suggest ways to resolve the problem.

Answers (1)

%If your data lookds like this
A={1 '-1.5m';2 '-2.5m'}
c1=A(:,1);
c2=A(:,2);
t=cell2mat(c1)
y=str2double(strrep(c2,'m',''))
plot(t,y)

2 Comments

It's displaying an error message as follows ??? The following error occurred converting from cell to double: Error using ==> double Conversion to double from cell is not possible.
kindly suggest modifications and corrections so as to solve the issue

Sign in to comment.

Products

Asked:

on 26 Dec 2013

Edited:

on 26 Dec 2013

Community Treasure Hunt

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

Start Hunting!