1

I use matlab without GUI, I wonder how I can run part of the matlab codes in terminal. I can run part of the codes in the default matlab editor.

reference:

2
  • The official documentation didn't provide any way to call code secton from terminal. You might want to call a section of a script while running in another part of the script, which is badly wrong. Code section in Matlab is mainly used for code debugging and refining, not wrapping functions. You should pack this section of code as an individual function or script (essentially another .m file), and call it in other parts of the script. This differs Matlab from languages like C or VB.
    – Yvon
    Jul 21, 2014 at 5:50
  • @Yvon Thanks for help! I use code section for debugging(when there is an error in one line and I still want to see some results of later codes, now I usually comment the error). Since I don’t use emacs but sublime text as my editor, I cannot get this function. Now what I do is copy several lines into terminal.
    – Wei Xia
    Jul 21, 2014 at 19:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.