What does x(1,:) do in MATLAB ?

조회 수: 280 (최근 30일)
JIIT Bainwala
JIIT Bainwala 2012년 5월 11일
댓글: Steven Lord 2024년 6월 10일
What does x(1,:) do in MATLAB ?
eg:
at = sqrt(Po)*exp(-0.5*(1+i*C)*(tau./t0).^(2*m))
a0 = fft(at(1,:));
what does at(1,:) do here ?
  댓글 수: 2
Anil Chowdary Tummala
Anil Chowdary Tummala 2021년 4월 21일
Q1. What does x(1,:) do in MATLAB ?
Answer : It gives the first row of matrix 'x'
Q2. what does at(1,:) do here ?
Answer : it gives the first row of FFT coefficients of matrix 'at'
Anil Chowdary Tummala
Anil Chowdary Tummala 2022년 10월 10일
Thank you very much

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

채택된 답변

Dr. Seis
Dr. Seis 2012년 5월 11일
"a0" is the Fourier Transform of the first row of "at"
at(2,:) % gives the second row
at(3,:) % gives the third row (and so on)
at(:,1) % gives the first column (and so on)

추가 답변 (3개)

Afissou ZONGO
Afissou ZONGO 2021년 8월 17일
X(i*2,:) means
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 8월 17일

Take the current value of the variable i and multiply it by 2. Use the result as row indices to select entire rows of X.

The code shown does not require that i is a scalar or even a vector. It also does not require that the values in i are currently integer values, but if they are not then there is the risk that there could be an indexing error.

There are uncommon cases in which i would not necessarily have to be numeric, but you might never see that happen in practice.

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


Sorabh Mahajan
Sorabh Mahajan 2022년 2월 27일
x = [x;i] meaining
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 2월 28일
[A;B] is defined as being vertcat(A, B) which in turn is defined as being the same as cat(2,A,B)
That is, [x;i] takes the existing array x, and tries to place a new row containing i at the bottom of it. With the x= assignment that becomes the new x. The effect is to add the content of i to the bottom of x.

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


Antonio
Antonio 2024년 6월 10일
x(1:2,1)? meaning
  댓글 수: 1
Steven Lord
Steven Lord 2024년 6월 10일
This performs "Indexing with Element Positions". In particular, "You can also reference multiple elements at a time by specifying their indices in a vector."

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by