I can't get an external function to plot to app.UIAxes

2 ビュー (過去 30 日間)
AThomas
AThomas 2020 年 6 月 25 日
回答済み: Walter Roberson 2020 年 6 月 25 日
I have a function external to the app that is called to animate (using drawnow) a plot to app.UIAxes
I cannot work out where I am going wrong. I can't even get it to plot 1 graph let alone get it to use drawnow.
The .m function file has the header
function [output] = MyFunction(app, input)
And has a plot line within a loop of
plot('app.UIAxes', variable);
drawnow limitrate nocallbacks

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 6 月 25 日
plot('app.UIAxes', variable);
That asks MATLAB to use the literal character vector ['a' 'p 'p' '.' 'U' 'I' 'A' 'x' 'e' 's'] as the data to plot. However, data to plot must be numeric or datatime or duration or a graph() or digraph() object.
Try
plot(app.UIAxes, variable);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by