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

 Accepted Answer

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);"

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Release

R2018b

Asked:

on 7 Jun 2024

Moved:

on 9 Jun 2024

Community Treasure Hunt

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

Start Hunting!