Menu

matlab functions

kapten_sol
2007-03-14
2012-11-13
  • kapten_sol

    kapten_sol - 2007-03-14

    hi!

    when writing an .m-file, for me, the words "equal" and "short" in the following statements

    axis equal;
    format short;

    appear in purple in matlab, but are not colored in notepad++. is there any way to make these words appear in purple in notepad++ also?

    thanks.

     
    • MJG

      MJG - 2007-03-15

      It sounds like an omission in the langs.xml file.

      You could just add those words as user-defined words to the INSTRUCTION WORD style for Matlab under "Settings > Style Configurator...".

      If you want those words to be a separate purple color, you could do the following.

      This adds a "TYPE WORD" entry to the matlab style in the Styler Configurator.

      First make a backup of your langs.xml file in the Notepad++ directory or in a subdirectory under the %APPDATA% directory, depending on your install choice.  Then open the langs.xml file in Notepad++.

      If the matlab entry doesn't have a "type1" keywords line (mine doesn't), you could try inserting this line immediately after the <Keywords name="instre1"> line:

      <Keywords name="type1">equal short</Keywords>

      Put in whatever other special terms you want to treat the same way.  Save the file.

      Open the stylers.xml file in Notepad++.  Copy the "<WordsStyle name="TYPE WORD" ..." line from the <LexarType name="c" ...> entry and paste it into the <LexarType name="matlab" entry.  Anywhere inside the <LexarType> XML block is okay, as long as it is just like the other entries, on its own line.

      Save the file, close Notepad++ and reopen it.   You can configure it then to your liking.

      The problem with this is that newer Notepad++ versions will overwrite these files, so you should a) make a backup of the files when you are happy with the results, and b) submit a change request of the Notepad++ powers-that-be to correct the omission.  --Joel