Why won't matlab plot data from a table?
조회 수: 4 (최근 30일)
이전 댓글 표시
%I am getting an empty plot from this code.
x1=linspace(0,500000,1000);
for x=1:17
y=lightint{x,1}
plot(x1,y)
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/273018/image.png)
댓글 수: 2
채택된 답변
Rik
2020년 2월 21일
You're trying to plot a scalar multiple times, which Matlab happily does for you. You won't see anything, because your line style doesn't include a marker for single points. You also forgot hold on, so every iteration will wipe the previous.
x1=linspace(0,500000,1000);
for x=1:17
y=lightint{x,1};
plot(x1,y,'*b')
hold on
end
hold off
댓글 수: 0
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!