Plot two cell strings

조회 수: 1 (최근 30일)
Wei
Wei 2013년 12월 9일
댓글: Wei 2013년 12월 9일
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
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 9일
We can't test your data

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 9일
B = str2double( A(1:2:end, 3) );
C = str2double( A(1:2:end, 7) );
plot(B, C);
datetick('X', 13);
  댓글 수: 1
Wei
Wei 2013년 12월 9일
It works! Thanks a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by