Display Variable Value In a String
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello guys,
I have a prbolem and i don't know how to solve it.
X=214 is a vriable
command={
'NACA X'
''
'OPER'
'VISC ON'
'RE'
'160000'
};
id = fopen('command.dat', 'w+');
fprintf(id, '%s\n', comandi{:});
fclose(id);
I have to write the variable command into a .dat file. However my variable X is a number that is into a for cycle and changes his value. With this syntax in the file i will find 'NACA X' but what i need is to find 'NACA 214' for example.
Can someone help me?
Thanks very much
0 Kommentare
Antworten (1)
Star Strider
am 19 Sep. 2015
Try this:
X = 214;
command = {sprintf('NACA %d',X) '' 'OPER' 'VISC ON' 'RE' '160000' };
0 Kommentare
Siehe auch
Kategorien
Mehr zu Aerodynamics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!