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!