Use MATLAB's for loop to determine the value of y when n=192. (round answer to nearest integer)
1 次查看(过去 30 天)
显示 更早的评论
Given: x=[... a bunch of values...];
and the formula y= the sum of k=1 to n [k (cubed root x sub k)]
Part B: Use MATLAB's while loop to determine the maximum value of n where y < 165238.
I have no idea how to do this. Help appreciated.
0 个评论
采纳的回答
David Sanchez
2014-2-14
A:
y = 0;
for k=1:n
y = y + x(k)^(1/3);
end
B:
y = 0;
n = 1;
while y < 165238
y = y + x(n)^(1/3);
n = n + 1;
end
更多回答(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!