필터 지우기
필터 지우기

How does colon operator work

조회 수: 1 (최근 30일)
nullpointer
nullpointer 2015년 2월 23일
편집: Star Strider 2015년 2월 23일
I am new to matlab. Anyone know how does the colon operator works in the 2 equations?
a= [ 0.003:1/1024:0.5 ]
b= [ 1/512:1/512:i ]

채택된 답변

Star Strider
Star Strider 2015년 2월 23일
편집: Star Strider 2015년 2월 23일
The colon operator creates vectors. In your illustration, it creates ‘a’ starting at 0.003, incrementing by 1/1024, and ending at 0.5. The ‘b’ vector starts at 1/512, increments by 1/512, and ends at whatever variable ‘i’ is. (Note: using ‘i’ or ‘j’ as variables, including as loop counters, is not good programming practice. MATLAB uses them for its imaginary operators, and using them otherwise causes confusion.)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by