Answered
subrutine to multiplication multidimensional matrix
You haven't given an example so we don't really know what you want yet. Maybe it is this, which does a matrix multiply on the fi...

13 years ago | 1

Answered
Function which returns the outer product of two vectors
You can't use the last two lines since they employ commands that operate on entire vectors. I would suggest you write out the re...

13 years ago | 0

| accepted

Answered
Modifying a large sparse matrix efficiently
I couldn't resist making a small mex function to do this. In addition to zeroing out small values, it can zero out values within...

13 years ago | 1

Submitted


SPARSECLEAN - Efficiently cleans a sparse matrix of small values or nan
SPARSECLEAN cleans a double sparse matrix of small or nan values or values within a range.

13 years ago | 2 downloads |

0.0 / 5

Question


R2013a + Intel Composer XE 2013 + MSVC 2012 or MSVC 2010. Have you tried them yet?
Our IT folks have informed us we need to migrate from our 32-bit WinXP systems to Windows 7 systems. Great. They just set up a t...

13 years ago | 2 answers | 1

2

answers

Answered
Memory leak with Mex
You are leaking memory behind the B mxArray. E.g., mxArray *B= mxCreateNumericArray(3,dims,mxUINT8_CLASS,mxREAL); :...

13 years ago | 1

| accepted

Answered
How to optimize the multiplication of large matrices in Matlab?
Force the matrix-vector multipy to happen first. E.g., A*(B*C)

13 years ago | 8

| accepted

Answered
In a Mex file, a for loop goes beyond the relational expression?
Depending on MATLAB version and platform and compile flags, mwSize can either be an int (a signed integer) or a size_t (an unsig...

13 years ago | 1

| accepted

Solved


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

13 years ago

Answered
Recursively build cell array in MEX? c/c++
Generally, you can pretty much build and/or examine "nested" cell or struct mxArray variables in the mex environment using the m...

13 years ago | 1

Answered
preallocating sparse 4d matrix
For multi-dimensional sparse arrays, see this FEX submission by Matt J: <http://www.mathworks.com/matlabcentral/fileexchange/...

13 years ago | 1

| accepted

Answered
What is wrong with this vector matrix multiplication?
P'*B*P+B0*P+B0 (3 x 1) * (3 x 3) * (1 x 3) + (1 x 3) * (1 x 3) + (1 x 1) So none of the inner dimensions match above. ...

13 years ago | 1

| accepted

Answered
Element wise multiplication by a vector
W = bsxfun(@times,V,M) If V is a row vector you will get V element-wise times each row of M. Similarly if V is a column vec...

13 years ago | 1

| accepted

Answered
Function handles as function output
When you create an anonymous function handle, all variables that are not part of the argument list (e.g., A in your case) are re...

13 years ago | 2

| accepted

Answered
Segmentation fault when calling LAPACK routine in Fortran mex file
Since you are using -largeArrayDims and on a 64-bit system, you may need to make sure the integers you are psssing to dgtsv are ...

13 years ago | 0

| accepted

Answered
Check Parity of a uint32 Without Converting to a Binary String?
See this FEX submission: <http://www.mathworks.com/matlabcentral/fileexchange/21025-count-on-off-or-calculate-simple-parity-b...

13 years ago | 0

Answered
Passing WORD data type from C file to mex function:
I don't see any code where you put the results of your acquisition into data. All I see is you stuffing the pointer into the fir...

13 years ago | 0

| accepted

Answered
Fortran MEX file memory problem
Can you post the variable declarations for the subroutine It_solver? Is there a large variable there that gets allocated off of ...

13 years ago | 0

| accepted

Answered
how to multiply a 1xn matrix with a 1xn matrix and get the answer in the form of a 1xn matrix
ab = a .* b; % Note the dot asterisk, dot meaning element-wise

13 years ago | 0

| accepted

Answered
Problem using Intel MKL with MEX
Your posted code looks erroneous because in the success case it will naturally drop through the FAILURE label and do the free st...

13 years ago | 0

| accepted

Answered
MEX fortran help with dummy arguments
The compiler is telling you that NB needs to come from an argument list (i.e., a dummy variable). I.e., it is expecting that thi...

13 years ago | 0

Answered
Matlab turns off automatically after starting up
Is user B an Administrator but user A is not? Maybe it is a file access permission problem.

13 years ago | 0

Answered
I have a C++ code opening a file and rewriting the file and I want to execute the function thro MATLAB
If you have no inputs or outputs, you can simply create this file: // writefile.cpp #include "mex.h" // add any other...

13 years ago | 0

Answered
Allocating elements in a large matrix takes a VERY long time. Why?
You might also consider using this fast matrix allocation function UNINIT from the FEX: <http://www.mathworks.com/matlabcentr...

13 years ago | 1

Answered
Reverse vector in matlab
z = fliplr(z); or z = h:-dz:0;

13 years ago | 4

| accepted

Answered
Matrix multiply slices of 3d Matricies
If you are *not* restricted to gpuArrays you can do this: C = mtimesx(A,B); The MTIMESX function passes pointers to the ...

13 years ago | 2

Answered
How to read an N-dimensioned matrix from a binary file
Read the variable as a 1D using the total number of elements (e.g., 16*20*22*6*3*2) and then reshape the result. Since Fortran s...

13 years ago | 3

| accepted

Answered
MEX - accessing structure of arrays
There will likely be some speed improvement if you put the loop inside a mex functions. At the m-file level, each time you pass ...

13 years ago | 0

| accepted

Answered
How to convert a vector of integers to a vector of characters?
Another method for single digits: A = [0 0 0 0 1 0 0 0 0 1]; B = char(A+'0');

13 years ago | 1

| accepted

Answered
How can I store a complex number on a binary file?
OK, here are the mex files. There are two separate files, one for writing a single variable (numeric or char or logical) to disk...

13 years ago | 0

| accepted

Load more