How to print the output file in .txt format?

1 回表示 (過去 30 日間)
Ismail Qeshta
Ismail Qeshta 2018 年 2 月 14 日
コメント済み: Ismail Qeshta 2018 年 2 月 14 日
Hi. I am generating results using the following code: I need to print an output file to be placed in a specific folder for "Force" output in the .txt format? Can anyone please help me with this. Thank you very much.
a=[1.8803 1.2893];
e=[0.5 1];
b = [1.22];
R=[1200];
na = numel(a) ;
ne = numel(e) ;
Force = zeros(na, ne) ;
for i = 1 : na
for j = 1 : ne
Force(i,j) = (a(i))*((e(j)))*b*R;
end
end

採用された回答

KSSV
KSSV 2018 年 2 月 14 日
Read about save
If you want to save a variable data into text file; use the following:
save myfile.txt data -ascii ;
Alternatively, you can have a look on fprintf and dlmwrite.
  1 件のコメント
Ismail Qeshta
Ismail Qeshta 2018 年 2 月 14 日
Thank you very much

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

その他の回答 (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