Azzera filtri
Azzera filtri

save data file without movefile

1 visualizzazione (ultimi 30 giorni)
Somnath Kale
Somnath Kale il 10 Dic 2020
Commentato: Cris LaPierre il 14 Dic 2020
Hi
i wanted to save my generated datafile in folder "C:\Users\IISER BPR\Documents\MATLAB\Instrument program\SMU_Keysight\Data"
I dont want to use movefile because it shows error. can someone please suggest me that how to do that?
it will bve great if one write small code.
Thanks in advance

Risposta accettata

Cris LaPierre
Cris LaPierre il 10 Dic 2020
Include the full path in your file name when you save the file.
You can use the function fullfile to help you combine your path and filename into a single string.
  4 Commenti
Somnath Kale
Somnath Kale il 13 Dic 2020
Modificato: Somnath Kale il 13 Dic 2020
I am continuously collecting data in array and then making table using array and then writing table to the data file. here is the attached code:
% To save and Display the collected data
Resisatnce = Voltage./Current ;
Collected_Data = table(Time, Voltage, Current, Resisatnce) ;
writetable(Collected_Data, DatafileName,"Delimiter",'\t') ;
% to move datafile to Data Folder
movefile(DatafileName, 'C:\Users\IISER BPR\Documents\MATLAB\Instrument program\SMU_Keysight\Data')
By the way i have another question also can I write the data directly to the text file?
Cris LaPierre
Cris LaPierre il 14 Dic 2020
Untested
% To save and Display the collected data
Resisatnce = Voltage./Current ;
Collected_Data = table(Time, Voltage, Current, Resisatnce) ;
path = 'C:\Users\IISER BPR\Documents\MATLAB\Instrument program\SMU_Keysight\Data';
writetable(Collected_Data, fullfile(path,DatafileName),"Delimiter",'\t') ;
I do not have any experience trying to stream data directly to a file. You might find this post helpful. If not, I suggest starting a new question for that.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by