Automatically open certain file types outside MATLAB

54 Ansichten (letzte 30 Tage)
markushatg
markushatg am 7 Nov. 2012
Kommentiert: IronLikeABrian am 25 Feb. 2021
Is there a way to tell MATLAB to always open files of certain types outside MATLAB when double clicked in the 'Current Folder' menu, saving me the trouble of right clicking and choosing 'Open Outside MATLAB'?
Thanks
  6 Kommentare
Walter Roberson
Walter Roberson am 6 Feb. 2020
uigetfile only fetches the name of a file. You can use fullfile to create the complete file name and call winopen() on that.
IronLikeABrian
IronLikeABrian am 25 Feb. 2021
Is there any progress regarding the initial question? I'd also prefere to double-click on Excel files resulting opening Excel.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Michael Jarboe
Michael Jarboe am 6 Feb. 2020
use 'winopen' function - specify full path and filename
%Open Multiple Files
OpenMe.Path{1} = 'C:\Users\YOUR_LOGIN_NAME\Desktop\';
OpenMe.Path{2} = 'C:\Users\YOUR_LOGIN_NAME\Desktop\FOLDER_NAME';
OpenMe.Path{3} = OpenMe.Path{1};
OpenMe.FileName{1} = 'JPEG_IMAGE.jpg';
OpenMe.FileName{2} = 'Excel_File.xlsx';
OpenMe.FileName{3} = 'MS_Word_File.docx';
for i = 1:3
winopen([OpenMe.Path{i} OpenMe.FileName{i}])
end
%Open Specific File
Open_Spec_File = 'C:\Users\YOUR_LOGIN_NAME\Desktop\JPEG_IMAGE.jpg'
winopen(Open_Spec_File)

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by