Pass the text of fprintf to the plot's text
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Dyuman Joshi
2023-12-12
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])
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!