help-octave
[Top][All Lists]
Advanced

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

Problems translating .m to .oct


From: Al Niessner
Subject: Problems translating .m to .oct
Date: Fri, 05 Mar 2004 09:00:57 -0800

I am translating a working 'm' file into a compiled version and cannot
figure out how to multiply two ColumnVectors element wise. Here is an
example of the octave syntax (m file) and reduced C++ code:

 m-file                              C++
 ------                              ---
a = someMatrix(:,1);        ColumnVector a(someMatrix.column(0));
b = someMatrix(:,2);        ColumnVector b(someMatrix.column(1));
c = someMatrix(:,3);        ColumnVector c(someMatrix.column(2));
                            ColumnVector d;
d = a .* (b + c);           d = a * (b + c);

I then get the ambiguous operator "*" error where it can find
RowVector, ColumnVector -> double
ColumnVector, RowVector -> Matrix
octave_value, octave_value -> octave_value

So, what is the correct C++ syntax for this operation? Should I be using
the last and then extracting the column vector from it?

-- 
Al Niessner <address@hidden>
Jet Propulsion Laboratory

All opinions stated above are mine and do not necessarily reflect 
those of JPL or NASA.

 ----
| dS | >= 0
 ----



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

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



reply via email to

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