Pass the text of fprintf to the plot's text
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Dyuman Joshi
am 12 Dez. 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 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Labels and Annotations 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!