{"id":300,"date":"2008-11-13T15:39:12","date_gmt":"2008-11-13T14:39:12","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=300"},"modified":"2008-11-17T17:20:37","modified_gmt":"2008-11-17T16:20:37","slug":"associating-the-matlab-editor-with-m-files-in-gnome","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=300","title":{"rendered":"Associating the MATLAB Editor with .m files in GNOME"},"content":{"rendered":"<p>If you double click on a MATLAB .m file on a Windows machine then it will open the file in the MATLAB editor by default.\u00a0 So how do you get similar behaviour in Linux you might ask?\u00a0 This question was <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/newsreader\/view_thread\/239151\">recently posed on the MATLAB users group<\/a> and since no one gave an answer I thought I would have a go and see what I could come up with.\u00a0 After all, how hard could it be?<\/p>\n<p>I&#8217;ll cut a long story short and just tell you the solution.\u00a0 To be specific the following tip works on Ubuntu 8.10 running GNOME 2.24.1 but I imagine that a similar procedure would work for some other setups as well.<\/p>\n<ul>\n<li>Right click on any .m file you like and, in the menu, click on <strong>Open With<\/strong>-&gt;<strong>Open With Other Application<\/strong><\/li>\n<li>Click on the arrow to the left of <strong>Use a custom command<\/strong><\/li>\n<li>In the resulting dialogue box type<\/li>\n<\/ul>\n<p><code><br \/>\nmatlab -desktop -r \"edit %f\"<br \/>\n<\/code><\/p>\n<ul>\n<li> Click on Open<\/li>\n<\/ul>\n<p>MATLAB will start up and then the editor will open your file. In future you will not need to type the above command because GNOME will have added an extra item to the Open With menu &#8211; namely <strong>Open with &#8220;matlab&#8221;<\/strong><\/p>\n<p>Hope this helps someone out there and, as always, comments are welcome.<\/p>\n<p>If you enjoyed this article, feel free to <a href=\"http:\/\/feeds.feedburner.com\/WalkingRandomly\">click here to subscribe to my RSS Feed.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you double click on a MATLAB .m file on a Windows machine then it will open the file in the MATLAB editor by default.\u00a0 So how do you get similar behaviour in Linux you might ask?\u00a0 This question was recently posed on the MATLAB users group and since no one gave an answer I [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,11],"tags":[],"class_list":["post-300","post","type-post","status-publish","format-standard","hentry","category-linux","category-matlab"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-4Q","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=300"}],"version-history":[{"count":2,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/300\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/300\/revisions\/314"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}