Answered
ndfun doesnt support complex numbers..
Try this FEX submission by Bruno Luong: http://www.mathworks.com/matlabcentral/fileexchange/27680-multiple-eigen-values-for-2...

12 years ago | 0

Answered
Mex file Fortran 77, create vector of size input argument
Basic code outline with no error checking: mwPointer, external :: mxGetPr mwSize, external :: mxGetNumberOfElements m...

12 years ago | 0

| accepted

Answered
Error using .* Matrix dimensions must agree. HELP
Hint: Look at size(kR) and size(phi). You also need to look at the other lines for your use of * vs .* operation, since it looks...

12 years ago | 0

Answered
Return (large) unchange mxArray from MEX
plhs[0] = prhs[0] is perfectly OK in mex programming. MATLAB *always* (EDIT: NOT TRUE ... SEE BELOW) makes shared data copies of...

12 years ago | 4

| accepted

Answered
Building Mex file with Fortan
Your main problem is that you need to *create* the output array PLHS(1) before you access it. Also your NLHS and NRHS types are ...

12 years ago | 0

| accepted

Answered
How do I access an Invalid-named variable from an exported MAT file that MATLAB will not recognize?
You can try this FEX submission: http://www.mathworks.com/matlabcentral/fileexchange/42274-loadfixnames-loads-a-mat-file-fixi...

12 years ago | 1

Answered
Reading all variable from a mat file.
The new version of LOADFIXNAMES is now available on the FEX. You can find it here: http://www.mathworks.com/matlabcentral/fil...

12 years ago | 0

Answered
How to multiply Multidimensional Arrays with a column vector
C = mtimesx(A,reshape(B,1,1,[])); You can find MTIMESX here: http://www.mathworks.com/matlabcentral/fileexchange/25977-mti...

12 years ago | 0

Answered
How to load a file or variable with pure number names, such as 001.mat?
You can try this FEX submission: http://www.mathworks.com/matlabcentral/fileexchange/42274-loadfixnames-loads-a-mat-file-fixi...

12 years ago | 0

Answered
Mex function with function as input
I am not sure what your question is. Are you simply asking how to fill the 2nd argument in the hcubature call? If so, simply wri...

12 years ago | 1

Answered
Uniform distribution of floating point numbers in double arithmetics.
First look up the floating point bit pattern, which you can find here: http://en.wikipedia.org/wiki/IEEE_754-1985 Then not...

12 years ago | 1

| accepted

Answered
Fix problem when mex .cpp file
Looks like you have spaces in your paths. Rather than passing these arguments to the mex function via the command line "string" ...

13 years ago | 0

Answered
Rounding using 'fix'... possibly a bug?
To see what is going on you can examine the exact floating point values. Note that none of your original numbers except 0.5 can ...

13 years ago | 2

| accepted

Answered
Row/Col major order in mex function
Other things being equal, the fastest way is to access the data in the order that it is physically stored in memory. This makes ...

13 years ago | 1

| accepted

Answered
why not 10^-3*10 = 10^-2? or why (10^-3 *10 < 10^-2) returns true? How to deal with this?
Floating point arithmetic is in general not exact. Your 10^-16, for instance, cannot be represented exactly in IEEE double preci...

13 years ago | 1

Answered
Large numbers multiplied by small numbers
Some options: 1) Use the symbolic toolbox 2) Work with the log of the expression If I have done the math correctly, ...

13 years ago | 1

| accepted

Answered
Issue using memset in mex function
1) Include string.h as already suggested by dk. 2) You don't need to zero out the memory behind the data pointer returned by ...

13 years ago | 2

Answered
ode45 function Not enough input arguments error.
FYI the doc says 1st argument to ode45 is supposed to be a function handle, not a string (although a string also seems to work)....

13 years ago | 1

| accepted

Answered
using MEX file and constants
One way: #include <math.h> Then use M_PI for the value in your code instead of PI, or you could add this line also: ...

13 years ago | 0

| accepted

Answered
Finding velocity given horizontal position, vertical position and time coordinates and definition of derivative.
Some hints: Import the data into MATLAB. Look at the doc for the function called diff.

13 years ago | 0

Answered
How do i create a mex file from a C++ source codes that is an int main ( ) function
Looks like you called main before it was declared. Try putting this prototype at the top of your code (prior to the mexFunction)...

13 years ago | 1

| accepted

Answered
Why is diag faster than zeros?
More discussion related to this can be found on this thread: <http://www.mathworks.com/matlabcentral/answers/58055-faster-way...

13 years ago | 0

| accepted

Answered
Create An Array That Contains All the Values of F(x)? Help!
y = x; y(y<1) = 1; y = y.*x;

13 years ago | 0

Answered
Matlab code for Maclaurin series expansion using cos(x) =1 and iterating adding a term at a time until I have an estimate for Cos(pi/3)?
Google Maclaurin expansion of cosx Go to the first link http://blogs.ubc.ca/infiniteseriesmodule/units/unit-3-power-series...

13 years ago | 0

Answered
Matlab mex function problem
Problem 1) If nlhs == 2 then there are only two elements allocated for the output, plhs[0] and plhs[1]. You are overwriting t...

13 years ago | 2

| accepted

Answered
Create a vector name from two integer variables
<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F>

13 years ago | 2

Answered
matrix transpose multiplication precision
MATLAB uses BLAS routines to do matrix multiplication. There are separate routines available for generic matrix multiplication a...

13 years ago | 0

| accepted

Load more