engOpen with a dynamic variable



Hallo
I have tried to modify some of the example programs that come with matlab concerning the engine. For instance The program engdemo.cpp written clumsily in another way as
..
..
..
using namespace std;
#define BUFSIZE 256
int main()
{
Engine *ep;
mxArray *T = NULL, *result = NULL;
char buffer[BUFSIZE+1];
//double time[10] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 };
double* time;
int N;
cout << "Number of points"<< endl;
cin >> N;
time = new double[N];
for(int i=0; i<N; i++)
{
cout << "Please enter time span"<< i+1 << ":" <<endl;
cin>>time[i];
}
/* Start the MATLAB engine locally by .....

So I am trying to work with dynamic variable but it seems that with my programs memcpy is not functioning and my wild guess was probably because all the examples that were given are written for static variables and not dynamic.
It would be very king if you could show me how to work around this problem.
Many thanks
Alwan
.



Relevant Pages

  • Re: Engine not sending the correct data
    ... into a matlab function via the matlab engine. ... complete engine example that does what I think you want. ... normally send to the console gets put into the buffer, ... timesArray = mxCreateDoubleMatrix(1, dataSize, ...
    (comp.soft-sys.matlab)
  • Re: JMatlab on SourceForge
    ... JMatlab/Link is a new engine communications scheme... ... the full power of Matlab for number crunching and graphics. ... JStatCom is a framework that helps to create Java ...
    (comp.soft-sys.matlab)
  • Re: C-mexfunctions and Matlab engine applications.
    ... I am new to the area of writing C-mexfunctions(C ... > functions called in Matlab) and Matlab engine applications (for ... > Warm Regards, ...
    (comp.soft-sys.matlab)
  • Re: Differences between MATLAB and Simulink?
    ... I think where you are confused is that Matlab ... is not primarily a simulation engine. ... If I simulate a design in Simulink, ... Or maybe a subset of MATLAB's capabilities? ...
    (comp.soft-sys.matlab)
  • Re: dsolve Matlab vs Maple
    ... It is not possible to be the same Maple engine. ... Maple 12 was released about less than one year ago, and Matlab 7.0.0 was ... switching to Maple (or re-writing as a system of first order ODEs) ...
    (comp.soft-sys.matlab)