Pass the text of fprintf to the plot's text
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Would it be possible to pass the text of fprintf to the plot's text?
x = rand(1,10);
plot(x)
m = mean(x);
sd = std(x);
a = fprintf('the mean is %1.2f\n',m);
b = fprintf('the standard deviation is %1.2f\n',sd);
text(2,0.5,[a b])
0 commentaires
Réponse acceptée
Dyuman Joshi
le 12 Déc 2023
x = rand(1,10);
plot(x)
m = mean(x);
sd = std(x);
a = sprintf('the mean is %1.2f\n',m);
disp(a)
b = sprintf('the standard deviation is %1.2f\n',sd);
disp(b)
text(2,0.5,[a b])
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Labels and Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!