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

 채택된 답변

Cris LaPierre
Cris LaPierre 2020년 12월 10일

0 개 추천

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

Somnath Kale
Somnath Kale 2020년 12월 13일
편집: Somnath Kale 2020년 12월 13일
@ cris
can you please suggest in code form I have tried several combination I didnt get the right way to do it with fullfile.
thanks in prior!
Cris LaPierre
Cris LaPierre 2020년 12월 13일
How are you generating your data? What function are you using to save the data?
Somnath Kale
Somnath Kale 2020년 12월 13일
편집: Somnath Kale 2020년 12월 13일
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?
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2020년 12월 10일

댓글:

2020년 12월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by