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

más de 13 años hace | 1

| aceptada

Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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...

casi 14 años hace | 1

Respondida
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.

casi 14 años hace | 1

| aceptada

Respondida
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...

casi 14 años hace | 0

Respondida
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...

casi 14 años hace | 0

Respondida
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...

casi 14 años hace | 0

Respondida
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...

casi 14 años hace | 0

| aceptada

Respondida
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...

casi 14 años hace | 0

| aceptada

Respondida
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...

casi 14 años hace | 0

| aceptada

Respondida
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: ...

casi 14 años hace | 2

Respondida
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., ...

casi 14 años hace | 0

Respondida
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...

casi 14 años hace | 0

Respondida
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 ...

casi 14 años hace | 0

| aceptada

Respondida
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...

casi 14 años hace | 0

Respondida
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);

casi 14 años hace | 1

| aceptada

Respondida
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*...

casi 14 años hace | 0

| aceptada

Respondida
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...

casi 14 años hace | 0

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

casi 14 años hace | 2

Respondida
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...

casi 14 años hace | 2

| aceptada

Respondida
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...

casi 14 años hace | 2

| aceptada

Respondida
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...

casi 14 años hace | 2

Respondida
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...

casi 14 años hace | 1

Respondida
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...

casi 14 años hace | 1

| aceptada

Respondida
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...

casi 14 años hace | 0

| aceptada

Respondida
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 ...

casi 14 años hace | 1

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

casi 14 años hace | 0

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

casi 14 años hace | 2

Respondida
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...

alrededor de 14 años hace | 1

| aceptada

Respondida
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. ...

alrededor de 14 años hace | 2

Cargar más