m=1:24*(T^-1);

조회 수: 2 (최근 30일)
Usman Mussadiq
Usman Mussadiq 2021년 9월 11일
댓글: Stephen23 2021년 9월 14일
Please explain theequation what is it mean and why it is used in programming
m=1:24*(T^-1);
  댓글 수: 2
Usman Mussadiq
Usman Mussadiq 2021년 9월 14일
Thank you very much, i did it already , but i am really thankful for your time

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

채택된 답변

Chunru
Chunru 2021년 9월 11일
T = 2 % Given a number T
T = 2
T^-1 % T^-1 is 1/T
ans = 0.5000
m=1:24*(T^-1) % m is from 1 to 24/T=12 with default step of 1
m = 1×12
1 2 3 4 5 6 7 8 9 10 11 12

추가 답변 (1개)

Walter Roberson
Walter Roberson 2021년 9월 11일
In context, is T a scalar floating point value that is expected to be less than 1 ?
If so, then the code would be equivalent to
m = 1 : 24./T;
which would be equivalent to
m = 1 : floor(24./T);
which would be the list of integers, 1, 2, 3, 4, ... up to floor(24./T)
The reason for the code is not clear. In most cases in which something that looks like this might be used, the variable T would instead be named Fs or FS or fs (frequency of sampling) or else f (frequency). T tends to suggest a time, and it would be uncommon to want to do something until the inverse of a time.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by