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

2 Ansichten (letzte 30 Tage)
zhang bo
zhang bo am 7 Jun. 2024
Verschoben: Image Analyst am 9 Jun. 2024
How do I copy a file to a clipboard using MATLAB, just like using the shortcut Ctrl+C in a Windows system. Thanks!

Akzeptierte Antwort

zhang bo
zhang bo am 9 Jun. 2024
Verschoben: Image Analyst am 9 Jun. 2024
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);"

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by