Save variable as .asc file to spefic directory

Hi everyone, im new to Matlab but I have been locking around for the solution for quite some time and I cant get this right. I want to save 'var1' as .asc or .xls in a spefic directory. This is my code;
[filename,pathname] = uiputfile({'*.asc';'*.xls'},'Save as');
file = fullfile(pathname, filename);
save(file,'var1')
The file is created properly but the string in this file says some thing like: 'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Tue Jun 03 10:39:13 2014' Thank you for your help

1 件のコメント

Christian
Christian 2014 年 6 月 3 日
編集済み: Christian 2014 年 6 月 3 日
I just found out myself. If anyone cares, it needs to be specified as ascii file to display the variable as string so it is
[filename,pathname] = uiputfile({'*.asc';'*.xls'},'Save as');
file = fullfile(pathname, filename);
save(file,'var1' ,'-ascii' )

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2014 年 6 月 3 日

編集済み:

2014 年 6 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by