Plotting within a loop in Mobile Matlab (while code running) on iOS?

4 ビュー (過去 30 日間)
Brody Johnson
Brody Johnson 2021 年 2 月 4 日
コメント済み: Brody Johnson 2021 年 2 月 8 日
I have written a simple script to produce a figure (direction field for a differential equation) based on input from the user which is collected in a while loop. While running this program on Mobile Matlab in iOS, the figures do not appear while the code is running. Only upon exiting the program does the figure become available. I have tried adding pause and drawnow commands, but they had no effect on this behavior. The code runs as expected on my MacBook and I'm hoping there is a way to make this work with Mobile Matlab.
To isolate the issue, consider the script below. None of the intermediate graphs are visible within Mobile Matlab, only the final one consisting of 100 points.
for k=1:100
plot([1:k],rand(1,k))
pause(0.1);
end

採用された回答

Anshika Chaurasia
Anshika Chaurasia 2021 年 2 月 8 日
Hi Brody,
MATLAB Mobile has following limitations:
  • If you call a script or function that updates the same figure window more than once during its execution, the application retrieves only the last update.
  • If more than 10 figure windows are open, each command that you enter on your device returns a warning until you close the extra figures. To close figures, use the close command, for example, close(n) or close('all').
Refer to MATLAB Mobile View Figures for more information.
Hope it helps!
  1 件のコメント
Brody Johnson
Brody Johnson 2021 年 2 月 8 日
Thank you. I think my issue is more related to the limitation of live figures described in the following support article: View Figures. It reads "Live Figures: When you zoom and pan figures, the application updates the figure from the Cloud." It would be nice to know if there is a command I could insert into my code that would produce the same effect as "zooming/panning" the figure, in order to update a live figure from the Cloud while the script is still running.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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