help-octave
[Top][All Lists]
Advanced

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

Re: oct files


From: Artur Jorge Azevedo Carvalho
Subject: Re: oct files
Date: Fri, 09 Jul 1999 11:04:24 +0100

> > hi again!
> 
>         Bo dia :) I thought I replied yesterday, but that didn't get
through...

ola! bom dia!! :)

> 
> > this is my second attempt in getting some help from the
> > octave gurus... :) seriously, i really need to know, if
> > there is any way of reshaping a matrix in a .oct file,
> > without having to use the feval function, i once thought
> > this wold be a easy job, only needed to change the rows
> > and columns values of a matrix, but i found that reshape
> > was a script file(.m) and that in reallity it creates a
> > second matrix sized of the reshape value, and then it
> > copies the content of the matrix to this new one...
> > is there any other way? please...
> 
>         I don't know what sort of reshaping you want to get, but reshape
> just uses the fortran convention on how to store data (i.e, columnwise).
> I'll try to put some example:
> 
> S={S11...S1M;...;SN1...SNM} is a NxM matrix. Say our aim is to reshape it
to
> MxN (for the sake of argument). The matrix is stored as an array having
the
> elements of S stored columnwise. So, the first element would be S11, but
the
> second would be S21 instead of S12 (i.e, the 2nd element would be the
first
> element of the 2nd row, instead of being the second element of the first
row).

yes i know, the only problem is this:

i've got an array of NxM and i need to reshape it to 1x(N*M), that is,
i need to change the shape of a matrix in order to perform some
operations
afterwards, what is troubling me is that this is done in an .oct file
and there seem to not exist any  functionallaty that would allow me to 
do such thing..
as far as i found out the internal representation is indeed a vector,
Matrix class inherits from Array2 wich inherits from Array<T>, but the 
shape is defined by two variables d1 and d2 that are not protected 
but there are some comments in the code that say:
'This really need to be protected ( and they wil be in the future, so 
don't depend on them being here!)' ....
so the only way of really being shure of the code would be in having
some sort of method that would allow me to change them and not doing 
"mat.d1=N*M; mat.d2=1;", but i haven't 
found any 'till now... and this two variable seem to be checked
when i perform for example a sum of matrices... so i can't really do
any sort of operation whithout reshaping... this is my punishment.. :)

any comment?? :)

do you think i should cry out loud... JWEEEE hellppp???? :)

thanks

artur

-- 
If you think you are too small to make a difference,
try sleeping in a closed room with a mosquito.
____________________________________________________
http://www.inescn.pt/0649121212/index.phtml



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

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