|
"Lin " <shenqlv@yahoo.com> wrote in message <gnbv1k$lgn$1@fred.mathworks.com>...
> "Matt Fig" <spamanon@yahoo.com> wrote in message <gnbu1m$h61$1@fred.mathworks.com>...
> > I suggest you read the help for rank.
> > ^ippd]#]k<]#k{kjpcegrku^{kh6a]d{{{ak]jah{UeaIA_{ldi{l]qq*]_
>
> After reading the help, i rewrote my codes to something as follows,
> tr1 = [0;1];
> tr2 = [1;0];
> r1 = [tr1 tr2];
> y = rank (r1);
>
> If the code is written in that manner, i will obtain the correct result. Is this the only way? Or am i on the wrong direction?
You can try:
y = rank([0 1; 1 0])
One matrix entity is within the bracket [...].
When you write rank([...], [...]), you actually provides two input parameters to RANK, each is a matrix.
This is just one of a syntax subtlety that you need to get use when learning Matlab.
Bruno
|