Azzera filtri
Azzera filtri

related to the fprintf

1 visualizzazione (ultimi 30 giorni)
PA
PA il 5 Lug 2022
Commentato: PA il 5 Lug 2022
SCRW;NAME;SCRW_1
SCRW;NAME;SCRW_2
SCRW;NAME;SCRW_3
SCRW;NAME;SCRW_4
i need a text file exactly this way so how can i write the code with. it should execute automatically with the number of shoes

Risposte (1)

Walter Roberson
Walter Roberson il 5 Lug 2022
number_of_shoes = 4;
for shoe_number = 1 : number_of_shoes
filename = sprintf('SCRW;NAME;SCRW_%d', shoe_number)
end
filename = 'SCRW;NAME;SCRW_1'
filename = 'SCRW;NAME;SCRW_2'
filename = 'SCRW;NAME;SCRW_3'
filename = 'SCRW;NAME;SCRW_4'

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by