LoginSignup
0
0

More than 5 years have passed since last update.

MATLABでエディタ画面が開かなくなった場合の対処

Posted at

一言で

  • 設定を初期化しよう(最終手段)

問題の概要

MATLAB R2016b (on OSX El Capitan) において,MATLAB scriptファイル(*.m)を開こうとした場合に,MATLABのエディタが開かず以下のエラーがMATLABターミナルに出力される.
ただし,MATLAB ライブスクリプト(*.mlx)は開くことができる.

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize com.mathworks.widgets.text.mcode.MSettingsInitializer
        at com.mathworks.widgets.text.mcode.analyzer.CodeAnalyzer.isMLintEnabledInPreferences(CodeAnalyzerLayer.java:411)
        ...

対処

エラー内容でググると,

  • Javaのヒープサイズを変更する
  • 再インストール

などが出てきたが,どちらも効果はなかった.

設定初期化 (今回の解決策)

MATLABの設定を初期化したらなんとかなるのでは?と思ったので,ドキュメントの設定を読んで設定を初期化することにした.
MATLABは起動時にprefdirにあるmatlab.prfを読みに行く,とのことなのでこれを削除する.

>> prefdir

ans =

/path/to/prefdir

MATLABを終了し,ターミナルから該当ファイルを削除する1

% cd /path/to/prefdir
% ls -lah
total 1232
drwxr-xr-x  22 ****  staff   748B  2 15 19:00 .
drwxr-xr-x   4 ****  staff   136B  4  6  2016 ..
drwxr-xr-x   4 ****  staff   136B  1 17 20:05 ExportSetup
-rw-r--r--   1 ****  staff    87K  2 15 18:30 History.bak
-rw-r--r--   1 ****  staff    88K  2 15 19:00 History.xml
drwxr-xr-x   2 ****  staff    68B  4  6  2016 HtmlPanel
-rw-r--r--   1 ****  staff   6.1K  2 15 19:02 MATLABDesktop.xml
-rw-r--r--   1 ****  staff   6.1K  2 15 18:35 MATLABDesktop.xml.prev
-rw-r--r--   1 ****  staff   371B  1 19 18:32 MATLAB_Editor_State.xml
-rw-r--r--   1 ****  staff    38B  8  3  2016 MLintDefaultSettings.txt
-rw-r--r--   1 ****  staff   4.0K  1 17 22:04 comparisons.settings
drwxr-xr-x   2 ****  staff    68B 12  6 09:03 fop
-rw-r--r--   1 ****  staff   6.2K  2 15 14:43 matlab.prf
-rw-r--r--   1 ****  staff    16K  2 15 19:00 matlab.settings
-rw-r--r--   1 ****  staff   234B  1 17 20:05 matlabprefs.mat
-rw-r--r--   1 ****  staff   1.3K  4  6  2016 mwKeyStore
-rw-r--r--   1 ****  staff   1.2K  2 15 18:07 publish_configurations.m
-rw-r--r--   1 ****  staff   184B  2 15 18:07 run_commands.m
-rw-r--r--   1 ****  staff   681B  1 17 22:04 shared.settings
-rw-r--r--   1 ****  staff   223B  4  6  2016 shortcuts_ja_2.xml
-rw-r--r--   1 ****  staff   763B  4  6  2016 thisMatlab.pem
-rw-r--r--   1 ****  staff   359K  2 15 18:35 toolbox_cache-9.0.0-2848434722-maci64.xml

% rm -f matlab.*

MATLABを再起動後,エディタを開くことができることを確認した.


  1. 今回は,matlab.settings も削除した 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0