Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

I want to save my .txt file into a particular location using matlab

조회 수: 4 (최근 30일)
Sam17
Sam17 2019년 8월 7일
마감: MATLAB Answer Bot 2021년 8월 20일
I want to save my text file into a location using matlab.
Right now it saves where my code is.
i tried this:
c='D:\Scripts\MATLABScripts';
filename = strcat(c,'\','_test.txt');
fid=fopen(filename);
Nothing happens.
Can anyone suggest anything here?
  댓글 수: 1
Guillaume
Guillaume 2019년 8월 7일
prefer fullfile to building paths with string concatenation, i.e.:
filename = fullfile(c, 'test.txt');
The code snippet you show opens a file for reading but doesn't do anything with it. (it doesn't even read from the file).
Without the code that you actually use for writing to the file, it's hard to tell what's wrong.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by