save data in a special folder
15 次查看(过去 30 天)
显示 更早的评论
i used this dlmwrite('phase.txt',phase) to save the phase in a txt file.
how could i tell matlab to save this data in a spacial folder. for exemple
C:\A\b\data
thank you!
0 个评论
采纳的回答
Vishal Rane
2012-12-7
Instead of 'phase.txt' use the full file-name
dlmwrite('C:\A\b\data\phase.txt',phase)
2 个评论
Image Analyst
2012-12-7
A more robust way is to use fullfile():
fullFileName = fullfile('C:\A\b\data', 'phase.txt');
It handles the proper direction of slashes (forward or backward) and will also figure out if it needs to append a trailing slash to the folder (which is the first argument) before it concatenates them. You might also want to call uigetdir() to let the user decide what folder to store the file in.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Name Construction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!