Plot two cell strings

1 visualización (últimos 30 días)
Wei
Wei el 9 de Dic. de 2013
Comentada: Wei el 9 de Dic. de 2013
Here is my code, I want to plot the B as the X-axis and C as the Y-axis in one plot. At the same time, show the time value of B on the X-axis. I have tried different ways but no success achieved. Could anyone please help me with this problem?
Thanks
A=dataset('file','xxx.csv','delimiter',',','ReadVarName','off');
rows=size(A,1);
FormatOut=13;
for i=1:2:rows-1
B{(i+1)/2}=datestr(str2double(A{i+1,3}),13);
C{(i+1)/2}=str2double(A{i+1,7});
end
  1 comentario
Azzi Abdelmalek
Azzi Abdelmalek el 9 de Dic. de 2013
We can't test your data

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Dic. de 2013
B = str2double( A(1:2:end, 3) );
C = str2double( A(1:2:end, 7) );
plot(B, C);
datetick('X', 13);
  1 comentario
Wei
Wei el 9 de Dic. de 2013
It works! Thanks a lot!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by