Answered
How can I perform matrix operation efficiently?
This is vectorized, but it creates potentially large intermediate arrays, so I don't know if it will be any faster than your sim...

12 years ago | 2

Answered
Calculate max(diff(A)) fast and memory efficient.
You could resort to a mex routine. E.g., here is bare bones code (no argument checking) for double input: #include "mex...

12 years ago | 2

Answered
Remove NaN from a matrix
If you have the appropriate toolbox, you can use the function: nanmean

12 years ago | 2

Answered
Mex files crashes when run
The main problem is that you, the programmer, need to create the output mxArray plhs(1). When you run the mex routine the only m...

12 years ago | 2

| accepted

Answered
what is it mex setup?
The mex setup process will let MATLAB configure the proper compiler files for mexing your code. Do this at the MATLAB command li...

12 years ago | 3

Answered
Problem in using bsxfun
For a multi-dimensional paged based linear solver, bsxfun is not the correct approach. You will need to either write loops, or u...

12 years ago | 2

Answered
how i can convert binary 128 bit to decimal??
Double precision numbers only have a 52-bit mantissa (+1 hidden leading bit), hence the error. A uint64 has 64 bits, and that is...

12 years ago | 3

| accepted

Answered
What version of Fortran does both Windows 7 and Matlab 2011b support?
You can start with this page, which gives links to the various versions: http://www.mathworks.com/support/sysreq/previous_rel...

12 years ago | 1

Answered
using calllib for 32 bit native module built in Microsoft Visual C++ 2008.
You can't mix 32-bit s/w and 64-bit s/w. You will not be able to call functions from a 32-bit dll from within a 64-bit applicati...

12 years ago | 1

| accepted

Answered
Copying 2-D C++ array into mxArrays
If the array elements are in column order in the C++ file, then a simple copy will suffice. E.g., #include "mex.h" void ...

12 years ago | 1

| accepted

Answered
how can i do about error 206?
The source code file timestwo.F either needs to be in the current directory, or you need to give the explicit path to the file. ...

12 years ago | 1

| accepted

Answered
Making each element of a row vector equal to zero
You don't need a for loop. You can just do this: row_vector(:) = 0; % Set all elements to 0, keep original variable type th...

12 years ago | 1

Answered
UNIX to seconds from beginning of the day
One way: ds = your_datestring_stuff; dn = datenum(ds); % Turned into datenum format s = (dn - floor(dn)) * 86400; % S...

12 years ago | 1

| accepted

Answered
MEX compile type error
I don't know how this could have ever worked. In the first place, the arguments to sprintf are wrong. E.g. the 1st argument need...

12 years ago | 2

| accepted

Answered
Incompatible type with mxCreateNumericArray
It is complaining because you declared outDims as an int array (which when used as an argument gets converted to const int *), b...

12 years ago | 3

| accepted

Answered
How to use Matlab "data=load(filename)" in a Mex file
Basically, set up the appropriate mxArray variables then use mexCallMATLAB. E.g., mxArray *filename, *data; char cfilena...

12 years ago | 3

| accepted

Answered
a problem with MEX - 'Link of '___.c' failed.
Please post your C code ... it appears you may be missing the gateway function mexFunction in your code.

12 years ago | 0

| accepted

Answered
Vectors need to be same length
time = fps*(0:(length(fz)-1))'

12 years ago | 0

| accepted

Answered
Can I have two versions of MatLab on my machine
In general, YES, you can have multiple versions of MATLAB installed on the same machine. You do not have to uninstall one before...

12 years ago | 7

| accepted

Answered
How to execute .c file on matlab 2012?
The fact that you can't open the output file possibly means you do not have write privileges into the \extern\examples\mex direc...

12 years ago | 0

Answered
matlab syntax (parentheses and functions)
Your function signature should have whole variable names, not subscripted names. That is, you might be passing in PQMatx(k,1) an...

12 years ago | 0

| accepted

Answered
MEX file (FORTRAN) calling a LAPACK routine crashed
Fortran does *not* automatically convert arguments to the correct type like C/C++ does. You need to get the arguments the same a...

12 years ago | 0

| accepted

Answered
Cell Array of Function Handles Leaks Memory
I suspect this is a problem with the MATLAB function parser and acceleration techniques used behind the scenes. Unfortunately, I...

12 years ago | 1

| accepted

Answered
is it possible to call MATLAB code in a FORTRAN ?
For mex functions there is a routine called mexCallMATLAB that allows you to call a MATLAB function from your Fortran or C/C++ c...

12 years ago | 0

Answered
How do I use ‘sgeqpf’ function in LAPACK inside MATLAB?
You could try this FEX package by Tim Toolan: http://www.mathworks.com/matlabcentral/fileexchange/16777-lapack It provides...

12 years ago | 0

| accepted

Answered
Handling syms in Mex Files
Using this variable: >> syms a b c >> x = [a b c] x = [ a, b, c] And this mex file (symdetails.c): #inclu...

12 years ago | 1

Answered
Why does Fortran write(6,...) not show in MATLAB window
You can look near the end of this thread for a technique that might work for you if you do not need the output interactively wit...

12 years ago | 2

| accepted

Answered
mxCreateString usage when calling matlab
MATLAB strings are stored internally as 2 bytes per character, not 1 byte per character. For regular ASCII text, that means that...

12 years ago | 0

| accepted

Answered
how to integrate f(x)= x/(8+6x^2)^2 in matlab
See this thread: http://www.mathworks.com/matlabcentral/answers/123266-how-to-find-the-integral-of-f-x-1-x-4-on-matlab And...

12 years ago | 1

Answered
Factorial code, stuck for some reason, help!
If n<0, then you get inside the "if" block to get a new n, but that path does not get into the "else" part of your code so no "a...

12 years ago | 2

Load more