Array that contains a geometric series
古いコメントを表示
Hi, Is there a short way to create an array in which the elements are making a geometric series?
like for example the following array:
x=[1 2 4 8 16 32 64]
Thanks, Shir
採用された回答
その他の回答 (1 件)
John D'Errico
2016 年 12 月 19 日
2.^(0:6)
3 件のコメント
shir shalom
2016 年 12 月 19 日
John D'Errico
2016 年 12 月 19 日
You could have said that the first time. But what is wrong then with this?
2.^(-1:6)
It really won't work? I guess I need to learn this new math then.
Or, for a more general form, with some other start point:
0.1*2.^(0:6)
Could I have used a loop? Of course. But why? Learn to use Matlab.
shir shalom
2016 年 12 月 20 日
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!