MATLAB Answers

plotting Table doesn't work anymore?

조회 수: 114(최근 30일)
Niklas Kurz
Niklas Kurz 2020년 10월 22일
댓글: Peter Perkins 2020년 11월 19일
I alyways plotted my tables like:
T = readtable('path')
x = T(:,1)
y = T(:,2)
plot(x,y)
Why doesn't this work anymore???
it says: "Tables and timetables do not have a plot method."
But as I stated, it worked before. Something has changed?

채택된 답변

madhan ravi
madhan ravi 2020년 10월 22일
편집: madhan ravi 2020년 10월 22일
x = T{:, 1}
y = T{:, 2}
  댓글 수: 2
Peter Perkins
Peter Perkins 2020년 11월 19일
People do get confused over braces vs. parens, but the key is that you want to call plot with the two variables in the table, not the table itself. Perhaps more readable would be plot(T.x,T.y), if you know the var names.

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

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by