Variable as placeholder in an "fopen" statement
조회 수: 5 (최근 30일)
이전 댓글 표시
Still on the issue of a place holder , I am trying to write a code to name the output folder by subject name, I know typically it goes into the braces but this time arround it is not working
''
subject = "PO1"
fid = fopen(['/Users/addison/Documents/Data/"Results2"+{subject}.xls'],'w');
''
댓글 수: 1
채택된 답변
Les Beckham
2023년 2월 8일
The way I would do this is this
subject = "PO1";
folder = "/Users/addison/Documents/Data/";
filename = "Results2" + subject + ".xls"
fid = fopen(fullfile(folder, filename));
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!