how to find average values of answers
1 次查看(过去 30 天)
显示 更早的评论
%For example, if you write this code for a=1:5; b = 2*a + 1 end the answers are >> b =
3
b =
5
b =
7
b =
9
b =
11
I want to calculate the mean values for these answers
b average = (3 + 5+ 7+ 9+11) / 5 = 7
0 个评论
采纳的回答
Purushottama Rao
2015-8-21
b=zeros(1,5)
for a=1:5
b(a)=2*a+1;
end
k=mean(b);
2 个评论
Purushottama Rao
2015-8-21
If you want to diplay every time avg, move mean commnd inside the for loop
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!