Plotting in GUI of Matlab

1 回表示 (過去 30 日間)
JA
JA 2016 年 8 月 24 日
回答済み: Bjorn Gustavsson 2016 年 8 月 24 日
Until now i had only 1 axes in my GUI to I used to just plot directly using plot command. Plus i need to plot these in a loop.
for i = 1:length(sig)
plot(sig(i).time,sig(i).signal,sig(i).time,updated(i).filter,sig(i).time)
hold on
end
Now i have 2 axes in my GUI, how i make a certain plot appear in 1 plot and another in my 2nd plot

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2016 年 8 月 24 日
Keep the handles to the axes you create:
axs(1) = subplot(1,2,1);
axs(2) = subplot(1,2,2);
Then make the axes you want to plot on the current axes before plotting:
for i1 = 1:17,
g = randn(1);
if g > 0
axes(axs(2))
plot(randn(1,23),'linewidth',2,'color',rand(1,3))
hold on
else
axes(axs(1))
plot(randn(1,23),'linewidth',1,'color',rand(1,3))
hold on
end
end
HTH

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by