Constructing saved file name with variables from code
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all
I currently have a save command which labels the saved files with a static name which I change each time
If I have variables such as:
k = 1:10
I= 1:5:100
Date/Time
How can I code this so each file name takes this information for the name,
i.e something like
Test_File %datestr(now,30) plus the others.
Thanks for your help!
댓글 수: 0
답변 (2개)
Renato Agurto
2016년 3월 17일
Do you meansomething like this?
ext = '.mat'; %or .cvs, .xlsx, ...
file_name = ['Test_File_' datestr(now,30) '_' num2str(k) '_' num2str(I) ext];
댓글 수: 0
Guillaume
2016년 3월 17일
filename = sprintf('Test_File_%s_%d_%d.mat', datestr(now, 30), k, i);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!