[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Octave from C++: Saving objects in binary
From: |
Chidambaram Annamalai |
Subject: |
Octave from C++: Saving objects in binary |
Date: |
Mon, 7 Jun 2010 10:57:18 +0530 |
I need to create large random matrices and perform computations with
them, finally saving the results to a file.
I had no trouble in creating the matrices in C++ after including the
necessary octave headers like so:
octave_rand gauss;
gauss.normal_distribution();
std::cout << "Creating gaussian random matrix... ";
Matrix A = gauss.matrix(M, N);
However, supposing I want to save this matrix A to a file how do I go
about doing that?
I tried the "feval" method provided here:
http://wiki.octave.org/wiki.pl?CategoryExternal but there's a problem.
The "save" function that I'm interested in, will only take string
arguments and when I supply it with the argument "A" to save to a
binary file it shows the error:
warning: save: no such variable `A'
Now how do I tell the "save" function to take the matrix A then? The
problem seems to be that the variable A is not being created in the
memory that is being seen by "save". How do I do that?
Thanks,
Chillu
- Octave from C++: Saving objects in binary,
Chidambaram Annamalai <=