void Convert( mwArray& Output, const QPointF& Input ) { mwArray tmp(1, 2, mxDOUBLE_CLASS); tmp.Get(2, 1, 1).Set(mwArray(Input.x())); tmp.Get(2, 1, 2).Set(mwArray(Input.y())); Output.Set(tmp); }
void Convert( mwArray& Output, const QVector<QPointF>& Input ) { mwArray tmp(Input.size(), 2, mxDOUBLE_CLASS); for (int index(1); index <= Input.size(); index++) { const QPointF& point(Input[index-1]); tmp.Get(2, index, 1).Set(mwArray(point.x())); tmp.Get(2, index, 2).Set(mwArray(point.y())); } Output.Set(tmp); }
void Process_TX(int *fd) { // Initialize the MATLAB Compiler Runtime global state if (!mclInitializeApplication(NULL,0)) { std::cerr << "Could not initialize the application properly." << std::endl; //return -1; } // Initialize the Vigenere library if( !libMEXtestPHYInitialize() ) { std::cerr << "Could not initialize the library properly." << std::endl; //return -1; } // Must declare all MATLAB data types after initializing the // application and the library, or their constructors will fail. mwArray result; mwArray decimation; decimation = mwArray( 20 ); char *c; int k; for (k=0;k<100000;k++){ // Initialization succeeded. Encrypt or decrypt. MEXtestPHYTransmit(1,result); //c = strdup( mwString( result.ToString() ) ); write(fd[1], "HelloFromTX", 11); } // Shut down the library and the application global state. libMEXtestPHYTerminate(); mclTerminateApplication(); //mxfree(objSDRuReceiver); }