Matlab matrix copy-paste problem (pasting a matrix into the Matlab Editor in older, 1-line format)

18 次查看(过去 30 天)
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 个评论
Yu
Yu 2023-9-6
Thank you for your attention and reply to the problem. I have updated the problem and displayed pictures. I hope you can understand my problem and find a solution.
Yu
Yu 2023-9-6
You may understand my problem, my obsession is that when I used R2018b before, as long as I copied from the matlab table to the matlab editor, it is a one-line format, the elements are separated by commas and semicolons, very convenient. I recently installed R2022b, it becomes a multi-line format after copying.

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2023-9-6
编辑:Matt J 2023-9-6
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:

更多回答(1 个)

Matt J
Matt J 2023-9-6
编辑:Matt J 2023-9-6
Type the brackets [] at the desired location and paste into the space between them.
  6 个评论
Yu
Yu 2023-9-6
I copied from the matlab table to the script, first copying the matrix in excel to the Matlab table and then from the Matlab table to the script. This matrix display format should have a function can be controlled, but where is this function, I can not find.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by