Update plot using set() with xData and yData
이전 댓글 표시
Hello,
Im trying to set a plot handle by updating its xData and ydata.I have a 2048X8 array of doubles called normWanted = 2048X8 of double type.
Ive tried:
set(hPlot3, 'Xdata',1:2048,'Ydata',normWanted);
I get the error"Value must be a vector of numeric type"
Now if I try: set(hPlot3, 'Xdata',1:2048,'Ydata',normWanted(:,1)); <- this works but only plots 1,would like to plot all 8 arrays
Any ideas on how to plot this using set or a better way,I have a figure with multiple subplots so?
댓글 수: 2
jonas
2020년 7월 28일
What exactly is hPlot3? Is it an array of handles? Are you trying to update 8 line handles?
채택된 답변
추가 답변 (1개)
Peter Kövesdi
2026년 4월 20일 11:13
You can also set all Lines at once by making a cell array out of option name and Data:
figure;
pl=plot(1:2048,rand(3,2048))
set(pl,{'XData'},{1:2048},{'YData'},mat2cell(rand(3,2048),ones(1,3),2048))
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!