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 !!!

Answers (0)

Categories

Products

Release

R2017b

Asked:

on 8 Apr 2020

Edited:

on 8 Apr 2020

Community Treasure Hunt

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

Start Hunting!