-3

In this code:

hdrMat(ctr,:) = [double(frameCtr) double(numBins) binLength Fs Fc RangeOffset];
FrameMat(:,ctr) = data;

What is the meaning of (ctr,:) and (:,ctr) in terms of vectors?

Anwer Ak
  • 33
  • 7
  • For more details on indexing in MATLAB, see [this excellent answer](https://stackoverflow.com/a/32379806/7328782). – Cris Luengo Sep 25 '18 at 20:48

1 Answers1

1

The (ctr,:) means you are addressing the ctr'th row, starting from the first row as row nr. 1. The ":" states, that you are addressing the whole row and not just an element. The (:,ctr) means you are addressing the ctr'th column and again " : " tells matlab to address the entire column.

Example:

A = [1 2 3; 4 5 6; 7 8 9];
A(2,:) = [0 1 0]

%Output

    [1 2 3]
A = [0 1 0]
    [7 8 9]

You can also apply the colon operator " : " to address a certain range of the row/column by writing:

A(2:3,1)

%Output

[0; 7];

Id strongly recommend you looking into the basic matlab questions on StackOverflow and also on the MatLab official documentation, where lots of examples are given.

Cheers, Pablo

Pablo Jeken Rico
  • 569
  • 5
  • 22