app.TextArea.Value takes long time to set

Hi
I'm trying to display relativly large amount af data in a textArea (app designer) but it take very long time which increased when data get bigger.
I used profiler to review:
In this example I have ~25k text lines which toke ~8 seconds to display. In another attampt I had ~50k lines which toke 40 seconds.
Anyway to improve that?

1 Comment

I'm very late on this, but upon investigation of a similar issue, it appears the function used by MATLAB to split the current text area into a cell array (where each cell is a line) is extremely inefficient; it copies the entire table between variables once per iteration through the array, even if there are no lines to check.
My solution was to turn the text into a string scalar (separated by newliens) before sending it to the TextArea. The function is still slow, but because there's only a single item for it to check, it at least runs in just one iteration of the loop.
If you don't need it to accept user input, an alternate solution is to use a UILabel inside of a scrollable GridLayout.

Sign in to comment.

Answers (0)

Products

Release

R2018a

Asked:

on 2 May 2019

Commented:

on 2 Oct 2026 at 15:29

Community Treasure Hunt

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

Start Hunting!