看板 MATLAB 關於我們 聯絡資訊
以往我都是用很久以前在版上看到的方式,留下特定變數並清除其他變數 像以下的例子就是留下fTime和fCurrentFile兩個變數並刪除其他變數 cClearVariables=who; %all variables cClearVariables(strmatch('fTime',cClearVariables))=[]; %remain cClearVariables(strmatch('fCurrentFile',cClearVariables))=[]; %remain for fCVn=1:length(cClearVariables) eval(['clear ' cClearVariables{c}]); end; clear cClearVariables fCVn;clc; 想請問板上神人有沒有更簡潔的寫法m(_ _)m ※ 編輯: asked 來自: 140.115.120.189 (09/28 10:38)
math99:clearvars 09/28 11:46
asked:呃感謝樓上 這指令一直都有嗎? 感覺自己好像笨蛋~_~ 09/28 12:01