Create a vector (1,25) with values increasing from 0-24

조회 수: 9 (최근 30일)
Bastian
Bastian 2023년 12월 9일
댓글: DGM 2023년 12월 10일
i dont understand what i need to do hee i just wante to ask if i am doing this part correectly by doing this
Time= 1:5:24;
  댓글 수: 2
Walter Roberson
Walter Roberson 2023년 12월 9일
If you had a vector that was the integers 1, 2, 3, 4, ... 25... then subtract 1.
DGM
DGM 2023년 12월 10일
If you know how to do
Time = 1:5:24
Time = 1×5
1 6 11 16 21
you should be able to do
Time = 0:24
Time = 1×25
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

댓글을 달려면 로그인하십시오.

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 12월 9일
편집: Dyuman Joshi 2023년 12월 9일
From what I understood, you want to get a row vector having 25 elements with increasing values in the range [0 24].
For that, use linspace -
y = linspace(0,24,25)
y = 1×25
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

추가 답변 (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