Copy and paste not working in the MATLAB editor?

658 ビュー (過去 30 日間)
Ella Feldmann
Ella Feldmann 2017 年 1 月 20 日
コメント済み: Steven Lord 2024 年 9 月 5 日
Hi, I think my MATLAB updated to the latest version this morning. Now the copy and paste functions don't work. Copying from other applications and pasting into MATLAB doesn't work. Copy and paste still works in other programs, but I can't paste into the MATLAB editor window.
  9 件のコメント
Frank
Frank 2022 年 10 月 23 日
編集済み: Frank 2022 年 10 月 23 日
@Image Analyst , I hate to complicate the issue, but I have just noticed something I had not seen before, but it seems related. I have been working quite a long time tonight on something and have begun to notice that sometimes (currently about every 15 minutes or so) the editor stops responding to keyboard entries completely. By this I mean if I type any key, the editor does not respond by entering that keystroke into the editor pane. I can move the cursor around and select things but things like backspace and entering text do not work. I have not characterized it very well yet, but it seems similar to this thread
which has been ongoing for some time and some commenters there claim it may have something to do with Java versions. In my case, the "open another editor pane" fix for the copy/paste issue also clears the keyboard lack of response, but I think other methods may also work. I have no idea if the two issues are related but it seems suspciously similar. I will watch it. If it keeps up I may fiddle around a little bit to try to tie the issue down a little more.
GIRI RAJASEKHAR GUNNU
GIRI RAJASEKHAR GUNNU 2023 年 8 月 11 日
Go to
Home>>Preferences>>Keyboard>>Shortcuts
Here search copy and assign Ctrl+C as well as Ctrl+V to paste. In matlab the shourtcuts are different so Ctrl+c and Ctrl+V don't work Once you assign this it works as usual.

サインインしてコメントする。

採用された回答

Oliver Jaehrig
Oliver Jaehrig 2023 年 8 月 25 日
This is a known bug and was fixed in releases R2022b Update 6 and R2023a.
If you still observe a similar behavior, please report it to the Technical Support team by creating a Service Request:
Please do not forget to send the following information:
Output of this command:
ver -support
and the full reproduction steps.

その他の回答 (17 件)

Frank
Frank 2022 年 2 月 20 日
I have been having this same problem with 2021b. It seems not to happen after just opening matlab but starts after a time (not more than 20ish minutes). I can close matlab and restart and that seems to work for a short while also. I checked my keyboard shortcuts preferences settings and Windows is selected not emacs. Plus it is not just the Ctrl+C, Ctrl+V (i.e. the shortcuts) that are not working but the "copy" and "paste" options are not in dark font in the right-click pop up menu, and are not selectable, regardless of whether there is anything in the clip/copy memory. I have found one workaround that seems to be working without fail, but it is still annoying. I found that if I have copied something that I want to paste into a function, I can open up a new script, which allows me to paste into the new script. Then if I copy from the new script I can paste that back into the function where I had wanted to paste it in the first place. Curious. Not monumentally disastrous, but definitely annoying.
  21 件のコメント
Image Analyst
Image Analyst 2024 年 9 月 5 日
Contact tech support. Call then or go here: Bug Reports
I believe it was fixed 2 years ago. At least I have no longer experienced it.
Steven Lord
Steven Lord 2024 年 9 月 5 日
If you're using update 7 of release R2022b or later or release R2023a or later and cannot copy and paste into the Editor, please contact Technical Support directly using this link and describe the exact process with which you can reproduce this behavior. [If you have software that can let you record your interactions with the Desktop, recording a video showing your steps could be very useful.]

サインインしてコメントする。


Frank
Frank 2022 年 10 月 4 日
Just upgraded to R2022b on Windows 10 and the problem still exists.
My work around still works: when editing functions, scripts, etc and the failure to copy/paste occurs, I just open up a new edit pane and paste into that. After doing that, when I go back to what I was editing, paste works fine. At this stage it is only a minor inconvenience for me.
  4 件のコメント
Jenberia Getnet Demil
Jenberia Getnet Demil 2023 年 2 月 18 日
編集済み: Jenberia Getnet Demil 2023 年 2 月 18 日
I found it as a proper solution. Thank you!
Adam
Adam 2023 年 7 月 4 日
It works for me !

サインインしてコメントする。


Philippe Lebel
Philippe Lebel 2018 年 12 月 27 日
編集済み: Philippe Lebel 2018 年 12 月 27 日
this will maybe seem redundant, but for precision of answer:
the path to change the keyboard setting in order to allow copy-paste as mentionned in Ed's post is:
HOME -- > Preferences --> MATLAB --> Keyboard --> Shortcuts.
  2 件のコメント
Adnane CHAKIR
Adnane CHAKIR 2023 年 3 月 2 日
thank you bro .. by changging active setting to windows default it works
Kayna Mendoza Trujillo
Kayna Mendoza Trujillo 2023 年 3 月 17 日
omg thank you!

サインインしてコメントする。


Image Analyst
Image Analyst 2022 年 3 月 9 日
I've found that every 3 or 4 days with r2021b, paste won't work in the editor. I can paste to the command window and other places outside MATLAB, but not into the command window. Restarting MATLAB seems to fix it.
  1 件のコメント
William Umlauf
William Umlauf 2023 年 1 月 5 日
I just ran into this with 2022b as well.

サインインしてコメントする。


McG
McG 2022 年 3 月 18 日
I have the same problem both with R2021b update 3 and R2022a. Sometimes, but I don't know exactely when and why, paste command doesn't work. After restarting matlab everything starts to works again for undefined time (1 minute, 1 hour, 1 day...).
  3 件のコメント
Image Analyst
Image Analyst 2022 年 3 月 22 日
編集済み: Image Analyst 2022 年 3 月 22 日
@Leonidas Mavroudakis The previous version is not free of bugs. Every large complicated software has bugs. Even Microsoft, HP, Oracle, Apple, Google, Facebook, etc. have bugs in their software. As versions progress, old bugs get fixed, but unfortunately new bugs get introduced (though mostly in newly-added functionality).
For a list of known bugs in MATLAB and Simulink, go here:
ILoveMATLAB
ILoveMATLAB 2022 年 9 月 10 日
McG
I started to have this problem last week in 2022a. Closing and reopening the editor tabs fixes the issue on my machine temporarily.

サインインしてコメントする。


Steve Shelby
Steve Shelby 2022 年 9 月 2 日
編集済み: Steve Shelby 2022 年 10 月 26 日
Same problem in 2022a. Works again after closing & reopening the file in the MATLAB editor. No restart needed.
  • The Windows keyboard shortcuts are indeed enabled for CTRL+C and CTRL+V. Not the problem.
  • It doesn't work using keyboard shortcuts, nor menu selection. It is beyond the keyboard shortcuts.
  • I can generally paste what I copy to other files in other editors, ... just not to any file in the MATLAB editor.
  • When I close and reopen the file I'm working with then it seems to work fine.
  • Once I close & reopen just one file, ... issue seems to go away for all files.
  4 件のコメント
Steve Shelby
Steve Shelby 2022 年 10 月 26 日
Using Windows 10 Enterprise. MATLAB 2022a.
Piotr Balik
Piotr Balik 2023 年 4 月 20 日
Wow! I think simple reopening works like a charm. Helped me once just now :D

サインインしてコメントする。


David Veit
David Veit 2022 年 9 月 28 日
Same problem here R2022a Update 5. Problem still exists.
It is not a problem with the keyboard shortcuts as also copy/pase using context menu is not working. Works outside MATLAB and Editor restart temporarily "fixes" the problem.

Ed Marquez
Ed Marquez 2017 年 1 月 26 日
Hi,
The keyboard short-cuts for Copy (Ctrl+C) and Paste (Ctrl+V) may not work if the "Editor/debugger key bindings" preference is set to "Emacs" instead of "Windows". This may be worth checking for your MATLAB.
In order to check the MATLAB Keyboard preferences File -- > Preferences --> Keyboard --> Shortcuts. If the "Active Settings" option is set to "Emacs", the Copy (Ctrl+C) and Paste (Ctrl+V) features will be disabled. To enable these features, change the "Editor/debugger key bindings" option to "Windows" and click on the "Apply" button in the right bottom corner of the "Preferences" window.
  4 件のコメント
JFLabrie
JFLabrie 2018 年 12 月 6 日
Similar issue on MATLAB Version: 8.5.0.197613 (R2015a).
Works for a while, then it stops working. I need to restart Matlab and it works again for a while.
My preferences indicate: "Windows Default Set".
I can copy from Workspace and paste to Windows Notepad.
I can copy from Editor and paste to Windows Notepad.
I can't paste to Workspace wherever come my copied data.
I can't paste to Editor wherever come my copied data.
That makes me believe the copy function still work in Matlab but that it is the paste function that turns off or has an issue after working with Matlab for a while.
amin ya
amin ya 2018 年 12 月 30 日
Same here. Restart helps but annoying.

サインインしてコメントする。


Mattias Arlbrant
Mattias Arlbrant 2022 年 8 月 11 日
Copy-paste randomly stops working in 2022a. It has been like this for many years now. Please fix this ASAP, it is incredibly annoying.
Btw, "Every large complicated software has bugs" is a horrible excuse for ignoring serious bugs for years. Years!
Mathworks has a very unfortunate tendency to prioritize adding new unstable functionality instead of making the basics work.
  5 件のコメント
Walter Roberson
Walter Roberson 2022 年 9 月 10 日
Datapoint: I have never had this happen on MacOS Catalina.
Walter Roberson
Walter Roberson 2022 年 10 月 7 日
I have in the past seen reports of software problems that turned out to depend on the exact processor model together with the order that operating system and DLL updates were installed. Knowing the installed software versions was not enough even if you happened to have the right processor model: you had to have updated in a particular order for the problem to happen.
For example if the first time you installed a particular runtime DLL was after a particular OS update then the problem might occur, but if you had the runtime already installed at the time of the update then even though the update process involved upgrading the DLL, then the problem might not occur. Same installed software, different results (this kind of problem is sometimes a matter of different registry entries, but sometimes different internal versions of the software can get installed...)
Some problems are just really hard to reproduce. They might affect some people a fair bit and yet never occur on the test systems.

サインインしてコメントする。


David Veit
David Veit 2022 年 10 月 4 日
Viewing at the suggestions I found out that for me it is enough to switch to another editor tab in the same window and back, without any pasting or typing in the other window. Just switching is enough for me. Note that it has to be in the same Editor Dock Window to work.
  1 件のコメント
Image Analyst
Image Analyst 2023 年 1 月 4 日
It just happened to me after not happening for about 7 weeks. It's in the clipboard (I can see it) but it won't paste. Just switching editor window to a new m-file and then switching back did not allow me to paste it, so that didn't fix it. I had to close down the "bad" m-file and reopen it. Then I could paste into it again.

サインインしてコメントする。


hadi shanei
hadi shanei 2023 年 3 月 29 日
I have same problem with a little difference. cntrl+c does not work but cntrl+v does. when i run matlab without adminstrator permision problem is fixed and all key works properly.
  2 件のコメント
Yongzhen Mi
Yongzhen Mi 2023 年 11 月 3 日
Thanks for the answer! I had the same problem with you. Running without being the administor does solve the problem!
Image Analyst
Image Analyst 2023 年 11 月 3 日
@Yongzhen Mi it was probably just because you restarted it, not because of admin mode. Even when I was getting this problem with earlier versions, it was fairly rare, intermittent, and unpredictable and not reproducible, but simply restarting it would fix it and the problem wouldn't occur for days or weeks after that. But since I've upgraded to R2023a and 2023b I've never experienced the problem again. I suggest you upgrade.

サインインしてコメントする。


Alon Keren
Alon Keren 2023 年 5 月 23 日
I have the same problem in R2022b, Windows10 Version 22H2.
The problem was solved by closing and reopening the m-files.
  1 件のコメント
Image Analyst
Image Analyst 2023 年 5 月 23 日
I upgraded to r2023a and I have not experienced it yet. Try upgrading.

サインインしてコメントする。


Aghamarsh Varanasi
Aghamarsh Varanasi 2022 年 10 月 4 日
Hi everyone,
We are aware of this issue and we are investigating it. We will try to fix this in a future release.
Further, if you are facing this issue, let us know which OS you are facing this, the MATLAB Version, also if you are facing this in regular editor, live editor or App designer. This will help us to narrow down the issue.
  9 件のコメント
Matt Latourette
Matt Latourette 2023 年 5 月 24 日
I also experience this problem:
MATLAB Version: 9.13.0.2080170 (R2022b) Update 1
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
My hardware is:
Dell OptiPlex 7040 with an Intel Core i7-6700 CPU
NVIDIA GeForce GTX 745 running driver version 528.49
Image Analyst
Image Analyst 2023 年 5 月 24 日
Like I said, I upgraded to r2023a and I have not experienced it yet. Try upgrading.

サインインしてコメントする。


Simon Robledo Cardona
Simon Robledo Cardona 2023 年 3 月 27 日
編集済み: Simon Robledo Cardona 2023 年 3 月 27 日
I have the same problem in R2022a, regular editor, in Windows 10. Is it fixed already in R2023a?
  1 件のコメント
Image Analyst
Image Analyst 2023 年 3 月 27 日
Please click on the "I have the same question" button up under the original question.
The developer has not let me know explicitly if they've fixed it yet, so I'm not sure. I upgraded to r2023a and I have not experienced it yet, but even before I upgraded it only happened every few weeks or so, so I can't say for sure yet.

サインインしてコメントする。


Ayushman Agrawal
Ayushman Agrawal 2023 年 6 月 20 日
Problem still exists in R2023a. Ctrl+C doesn't work in app designer code editor. Ctrl+V works fine. Also I can still copy using right click and selecting "copy", but the keyboard shortcut just doesn't work. Please fix this.
  1 件のコメント
Jenberia Getnet Demil
Jenberia Getnet Demil 2023 年 6 月 20 日
Dear Ayushman Agrawal please create new file and write something then clear it. then the copy paste shortcut will work fine.

サインインしてコメントする。


Raphael
Raphael 2023 年 10 月 11 日
I am facing the same issue in version 2023a. Macros ctrl+C, ctrl+V and crtl+X are working intermittently. Right clicking and selecting copy, paste and cut is not working as well (the option is not greyed out, but nothing happens).
  2 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 10 月 11 日
@Raphael, Best to file a service request. Follow the steps mentioned in the accepted answer.
You can also go through the workarounds others have mentioned in this thread.
Raphael
Raphael 2023 年 10 月 11 日
@Dyuman Joshi I'll file a service request, thank you. The "workaround" I was able to use was dragging and droping, for some reason that was working.

サインインしてコメントする。


Kevin
Kevin 2024 年 1 月 29 日
編集済み: Kevin 2024 年 1 月 29 日
Seems to be caused by MathWorks' "dark mode" beta bug.
So early on, soon after installing MATLAB 2022, I was getting annoyed by the assault of bright light anytime I opened the MATLAB screen, since my Windows and every other app is set to dark mode. There was no native MATLAB ability to choose a different theme so I searched online and found a way to do it by using MathWorks' beta version of "New Desktop for MATLAB". Forgot that I had even done that.
Using Simulink today, I noticed copy/paste wasn't working and neither was the "Layout" button in the scope properties. Tried a bunch of stuff including restarting MATLAB and rebooting. Going into MATLAB to look at preferences, I noticed a sticky option at the top of the toolbar to revert back to the old desktop for MATLAB. I clicked that, MATLAB restarted, and everything works great now . . . well, except I need to squint every time I activate the MATLAB screen until my eyes adjust.
As of this post, with the latest 2023 version, there still does not appear to be native MATLAB dark mode.
  1 件のコメント
Adam Danz
Adam Danz 2024 年 1 月 29 日
Note that the majority of reports in this thread were prior to the 2023 beta desktop release.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by