MATLAB Answers

Command for saving .M files ?

조회 수: 161(최근 30일)
GIULIO RODONO'
GIULIO RODONO' 2013년 10월 15일
답변: Jan 2021년 7월 11일
Hi there! Are you all ok ?
I got a problem: I would save a .M file by another .M file; this would be usefull for me, because I often modify several files, all used by a single file after. So, could anyone tell me, if it exists, wich is the command to save a .M file, by another .M file ??
% file1.m
% HAS BEEN JUST EDITED, BUT NOT YET SAVED
%
% file2.m
% save(file1.m) <--- PSEUDO CODE FOR SAVING file1.m
Thank you in advance, for kindle answers !!

채택된 답변

GIULIO RODONO'
GIULIO RODONO' 2013년 10월 15일
이 답변에 1명의 참여자가 플래그를 지정함
AUTO-SOLVED !!!!
It was so simply !!
I had just to write :
% save file1.m
Yeah !!!
  댓글 수: 1
Jonathan Kingslake
Jonathan Kingslake 2021년 7월 5일
Even though this post is old, I will flag is for others.
This will save your workspace as file1.m, overwriting the script.

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

추가 답변(1개)

Jan
Jan 2021년 7월 11일
Name = 'file1.m'
Doc = matlab.desktop.editor.findOpenDocument(Name);
if Doc.Editable
Doc.save;
end

제품

Community Treasure Hunt

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

Start Hunting!

Translated by