Thread Subject: cols rows command

Subject: cols rows command

From: Byung-Joo

Date: 23 Sep, 2009 19:54:25

Message: 1 of 6

I just upgraded from 2009a (7.8) to 2009b (7.9), and I ran a simple code to see if upgrade works fine. I have an error for a simple command like rows(x) and cols(x), where x is (nxk) matrix. These commands work fine with 2009a version, but now I have an error saying

"??? Undefined function or method 'rows' for input arguments of type 'double'."

I know that I can obtain the same results using 'size(x)', but I have so many programs written using 'cols' or 'rows'.

I have database toolbox in both versions. Any idea why this happens? Thanks.

B.J.

Subject: cols rows command

From: Sebastiaan

Date: 23 Sep, 2009 20:07:18

Message: 2 of 6

"Byung-Joo " <bjleend@hotmail.com> wrote in message <h9dudh$75t$1@fred.mathworks.com>...
> I just upgraded from 2009a (7.8) to 2009b (7.9), and I ran a simple code to see if upgrade works fine. I have an error for a simple command like rows(x) and cols(x), where x is (nxk) matrix. These commands work fine with 2009a version, but now I have an error saying
>
> "??? Undefined function or method 'rows' for input arguments of type 'double'."
>
> I know that I can obtain the same results using 'size(x)', but I have so many programs written using 'cols' or 'rows'.
>
> I have database toolbox in both versions. Any idea why this happens? Thanks.
>
> B.J.

Are you sure this was a default Matlab function? I checked 2007a, and there are no functions rows or cols (and I do not have the database toolbox either). Maybe they were custom defined functions. Start 2009a and type:
>> which rows
and check the location of the file.

If you are really dependent on it, and are unwilling to change all your code, make custom functions:
function n = cols(x)
n = size(x, 2);

function n = rows(x)
n = size(x, 1);

If you are running Linux, maybe somebody can help you with a magic regexp that changes all references automatically for you.

Subject: cols rows command

From: Byung-Joo

Date: 23 Sep, 2009 20:20:28

Message: 3 of 6

Sebastiaan,

Thanks for your quick reply.

Yes, rows and cols are NOT Matlab defaut functions. They are database toolbox command. But, they worked fine with 2009a, but not with 2009b even though I have database toolbox in both versions. I don't know what's wrong here. BTW, I am using WinXP (32bit) version.

Thanks anyway.

B.J.

"Sebastiaan " <s.breedveld@erasmusmc.REMOVE.BOO.BOO.nl> wrote in message <h9dv5m$qnc$1@fred.mathworks.com>...
> "Byung-Joo " <bjleend@hotmail.com> wrote in message <h9dudh$75t$1@fred.mathworks.com>...
> > I just upgraded from 2009a (7.8) to 2009b (7.9), and I ran a simple code to see if upgrade works fine. I have an error for a simple command like rows(x) and cols(x), where x is (nxk) matrix. These commands work fine with 2009a version, but now I have an error saying
> >
> > "??? Undefined function or method 'rows' for input arguments of type 'double'."
> >
> > I know that I can obtain the same results using 'size(x)', but I have so many programs written using 'cols' or 'rows'.
> >
> > I have database toolbox in both versions. Any idea why this happens? Thanks.
> >
> > B.J.
>
> Are you sure this was a default Matlab function? I checked 2007a, and there are no functions rows or cols (and I do not have the database toolbox either). Maybe they were custom defined functions. Start 2009a and type:
> >> which rows
> and check the location of the file.
>
> If you are really dependent on it, and are unwilling to change all your code, make custom functions:
> function n = cols(x)
> n = size(x, 2);
>
> function n = rows(x)
> n = size(x, 1);
>
> If you are running Linux, maybe somebody can help you with a magic regexp that changes all references automatically for you.

Subject: cols rows command

From: dpb

Date: 23 Sep, 2009 20:24:01

Message: 4 of 6

Byung-Joo wrote:
...
> Yes, rows and cols are NOT Matlab defaut functions. They are database
> toolbox command. But, they worked fine with 2009a, but not with 2009b
> even though I have database toolbox in both versions. I don't know
> what's wrong here. ...

Looks like time to check current version documentation and if no
satisfaction TMW official support.

--

Subject: cols rows command

From: Nick Clark

Date: 23 Sep, 2009 20:44:04

Message: 5 of 6

As suggested . .

make one file with
> function n = cols(x)
> n = size(x, 2);


make another with
> function n = rows(x)
> n = size(x, 1);


Put them in a folder and add that folder to your path. Done.

:)

Subject: cols rows command

From: Byung-Joo

Date: 23 Sep, 2009 21:07:19

Message: 6 of 6

Thanks, Nick and Sebastiaan

As it turned out, they (and many other econometrics related functions) are customized functions which I added in 2009a version, but I forgot to add that folder when I upgraded to 2009b. They are working now. Thanks.

B.J.

"Nick Clark" <bmoviehorror@hotmail.com> wrote in message <h9e1aj$kcp$1@fred.mathworks.com>...
> As suggested . .
>
> make one file with
> > function n = cols(x)
> > n = size(x, 2);
>
>
> make another with
> > function n = rows(x)
> > n = size(x, 1);
>
>
> Put them in a folder and add that folder to your path. Done.
>
> :)

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com