How to auto save workspace variable with specific path and filename without Popup?
조회 수: 8 (최근 30일)
이전 댓글 표시
d = 'Sunday'; y = 2017;
path = 'E:\Matlab\';
filenam = 'Data';
% uisave({'d','w'},path) % this works with path but ask for filename
% uisave({'d','y'},filenam) % this works with filename but ask where to save
uisave({'d','y'},filenam,path) % i want to save this data without asking anything from user.
% if any other function can do desired task it would be acceptable
댓글 수: 0
채택된 답변
Les Beckham
2023년 10월 27일
For example:
d = 'Sunday'; y = 2017;
filepath = 'E:\Matlab\';
filename = 'Data';
save(fullfile(filepath, filename), 'd', 'y')
Also do not name a variable path. That is a very important built-in function in Matlab. Overloading that will break a lot of things.
댓글 수: 3
Les Beckham
2023년 10월 28일
Also, if you are just getting started with Matlab, I would highly recommend that you take a couple of hours to go through the free online tutorial: Matlab Onramp
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!