Answered
Creating mex file for complicated fortran code
I am not familiar with aerodyn, but you might have a look at this FEX package for generic double variable interfacing between MA...

14 years ago | 0

Answered
equality operator between matrix and scalar
You can try this to see what the numbers are exactly: num2strexact((-1:0.1:1)') Sometimes a beter way to do this is to h...

14 years ago | 0

Answered
eigen values of 3D matrix
You can try Bruno Luong's small size multi-eigenvalue solver on the FEX: <http://www.mathworks.com/matlabcentral/fileexchange...

14 years ago | 2

Answered
Segmentation Faults when Running MEX files in Parallel
Do you use any MATLAB API functions that allocate or change memory, such as mxCreateDoubleMatrix, mxMalloc, etc.? These are not ...

14 years ago | 1

Answered
Concatenate vector in a 3d matrix
For your exact problem: M = reshape([a;c;b;d],2,2,4); Then generalize as appropriate. E.g., if a,b,c,d are not row vecto...

14 years ago | 1

| accepted

Answered
How to create a solid spherical cluster with random distribution of points
Here is my cut at it. The asin( ) correction is to take care of the fact that we need progressively fewer samples as we get ...

14 years ago | 2

Answered
problem in running mex file
Versions of MATLAB through R2006b had the BLAS and LAPACK routines in one library, the libmwlapack.lib file. Versions of MATLAB ...

14 years ago | 0

| accepted

Answered
Simulate single precision arithmetic in Matlab?
It is very difficult to verify what is actually happening behind the scenes for single precision calculations. E.g., on a PC it ...

14 years ago | 0

Answered
floating point precision
E.g., >> X = 1 X = 1 >> Y = X + eps(X) Y = 1.0000 >> Z = X - eps(X) Z = 1.0000 >> n...

14 years ago | 0

| accepted

Answered
Hidden memory?
To add to what Daniel has already written, consider these lines: function obj=lu_apply(A) [L,U]=lu(A...

14 years ago | 2

| accepted

Answered
[SOLVED] compile mex with blas under windows
Drop the trailing underscore _ on Windows. E.g., #define F77_CALL(x) x ## _ puts a trailing underscore on the BLAS li...

14 years ago | 1

Answered
insert new mexPrintf to stop Matlab crash
Inserting mexPrintf calls changes the state of some internal register(s) and can have an effect on buggy code. E.g., I once saw ...

14 years ago | 1

Answered
creating multi-dimensional arrays from vectors
You can also see this related discussion: <http://www.mathworks.com/matlabcentral/answers/31594-multiply-each-element-of-a-ve...

14 years ago | 1

Answered
Absoft Pro-Fortran 10 and Matlab R2011a
To my knowledge, MATLAB has *never* shipped with a Fortran compiler. You can find a list of 3rd party supported Fortran compiler...

14 years ago | 0

Answered
How to include libraries in a mex file
What happens when you try this: #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> ...

14 years ago | 1

Answered
Matlab crashed
You very likely have coding errors in A.mexw32 and B.mexw32 and it is corrupting memory and causing crashes. The reason it is in...

14 years ago | 1

Answered
UTC time
If this is "seconds since 1970-01-01 00:00:00 TAI" it is more properly called "unix time" or "posix time" or sometimes "epoch ti...

14 years ago | 1

Answered
Reshaping a square matrix to a vector
This matches your words: A = rand(10,10); B = A(:); % one way B = reshape(A,100,1); % another way This matches you...

14 years ago | 2

| accepted

Answered
Appending new dimensions to existing variable
Two options to consider: 1) Preallocate your cell array so that it is not changing size throughout your looping. Put this sta...

14 years ago | 0

Answered
Does your MATLAB FileExchange work OK?
My files seem to still be there, but the comments section has disappeared, which is unfortunate since that is how I have been ke...

14 years ago | 0

Answered
Transposing matrix using reshape
This is an ill-posed problem or something is missing from the problem statement. There are various ways to accomplish a transpos...

14 years ago | 1

Answered
C++ Mex File Clear All Memory and Dynamic Memory
Yeah, that's going to crash for sure. A couple of things: 1) prhs[0] is a read-only input. You should not be trying to free a...

14 years ago | 0

| accepted

Answered
Add each row in a matrix with corresponding element in a vector?
bsxfun(@plus,M,V) bsxfun(@times,M,V)

14 years ago | 1

| accepted

Answered
What version of MATLAB do you code against
32-bit Windows XP R2006b - R2011b (R2012a once I get it installed). Since all of my submissions are mex routines, I run against ...

14 years ago | 1

Answered
Multithreading with mex functions
As I understand it, the executable you plan on running is a completely separate process (is this true?), and as such there are n...

14 years ago | 0

Answered
Using ACO to determine the parameters(K,Tau)
<http://www.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency>

14 years ago | 1

Question


Pi Day
In recognition of Pi Day (3/14 using MM/DD format), I suggest everyone eat a slice of pie today, and while you are eating it dow...

14 years ago | 3 answers | 5

3

answers

Answered
how to preallocate large logical array
Another alternative (assumes that all of the elements are filled in downstream): A = uninit(numRows, numCols, 'logical'); ...

14 years ago | 1

Answered
Program that displays the first 20 even numbers beginning with 100?
Close. But: 1) You need the mod function inside your while loop. 2) You need mod(num,2) instead of mod(x,y) 3) You don'...

14 years ago | 0

Answered
Convertion between empty matrix and Null
Why not use the isequal function?

14 years ago | 0

| accepted

Load more