Respondida
matrix multiplication
Another way: [m n] = size(A); Ar = reshape(A,m,1,n); B = reshape(mtimesx(Ar,Ar,'t'),m,m*n).' You can find mtimesx ...

más de 14 años hace | 0

| aceptada

Respondida
can't run MEX files on Matlab 7.10 (R2010a)
The file arrayProduct.c is not in the current directory. You need to copy that file into the current directory, or change the cu...

más de 14 años hace | 1

Respondida
Transposing 3 D matrix using permute - how does permute work?
Another way to do 2D slice transposing of an nD Array: mtimesx(1,A,'t') You can find mtimesx on the FEX here: < ...

más de 14 años hace | 1

Respondida
How can I get HINSTANCE from .mex?
It would easier if you use just one mex routine and passed in a flag that determined the behavior. However, if you insist on pas...

más de 14 años hace | 1

Respondida
Invalid MEX-file, invalid win32 application
This message can result when a mex routine is compiled with one version of MATLAB and then used on a different version of MATLAB...

más de 14 años hace | 1

Respondida
Passing structures through mex
E.g., the following code snippet w/o any argument checking, assuming you pass in the structure sys as the first argument: ...

más de 14 años hace | 2

| aceptada

Respondida
I call a mex function and do some operations with its results and then matlab crashes
You should never use mxDestroyArray on any of the plhs[*] values ... that will guarantee a MATLAB crash since MATLAB will attemp...

más de 14 años hace | 1

Respondida
Bug when using min() with sparse matrices?
You might try using this to check the matrix: href=""<http://www.mathworks.com/matlabcentral/fileexchange/20186-spok-checks-if-...

más de 14 años hace | 1

| aceptada

Respondida
issue related to mex file in matlab
In general, mex routines are not backward *or* forward compatible. It all depends on what versions you are running, which OS you...

más de 14 años hace | 0

Respondida
Sparse Matrices and Machine Precision
If you are really desperate for speed one could write a mex routine to do this operation in-place. My guess is it probably would...

más de 14 años hace | 1

Respondida
how to make a mex 'answer' nargin/nargout
You could have a companion m-file with the same base name, foo.m, with the same signature as the mex routine, and then use nargo...

más de 14 años hace | 0

Respondida
Mex
The "return" statement error was pointed out several days ago in OP's previous thread, it just wasn't corrected. In addition, th...

más de 14 años hace | 0

Respondida
converting to mex
Repeating my response from the newsgroup here just to complete this thread: Try to access the data only once (i.e., drag it thr...

más de 14 años hace | 1

Respondida
Using structures in MEX files
I see the following issues: 1) You don't check your inputs before you use them. I would recommend putting in code to check that...

más de 14 años hace | 1

| aceptada

Respondida
contiguous memory for complex arrays in mex
Yes and No. It is easily possible to physically do this, but the clearing of such a variable will likely crash MATLAB if you are...

casi 15 años hace | 1

| aceptada

Enviada


Fortran 95 Interface to MATLAB API with extras!
This is the one you have been waiting for, a clean interface using assumed shape Fortran pointers.

casi 15 años hace | 2920 descargas |

5.0 / 5
Thumbnail

Respondida
MEX Function - Using mexCallMATLAB function in conjunction with "PolyFit"
You don't need to make pm, pp, and fit_order arrays. Try this: double *pmp, *ppp; mxArray *rhs[1], *lhs[1]...

casi 15 años hace | 0

Respondida
Fortran and matlab
The engine will need to be opened first using engOpen to get the ep to pass to engCallMATLAB. I assume you are using my engCallM...

casi 15 años hace | 0

Respondida
error occurred when using mex to build binary MEX-file
You need to include *all* of your source code on the mex command line unless it is included in the other files. e.g., mex d...

casi 15 años hace | 2

Respondida
Converting Decimal to Hexadecimal without the use of the dec2hex function.
I will get you started with one approach. You could start with a char array like this: hexdigits = '0123456789abcdef'; T...

casi 15 años hace | 0

Respondida
Writing ints and unsigned ints to .mat files in a C++ program
Consider these lines from your code (in particular the last line): mxArray *tempMat; tempMat=mxCreateDoubleMatrix(1,1,...

casi 15 años hace | 1

Respondida
Writing ints and unsigned ints to .mat files in a C++ program
You need to show more of your code. E.g., what is time_step? How is it declared and initialized? It needs to be MATLAB allocated...

casi 15 años hace | 2

Respondida
Identical math operations in C++ and matlab differ by ~1% (10^11 in this case!)
Differences can arise from different order of operations, temporary results done in 80-bit vs 64-bit arithmetic, different round...

casi 15 años hace | 1

Respondida
fortran 90 mex on Mac
Is there a "/fixed" option (or similar) on the COMPFLAGS line in the mexopts file? If so, remove it. That is the typical problem...

casi 15 años hace | 0

Respondida
Fortran 10.0.026
You might get things to work by copying the v9 mexopts files into new v10 named files and then modifying the contents of these n...

casi 15 años hace | 0

Respondida
Using mexMakeMemoryPersistent to save C data structures
mexMakeMemoryPersistent only works for MATLAB API allocated memory using mxMalloc, mxCalloc, and mxRealloc. It will not work wit...

casi 15 años hace | 0

Respondida
Funtion to get 9th term in an array
A(1:9:end)

casi 15 años hace | 0

| aceptada

Respondida
random number within a rwo vector
A(ceil(rand*numel(A)))

casi 15 años hace | 0

| aceptada

Respondida
Calling matlab functions from a C code
See the External Interfaces section of the doc, and in particular the mexCallMATLAB function.

alrededor de 15 años hace | 0

Respondida
recover basic rotations
You should take a look at SpinCalc in the FEX by John Fuller: <http://www.mathworks.com/matlabcentral/fileexchange/20696-func...

alrededor de 15 años hace | 1

Cargar más