简体   繁体   中英

Connecting points in scatter plot matlab

for T=1:11
plot(T,MyCell{1,1:T})
end

I stored the values in MyCell and wanted to plot the points so that each point connects to the next but it is not working.

It is still a scatter plot

因为您在每个for循环中绘制了一个单点,请尝试将结果保存在for循环中的Rspeed(1:length(T))中,然后绘制

I'm not sure I understand your question properly. However, if you have a cell array of 11 elements, where each element contains a double , and you want a line plot of the element values versus index number, the command to use is

plot([MyCell{:}]);

Or, if you want dots as well as lines:

plot([MyCell{:}], '.-')

I hope this is what you are looking for!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM