problem about returning a matrix

Carlo de Falco carlo.defalco at gmail.com
Tue Apr 7 08:40:29 CDT 2009


2009/4/7 Carlo de Falco <carlo.defalco at gmail.com>
>
> this function, as it stands, returns each element of the matrix as a separate variable..
> I guess what you want to do is rather something like

<...>

Actually you probably want:

>
> #include <octave/oct.h>
> ...
> ...
> DEFUN_DLD(...)
> {
> Matrix A(row1, column1
> );
>
> for(int i = 0; i < row1; i++)
> {
>        for(int j = 0; j < column1; j++)
>        {
>                out >> x;
>                A(i, j)=x;
>        }
> }
> return octave_value(A);
> }
>

 c.



More information about the Help-octave mailing list