MATLAB: Writing the code in Word and exporting to MATLAB

word to matlab

Hello,
I would like to first write my code in word document or text and then transfer to MATLAB. Could you please let me know if this would be okay or not. Since I am not very familiar with MATHLAB, I thought it is easier to write the codes on Word document.
Thank you very much.

Best Answer

Don't do that.
MATLAB has a nice editor.
Inside matlab just type
edit mycode.m
an editor will open and you can type in your code there. It also checks your code, and recommends improvement to your code.
Once you are done to execute it either within the editor push the run button or go to matlab and type mycode and enter. it would execute your code.