Matlab matrix copy-paste problem (pasting a matrix into the Matlab Editor in older, 1-line format)
16 views (last 30 days)
Show older comments
When I use R2022b, I copy a matrix from the Matlab table, it should be in this format"[1,1,1;0,0,0]", but it is in this format"1 1 1
0 0 0", how should I adjust to this format"[1,1,1;0,0,0]"?On the left is the Matlab table,the picture on the right shows two matrix display formats.


4 Comments
Accepted Answer
Matt J
on 6 Sep 2023
Edited: Matt J
on 6 Sep 2023
I don't think there is a preference setting that will restore the behavior you want. A workaround though is to copy/paste from the Variables Editor (the thing you've been calling the "Matlab table") to the Command Window, which will be in the format you want. You can then copy/paste from the Command Window to the Matlab Editor. See below:

See Also
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!