Write a text file with dynamically name from solve the system 972 equations

Hi, I have big problem with 972 equations and 972 variables which have from like: x1, x2,...,x27 (x will be change).
I must creat a txt file with:
x1, value(x1)
x2, value(x2)
....................
x27, value(x27)
Now I just can write a simple code like that:
id = fopen('inputabaqus.txt','w');
fprintf(id,'%s %.4f',"x1,",double(S.x1));
I don't want to repeat it 972 times so can I use the loop with using 'eval':
(open file)
for i=1:27
fprintf(id,'x(i)',double(S.xi)); (sorry I have not figured out how to write this just ideal)
end
(close)
Thank for your help !!!

回答 (0 件)

カテゴリ

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

製品

リリース

R2017b

質問済み:

2020 年 4 月 8 日

編集済み:

2020 年 4 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by