Answered
Substituting NaN values of one matrix to another?
a = first matrix with NaN values b(isnan(a)) = nan;

13 years ago | 1

| accepted

Answered
How to create and store a custom structure from C++ into a matlab data file
E.g., a bare bones code outline: mxArray *mx; mxArray *Set; char *fieldnames[] = {"StrA","StrB","StrC","StrD","StrE...

13 years ago | 0

| accepted

Answered
Can I load DLL compiled with unsupported C++ compiler?
You will need to ensure that any other dependencies of the dll (e.g., libraries) are installed on your system and available to t...

13 years ago | 1

Answered
How to sum up a matrix n-times?
n*A ??? You will need to provide a sample input & output so we can understand what you really want.

13 years ago | 1

| accepted

Answered
machine precision problem in code
Ben, as many others have already pointed out, this assignment is ill conceived and cannot be accomplished per the reasons others...

13 years ago | 0

Answered
How to obtain fast memory copy of portions in a matrix
I would expect a mex routine might be able to improve the time to copy, maybe by as much as 1/2 since the explicit sub-matrix mA...

14 years ago | 0

Answered
What is the meaning of '* in matlab???
' is conjugate transpose operator * is matrix multiply operator A'*B means conjugate transpose of A multiplied by B, which...

14 years ago | 0

Answered
Cannot find meditor ( for the LIFE OF ME)
meditor was discontinued several years ago. It no longer ships with MATLAB. R2007b was the last version to ship with meditor. (Y...

14 years ago | 0

| accepted

Answered
MEX: Problem creating a cell matrix and assign it to the output
Your code: mxSetCell( CellArray_ptr, i, A ); mxDestroyArray( A ); // get rid of this line G...

14 years ago | 0

| accepted

Answered
Fast conversion of 2 matrices to 1 complex matrix
For your specific example, the A(1,:,:) and A(2,:,:) data blocks are contiguous memory and, more importantly, were both allocate...

14 years ago | 0

| accepted

Answered
initialize a MxN matrix with the same number
Another method if matrix A is not already allocated: A = uninit(M,N); A(:) = some_number; UNINIT can be found here: ...

14 years ago | 2

Answered
Mex file calling LAPACK on MacOS
Don't add the leading underscore yourself ... the compiler will do that. For the trailing underscore you can use a macro. E.g., ...

14 years ago | 0

Answered
how to use mexCallMATLAB with fmincon
1) input[0] should contain the function handle. If you need to create a function handle from within the mex function, you can us...

14 years ago | 0

Answered
numerous "undeclared identifier" errors using MEX
Try putting this at the top of the smoothpatch_curvature_double.c file: #ifndef MWSIZE_MAX #define mwIndex int ...

14 years ago | 0

| accepted

Answered
Segmentation Fault When Calling mxGetProperty (not within a MEX routine)
My mxGetPropertyPtr function will not work in a standalone program. It only works in mex routines because it needs mexCallMATLAB...

14 years ago | 0

Answered
Advanced logical matrix indexing
Another variation of Matt J's approach: B = A(:); B(1:(N+1):(N*N)) = []; B = reshape(B,N-1,N);

14 years ago | 1

| accepted

Answered
Crash with a mex file, using mxMalloc, mxCalloc and complex vectors
This loop is wrong for the real part sigr: for (i = 0; i<N; i++) { signal[i] = sigr[i]; // should be signal[2*...

14 years ago | 0

| accepted

Answered
Crash with a mex file, using mxMalloc, mxCalloc and complex vectors
You use N before you set its value: signal = mxMalloc(2*N*sizeof(mxCOMPLEX)); // Use it here /* get dimensions of t...

14 years ago | 0

Answered
Why is the grass green?
Green is waste light. Grass eats the red light and poops the green light.

14 years ago | 2

Answered
bisection method - can't see error in code
1) Google "bisection method" 2) Go to the 1st Wiki link 3) Look at the pseudo-code posted there 4) Compare that to your...

14 years ago | 2

| accepted

Answered
Why does num2str of a single output up to 17 digits?
Point #1: The behavior of num2str is platform specific. On Windows machines (at least the ones I have used), num2str will tr...

14 years ago | 2

| accepted

Answered
Matlab crashes in simple MEX C "#pragma omp parallel for" test example
There might be some incompatibility between the OpenMP implementation of your compiler and MATLAB. Maybe try something even simp...

14 years ago | 2

Answered
Pass variable by reference to function
I will ask again what others have already asked. Why do you want the "handle" to the variable? What advice we give you will depe...

14 years ago | 1

Answered
MEX function quesiton: Simple Matrix Row vector multiplication with column vector and summation
In the function sparseMatColVec, you don't initialize int_dv. You just start summing into it. So the result will be garbage unle...

14 years ago | 1

| accepted

Answered
How to reshape a matrix
A = zeros(k,l,m,n,o); B = A(:); % column vector C = B.'; % row vector For more general reshaping, see the reshape com...

14 years ago | 0

| accepted

Answered
MEX compiler error - not able to compile mexfunction
Get rid of the /fixed option for the compiler (which forces a free format file to be compiled as fixed format ... I still don't ...

14 years ago | 1

Answered
how to switch the value of a boolean.
b = ~a; c = ~b;

14 years ago | 0

Answered
fundamental multiplication problems with Matlab2010-2011!!!!
For educational purposes: >> x = 8.46 x = 8.4600 >> num2strexact(x) ans = 8.4600000000000008526512829121...

14 years ago | 2

Answered
Mex - output error, Make file
That's because you have the '-c' option, which means compile-only. If you want to link into a mex routine get rid of this option...

14 years ago | 1

| accepted

Answered
Is there a difference between how LCC compiles a file and how MS visual studo compiles the same file?
LCC is a C compiler, not a C++ compiler. LCC cannot compile C++ code, so I assume that you really have C code and not C++ code. ...

14 years ago | 2

Load more