help-octave
[Top][All Lists]
Advanced

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

Re: Question about oct files


From: Keith Goodman
Subject: Re: Question about oct files
Date: Sat, 27 May 2006 17:21:31 -0700

On 5/27/06, Guillem Borrell Nogueras <address@hidden> wrote:
How can I make an oct file return a value allocated runtime?  ColumnVector,
Matrix... seem to allocate at compile time.

I don't think I understand the question. But how about this:

abc(2,3,4)
ans =

 2  2  2  2
 2  2  2  2
 2  2  2  2

where

#include <oct.h>
DEFUN_DLD(abc, args, nargout,"y = a*ones(b,c)")
{
 octave_value retval;
 int a = args(0).int_value();
 int b = args(1).int_value();
 int c = args(2).int_value();
Matrix y(b,c,a);
 return retval = y;
}



reply via email to

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