app.TextArea.Value takes long time to set
Show older comments
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
Geoff
on 2 Oct 2026 at 15:29
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.
Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!