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.

Respuestas (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 comentarios

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.
Mahasweta
Mahasweta el 26 de Dic. de 2013
Editada: Mahasweta el 26 de Dic. de 2013
kindly suggest modifications and corrections so as to solve the issue

Iniciar sesión para comentar.

Productos

Preguntada:

el 26 de Dic. de 2013

Editada:

el 26 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by