help-octave
[Top][All Lists]
Advanced

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

Rows in DLD functions


From: Ben Sapp
Subject: Rows in DLD functions
Date: Tue, 11 Jan 2000 16:59:05 -0700

Can any one tell me why the following DLD function prints a row vector
but returns a column vector?   I think it should print and return a
column vector.  Can you also tell me how I can return a Row vector
instead of a column vector?   

rowvec_test.cc
-------------------------------------------------------------------
#include <octave/oct.h>
#include <octave/pager.h>

DEFUN_DLD(rowvec_test,args, , "\nRow vector test\n"){

  RowVector the_row = args(0).vector_value();
  octave_stdout << "The Row vector = \n" << the_row << "\n";
  return octave_value(the_row);
}
-------------------------------------------------------------------

Run it from octave like this:

v = [ 1 2 3];
rowvec_test(v)

Thanks.  

-- 
Ben Sapp                         Los Alamos National Laboratory
email: <mailto:address@hidden>   Phone: (505)667-3277
Fax:   (505)665-7920             URL:   http://www.neutrino.lanl.gov/
--



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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