Warnings when Drawing Figures in App Designer

6 ビュー (過去 30 日間)
Ben
Ben 2023 年 1 月 19 日
コメント済み: Ben 2023 年 3 月 15 日
Hello,
I'm building an audio analysis app in Matlab App Designer. I'm seeing a warning in the command window when a particular figure is generated.
Warning: An error occurred while drawing the scene: Error in web pick traversal: RangeError: Array buffer allocation failed
This warning repeats, filling the command window completely, and the figure never plots.
The warning is triggered by a button down event, which calls a function that plots a heatmap to app.UIAxes using surf(x, y, C). It seems to be an intermittent issue though. It happens most reliably when the size of C is large [2400 x 50000]. When C is [2400 x 10000], and all other variables are held constant, the figure is rendered with no error.
I have had similar issues rendering plots from large variables before on this computer (Windows 10), and have resolved these by forcing MATLAB to use Painter rather than OpenGL. From what I understand though, App Designer uses WebGL to render figures, and I haven't found a way to override this.
It has occurred to me that this warning may only be happening because my machine does not have a dedicated graphics card (It has an Intel Iris). Once deployed, this app needs to run reliably on a wide range of machines, so it does need to work on machines with Iris and similar graphics cards.
I do not need the 3D capabilities of surf(), and so I simply set 'View' to [90 90]. I thought that perhaps using some other (2D only) figure function might work better than surf(). So far none have been appropriate for my application. My preference is to use imagesc(), but I need to be able to scale the Y-axis coordinates of the image logarithmically, and imagesc does not support this. I tried pcolor() but it resulted in even more rendering issues, even with data "C" that is smaller than [2400 x 10000].
Thanks in advance for your help!
  1 件のコメント
Adam Danz
Adam Danz 2023 年 1 月 19 日
This will be difficult to troubleshoot here in the forum.
Please contact tech support and include your app, information about your machine, and instructions how to reproduce the problem.

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

回答 (1 件)

Amal Raj
Amal Raj 2023 年 3 月 13 日
This should override the renderer to painter:
app.UIAxes.Renderer = 'painters';
  1 件のコメント
Ben
Ben 2023 年 3 月 15 日
Thanks Amal, but this solution does not work within Matlab App Designer.
Mathworks support have advised me that this issue occurs because the App Designer is built on the Chromium Embedded Framework, which has a maximum Java heap size of 4GB. There is no way to override the renderer selection. Support have acknowledged that this undocumented limitation in App Designer currently has no workaround.
A warning to anybody that is considering using the App Designer for scientific or engineering research purposes: If you deal with large data arrays, and your app is likely to utilise more than 2GB of memory, MATLAB App Designer is probably not a good choice of development platform.

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

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by