How do I copy a file to a clipboard using MATLAB?

4 次查看(过去 30 天)
How do I copy a file to a clipboard using MATLAB, just like using the shortcut Ctrl+C in a Windows system. Thanks!

采纳的回答

zhang bo
zhang bo 2024-6-9
移动:Image Analyst 2024-6-9
Thanks!
It seems that clipboard.m function cannot copy files to the clipboard!
I solved this problem with the following Windows command:
set file=E:\MATLAB\demo.txt
powershell -sta "$sc=New-Object System.Collections.Specialized.StringCollection;$sc.Add('%file%');Add-Type -Assembly 'System.Windows.Forms';[System.Windows.Forms.Clipboard]::SetFileDropList($sc);"

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by