フィルターのクリア

creating a .res with 2 variables side by side (2 columns)

5 ビュー (過去 30 日間)
lucas
lucas 2013 年 10 月 23 日
コメント済み: Cedric 2013 年 10 月 23 日
hello... how do i create a .res file with two variables side by side?
ex:
X = 1
2
3
4
 
Y =
1
2
3
4
column 1: colum2:
1                    1
2                    2
3                    3
4                    4
thx!

採用された回答

Cedric
Cedric 2013 年 10 月 23 日
If your .res file is a basic text file, you can proceed as follows
dlmwrite( 'myFile.res', [X,Y], 'delimiter', ' ' )

その他の回答 (2 件)

David Sanchez
David Sanchez 2013 年 10 月 23 日
x = 0:.1:1;
A = [x; exp(x)];
fileID = fopen('exp.res','w');
fprintf(fileID,'%6s %12s\n','x','exp(x)');
fprintf(fileID,'%6.2f %12.8f\n',A);
fclose(fileID);

lucas
lucas 2013 年 10 月 23 日
thx guys

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by