help-octave
[Top][All Lists]

## Re: Syntax question

 From: Heber Farnsworth Subject: Re: Syntax question Date: Sat, 22 Feb 2003 12:34:27 -0600

When you select an element of a Matrix X you say X(r,c) where r and c are the row and column you want. The colon ":" is a wildcard in this notation. X(r,:) means "the rth row and every column of X" and X(:,c) means "every row of the cth column of X.
```
Heber Farnsworth

On Saturday, February 22, 2003, at 12:11 PM, Henry F. Mollet wrote:

```
```*Calculation of left and right eigenvector
*belonging to largest eigenvalue of matrix,
*then matrix/vector multiplication:

[W,d] = eig(a);
d = diag (d);
imax = find (d==max(d));
V = conj(inv(W));
w1 = W(:,imax);          /line 5
v1= real (V(imax,:)).';  /line 6
Senmat = v1*w1''

I understand everything except the ":" in lines 5 and 6. Somehow they
instruct to pick the column vector and row vector, respectivly, which go
with the largest eigenvalue. But how does it work?
Henry

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```
```

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```