X = [struct(jjj).name,' seed ', seedno]; disp(X) is not printing seedno
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Zeynab Mousavikhamene
il 26 Ott 2019
Modificato: Stephen23
il 26 Ott 2019
seedno=data.seed
X = [struct(jjj).name,' seed ', seedno];
disp(X)
any idea why disp(x) is not showing the seedno?
the ouput of disp(x) is:
K_0.045 seed
but it should be:
K_0.045 seed 0
I did not use ; after seedno to print it and is prints correclty:
seedno =
0
0 Commenti
Risposta accettata
Più risposte (1)
Image Analyst
il 26 Ott 2019
Modificato: Image Analyst
il 26 Ott 2019
Because it's a number not a string. Try
seedno = sprintf('%.2f', data.seed)
X = [struct(jjj).name,' seed ', seedno]
disp(X)
or
seedno = sprintf('%.2f', data.seed)
X = [struct(jjj).name,' seed ', seedno]
fprintf('X = %s\n', X);
0 Commenti
Vedere anche
Categorie
Scopri di più su Low-Level File I/O in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!