Error with Plotting Tall table Column Data "Tall inputs must be real column vectors."
이전 댓글 표시
I'm trying to plot data stored in a tall array accross several columns.
% Expected Behavior
t = table(1:1000);
figure;
plot(t.Var1(1,:)); % Works as expected
% Converting to tall table yields error
tallt = tall(t);
plot(tallt.Var1(1,:));
% Error using matlab.graphics.chart.primitive.tall.Line/doPlot
% Tall inputs must be real column vectors.
%
% Error in matlab.graphics.chart.primitive.tall.Line
%
% Error in tall/plot (line 84)
% htemp = matlab.graphics.chart.primitive.tall.Line('YData', y, ...
% Work around
plot(gather(tallt.Var1(1,:)));
Is there a fix that doesn't involve reading the tall array into memory?
댓글 수: 3
Edric Ellis
2019년 6월 10일
tall arrays are expected to be large only in the first dimension. That's why the plot method for tall arrays has the restriction mentioned in that error message. The expected use-case is more like this:
tallt = tall(table((1:1000)'));
plot(tallt.Var1);
Rows of a tall array are already required to fit into memory, so calling gather when plotting a single row shouldn't cause any problems. Could you give any more details about what you're trying to do in your real code?
Christopher Greulich
2019년 6월 13일
Christopher Greulich
2019년 6월 13일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Timetables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!