I would like to convert the formula to Matlab, but each time I want to run the ToMatlab file, is there any way to automatically load the ToMatlab component when launching the software?

  • 1
    $\begingroup$ Just add Needs["ToMatlab"]` to your Init.m file. $\endgroup$ Jun 23 '18 at 12:39
  • $\begingroup$ I put the ToMatlab.m file in the Kernel folder and added Needs["ToMatlab"]` in init.m. However, it still doesn't work. Is it a problem with my operation? $\endgroup$
    – Lin 张
    Jun 23 '18 at 13:09
  • $\begingroup$ Don't forget the backtick after the packagename (markdown has a tendency to eat it). It should be Needs["ToMatlab`"]. Or how do you load the packages usually? Make sure that it is is located somewhere where mathematica can find it (e.g.in FileNames[FileNameJoin[$UserBaseDirectory, "Applications"]]) and that you edited the Init.m file that belongs to your user account (it's FileNames[FileNameJoin[$UserBaseDirectory, "Kernel", "init.m"]]). $\endgroup$ Jun 23 '18 at 13:15
  • $\begingroup$ After running FileNameJoin[{$UserBaseDirectory, "Applications"}], C:\Users\Administrator\AppData\Roaming\Mathematica\ApplicationData appears.Then I created a folder: C:\Users\Administrator\AppData\Roaming\Mathematica\ApplicationData\ToMatlabZl\Kernel. At the same time, I placed ToMatlab.m in the ToMatlabZl folder. Added Needs["ToMatlab`"] to init.m in the Kernel folder.Create a new notebook. You need to enter Get["ToMatlab""] before using ToMatlab. If you do not have Get["ToMatlab"", you cannot use the ToMatlab command. Is there any problem with my operation? thank you. $\endgroup$
    – Lin 张
    Jun 23 '18 at 14:47
  • $\begingroup$ Thank you, I've got it. $\endgroup$
    – Lin 张
    Jun 23 '18 at 15:20

Browse other questions tagged or ask your own question.