automatic filename saving
조회 수: 9 (최근 30일)
이전 댓글 표시
hi all, i cant seem to find what im looking for, if you had a simple function such as the one below, is it possible for matlab to automatically detect the file name to save it under?
function help
%user input data which will change each time
A = [1; 2; 3]; B = [1; 3; 3];
%save data
save("filename", A); save("filename", B);
end
is there a line of code which instead of the user specifying the name each time, for matlab to just save it under a different name each time the code is run and for different values of A and B thanks kyle
댓글 수: 0
채택된 답변
Sean de Wolski
2011년 5월 5일
for ii = 1:n
fn = sprintf('file_%s.jpg',num2str(ii,%04i')); %jpegs named file_0001.jpg, file_0002.jpg etc.
save(fn,ii)
end
댓글 수: 3
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!