How to concatinate multiple graphs on the same x y axis in matlab? [duplicate]

混江龙づ霸主 提交于 2019-12-13 10:03:44

问题


I have for loop that plots multiple graphs, whereby each graph has own window. I would like to concatenate these graphs using only one graph and x y axis.

Could someone give an example?


回答1:


The following code plots a few points in a single graph. You can place anything you'd like to plot in this plot() function.

x = [1,2,3,4];
y = [5,3,4,6];

figure; % Create a new figure window.
hold on;
for i = 1:length(x)
    plot(x(i), y(i), 'r*'); % Plot a red star.
end


来源:https://stackoverflow.com/questions/44721722/how-to-concatinate-multiple-graphs-on-the-same-x-y-axis-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!