How can I get a m file from a cpp file?

/*
Copyright (C) 2004 Caltech
Written by Lexing Ying
*/
#include "mex.h"
#include "matrix.h"
#include "fdct_wrapping.hpp"
#include "mexaux.hpp"
using namespace std;
using namespace fdct_wrapping_ns;
//digital curvelet transform
extern void _main();
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
{
if(nrhs!=6)
mexErrMsgTxt("6 inputs required");
if(nlhs!=1)
mexErrMsgTxt("1 outputs required");
int m; mex2cpp(prhs[0], m);
int n; mex2cpp(prhs[1], n);
int nbscales; mex2cpp(prhs[2], nbscales);
int nbangles_coarse; mex2cpp(prhs[3], nbangles_coarse);
int allcurvelets; mex2cpp(prhs[4], allcurvelets);
CpxNumMat x; mex2cpp(prhs[5], x);
vector< vector<CpxNumMat> > c; //vector<int> extra;
fdct_wrapping(m, n, nbscales, nbangles_coarse, allcurvelets, x, c);
cpp2mex(c, plhs[0]);
return;
}

1 件のコメント

Chengli Yang
Chengli Yang 2017 年 1 月 20 日
i have also met this problem. MinGW64 Compiler (C++) with error: lack of header C++ file 'fftw.h'. if you have solved it, please tell me. thanks

サインインしてコメントする。

回答 (2 件)

Hugo Ochoa
Hugo Ochoa 2016 年 7 月 4 日
編集済み: Walter Roberson 2016 年 7 月 4 日

0 投票

Thanks Walter but
y = perform_curvelet_transform(x,options)
I can't run it because of the options. Should I put in options, the sam options instead m,n the matrix x?
C = fdct_wrapping_mex(m,n,nbscales,nbangles,finest,randn(m,n));
I couldn't use it but i Believe you are right
Thanks again

3 件のコメント

Walter Roberson
Walter Roberson 2016 年 7 月 4 日
options.n = n;
looks like it might be the only mandatory option.
Hugo Ochoa
Hugo Ochoa 2016 年 7 月 4 日
編集済み: Walter Roberson 2016 年 7 月 4 日
other problem
y = fdct_wrapping(x, is_real, finest, nbscales, nbangles_coarse);
is function that I have in your suggested file(line 21), but this function invokes
C = fdct_wrapping_mex(m,n,nbscales,nbangles,finest,randn(m,n));
Again, so is a kind of loop with no end
The problem is I get the Sparco matlab freesoftware I tried to run exSeismic.m so I get curveLab, finally I could not run that file because I could not compile the c files in curvelab
Walter Roberson
Walter Roberson 2016 年 7 月 4 日
No, the file https://www.mathworks.com/matlabcentral/fileexchange/5104-toolbox-wavelets/content/toolbox_wavelets/perform_curvelet_transform.m includes the source for fdct_wrapping and its inverse right there, without invoking any mex function for it.
I could not compile the c files in curvelab
You should have asked directly about that.
Which MATLAB version do you have? Which operating system do you have? Which compiler(s) do you have installed? What result do you see for
mex -v -setup
?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

質問済み:

2016 年 7 月 4 日

コメント済み:

2017 年 1 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by