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

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2017b

Preguntada:

el 8 de Abr. de 2020

Editada:

el 8 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by