By diggering around in the registary I was able to find how to create a custom open with command. So when one of my files is clicked it calls matlab.exe -r open('"%1"'). However this always opens a new MATLAB session. I would like it to open in the existing session if there is one. Looking at how .m and .mat are opened in the registary, MATLAB is called from a different location (it has an @ on the font) and it passes a numberic option ( -58 for .m and -59 for .mat). Does anyone know anything about this or what it means?
Creating Custom File Associations
조회 수: 7 (최근 30일)
이전 댓글 표시
I work with data files that have their own file extension. We have created a large set of tools that decodes the data and allows us to perform our analysis. What I am trying to do in is associate this file type with MATLAB, so if I click on one of these files (I am using Windows 7) it will automatically open MATLAB and run the tool on the file.
I have written an open function for my file type which works fine when called from inside MATLAB and I can tell Windows to associate the file type with MATLAB, but when I click on the file it just opens MATLAB (regardless of whether it is already opened) and does nothing. Is there a way to fix this so it knows to run my openxzy function when it is trying to open a .xyz file?
Any help or suggestions are appreciated.
Greg
채택된 답변
Gregory
2011년 8월 18일
편집: Gregory
2013년 3월 19일
댓글 수: 2
Carl
2013년 2월 8일
This is great! I got my custom extension to work fine is Matlab is already up and running.
However if it is not running I immediatly get an error that the file I just clicked was not found, Matlab opens and nothing happens, not even an error message. I think this might be due to the file using programs that are run during the initialisation phase of matlab. Is there a way to postpone the opening of the file until after the init phase is completed?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!