How to establish the handle value of a personalized plot function?
1 回表示 (過去 30 日間)
古いコメントを表示
I need to develop a program that will:
(a) plot one set of data into a figure at a time,
(b) when the next set of data is plotted, the previous plot needs to be removed.
I definied my own functioned as below:
function plot1(a, b, c, d)
plot ...
plot ...
plot ...
.... % a total of about 50 plots
end
It works very well by calling the program as below:
plot1(a, b, c, d)
Here is the problem. Because I need to remove the previous plot, I'm trying to give the plot a handle, so that I can use delete(app.A) to remove the previous plot.
app.A = plot1(a, b, c, d)
Now Matlab is complaining:
Too many output arguments.
How do I rewrite my plot program so that it can be assigned with a handle like the normal Matlab function "plot".
Many thanks.
0 件のコメント
採用された回答
Walter Roberson
2021 年 3 月 13 日
function plots = plot1(a, b, c, d)
plots(1) = plot ...
plots(2) = plot ...
plots(3) = plot ...
.... % a total of about 50 plots
end
However, have you considered just using
cla(app.AppropriateAxesHandle);
or
delete(findobj(app.AppropriateAxesHandle, 'type', 'line'));
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!