How can I delete commands after they have been run on matlab?

69 ビュー (過去 30 日間)
Nadir Elamin
Nadir Elamin 2018 年 2 月 1 日
コメント済み: Image Analyst 2021 年 4 月 26 日
I have mistakenly posted commands and I want them to be deleted and not sit in my code. Please help.
  1 件のコメント
KSSV
KSSV 2018 年 2 月 1 日
Can you elaborate your question?

サインインしてコメントする。

回答 (3 件)

Walter Roberson
Walter Roberson 2018 年 2 月 1 日
Is this a question about Live Editor? If so then you can go back, highlight the link, right click, select Cut. When you have removed everything you want removed, click on Run

Image Analyst
Image Analyst 2018 年 2 月 1 日
To remove commands you have run from your command history, click on the command window prompt and hit the up arrow. Then scroll up to the command you no longer want to show up and right click on it. Select "delete" and it will no longer appear in your command history.
Alternatively you can remove it from the History.xml file manually with a text editor. If you have Windows, edit the file "C:\Users\yourName\AppData\Roaming\MathWorks\MATLAB\R2017b\History.xml" with something like Notepad, and delete the lines you don't want in your history.

Dai Tran
Dai Tran 2021 年 4 月 26 日
Type "clc" to the command window.
  1 件のコメント
Image Analyst
Image Analyst 2021 年 4 月 26 日
This will get rid of everything in the command window that is displayed, not just the "mistakenly posted commands". Nor will it remove any items from the history.
The best solution is to just type the commands wanted into an m-file rather than the command window. Then you can edit what's there all you want.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by