フィルターのクリア

How to create a sequence.

48 ビュー (過去 30 日間)
Lord Chinex
Lord Chinex 2014 年 7 月 23 日
回答済み: Morm My 2021 年 7 月 29 日
I need to create a vector that holds a sequence. In the sequence the previous number is multiplied by 2. The sequence could stop at a desired number lets say 256 (but it could be a bigger number). How would one go about this?
Example sequnce = 2,4,8,16,32,...,256. vector = [2;4;8;16;32;64;128;256]
vector =
2
4
8
16
32
64
128
256

採用された回答

Sean de Wolski
Sean de Wolski 2014 年 7 月 23 日
v = 2.^(1:8).'
  5 件のコメント
Sandie Nhatien Vu
Sandie Nhatien Vu 2016 年 8 月 5 日
Thanks a lot!
Simon Siu
Simon Siu 2020 年 2 月 5 日
how to you know that!!!!!!!!!!!!!!!?????

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

その他の回答 (1 件)

Morm My
Morm My 2021 年 7 月 29 日
thank you very much sir.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by