Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

4 Ansichten (letzte 30 Tage)
Sam17
Sam17 am 7 Aug. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Guillaume
Guillaume am 7 Aug. 2019
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.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by