Largest value n in summation

Hi, I am completely new to Matlab, but I need to find the largest value of n for which the sum of n^(2/3) is less than 1000, by using looping.
Could you please be so kind to specify why things are placed in a certain place/way, so get a better understanding. Thanks on before hand!

回答 (1 件)

Farhath Fatima
Farhath Fatima 2020 年 2 月 12 日
編集済み: Farhath Fatima 2020 年 2 月 12 日

0 投票

Hi Stephan,
You can go through below code to find the largest value n in a summation.
Assuming ’n’ to be natural numbers.
sum=0;
i=0;
while(1)
if sum<1000
sum=sum+(i^(2/3)) ;
else
sprintf('The largets value of n in summation = %d',(i-1))%prints the value of number if sum is greater than n*(2/3)
break;
end
i=i+1;
end

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

リリース

R2019b

タグ

質問済み:

2020 年 2 月 11 日

編集済み:

2020 年 2 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by