필터 지우기
필터 지우기

How do I get Matlab to automatically generate the code for what I have done in the Command Window?

조회 수: 11 (최근 30일)
Hi.
I have done a lot of work in the command window, and with graphing apps, in Matlab 2016. I saw a presentation, so I know that there is a way to get Matlab to write out the code for everything I did in a file, but I can't figure out how to do it. I can get the code for the graphs from the graphing app, but how do I get the command window code to print nicely?

답변 (2개)

Star Strider
Star Strider 2017년 4월 30일
The diary (link) function may be what you want.

Walter Roberson
Walter Roberson 2017년 5월 1일
You can open the Command History window, and copy commands out of it into a .m file.
You might be interested in using the relatively new "Live Script". If you have a new enough version of MATLAB, then under New you can choose Live Script. See https://www.mathworks.com/help/matlab/matlab_prog/what-is-a-live-script.html
  댓글 수: 1
Steven Lord
Steven Lord 2017년 5월 1일
If you select one or more commands from the Command History and right-click, one of the items in the context menu that appears will allow you to create a script file (or a Live Script) directly from those selected commands, eliminating the need to manually copy and paste.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by