Copying data from variable to script
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jeffrey
am 4 Dez. 2025 um 21:57
Bearbeitet: Matt J
am 5 Dez. 2025 um 13:34
I just upgraded from version 2018b to R2025B. I used to be able to select data in variable window and right click and select copy. I could then paste this data to a variable assignment in a matlab script and it would format correctly
e.g.
CalIndex=[40,123;159,255;364,468;522,671;732,897;907,993;1000,1220;1242,1335;1473,1534]
It appears that the right click does not show copy option and if I use ctrl-c and then ctrl-v in the matlab script it paste the data as unformatted table
1 123
206 255
398 468
522 671
732 897
907 993
1000 1220
1242 1335
1473 1534
This was a handy way to modify a variable assignment without having to type in the assigment by hand.
1 Kommentar
Matt J
am 5 Dez. 2025 um 13:23
Bearbeitet: Matt J
am 5 Dez. 2025 um 13:34
The reason for the change, I imagine, is that maybe you don't want the data pasted into the same kind of container as the one it came from. Maybe you want it to copy from a matrix to a cell array, as in,
CalIndex={40,123;159,255;364,468;522,671;732,897;907,993;1000,1220;1242,1335;1473,1534}
Or maybe you want to paste numeric data from a table into a matrix.
With the old behavior, you would be forced to remove the default container delimiters manually.
Akzeptierte Antwort
Walter Roberson
am 4 Dez. 2025 um 22:48
Verschoben: Matt J
am 4 Dez. 2025 um 23:56
If you type in
CalIndex = []
and then paste in the N x 2 table between the [ and the ] then everything will work out.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!