save data in a special folder

4 ビュー (過去 30 日間)
Rica
Rica 2012 年 12 月 7 日
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!

採用された回答

Vishal Rane
Vishal Rane 2012 年 12 月 7 日
Instead of 'phase.txt' use the full file-name
dlmwrite('C:\A\b\data\phase.txt',phase)
  2 件のコメント
Rica
Rica 2012 年 12 月 7 日
so easy!
Image Analyst
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 ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by