필터 지우기
필터 지우기

Is it possible to use : operator to create a sequence which has a power of 2 increase step?

조회 수: 2 (최근 30일)
I want to create a sequence of numbers that increase by power of two: 4 8 16 32 64 128 256 . Is it possible to do it with a colon operator, similarly to how I would create a sequence from 2 to 8 with a step increase of 2 (ie. 2 4 6 8) using A= 1:2:8?
Thank you!

채택된 답변

Matt J
Matt J 2023년 1월 18일
편집: Matt J 2023년 1월 18일
2.^(2:8)
ans = 1×7
4 8 16 32 64 128 256

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by