Use loops to produce the beautyofmath shown.The script should iterate from 1 to 11 to produces expression on the left, and perform specified operation to get the results shown on the right.

1x8+1=9
12x8+2=98
123x8+3=987
1234x8+4=9876
12345x8+5=98765
123456x8+6=987654
1234567x8+7=9876543
12345678x8+8=98765432
123456789x8+9=987654321
1234567900x8+10=9876543210
12345679011x8+11=98765432099
could you help me check where is wrong?

1 件のコメント

Bob Thompson
Bob Thompson 2018 年 4 月 18 日
編集済み: Bob Thompson 2018 年 4 月 18 日
Could you post your code, not just the results?
Or is the picture your code and result?

サインインしてコメントする。

回答 (1 件)

Bob Thompson
Bob Thompson 2018 年 4 月 18 日
You need to add the previous 'value' to the sum of your powers of 10 for each step in p. I would suggest doing this by turning power10 into an array and then using sum(power10).

カテゴリ

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

タグ

質問済み:

2018 年 4 月 18 日

回答済み:

2018 年 4 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by