help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

extracting rows from empty matrix


From: Stef Pillaert
Subject: extracting rows from empty matrix
Date: Sat, 11 Apr 1998 12:08:36 +0200

Hello,

it seems that it's not allowed to extract a row from an empty matrix, or am
I wrong?

octave:1> test=zeros(2,0)
test = [](2x0)
octave:2> A= test(1,:)
error: invalid column index = 0
error: evaluating index expression near line 2, column 1

Would it be against the rules of working with empty matrices if this gave:

A = [](1x0)

or are actions like this too 'dangerous' (because what to do with something
like test(1,0), would it be [](1x0) also?)

(The reason I'm asking this, is that I do something like 

matrix_1(1,:)=[matrix_2(1,:),matrix_3(1,:)]

where matrix_3 might sometimes be an [](2x0) matrix, and sometimes it is
not.).

Any comments?

Thanks,
Stef.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]