Answered
Could you plz help me guys.
Can you examine the code to see if it looks like a function or a variable? Maybe it is a variable that was supposed to be define...

12 years ago | 1

Answered
What does @ on a dir of *.m files mean?
@dirname means that it is an old-style class definition, the class name being dirname. All of the functions (methods) that the c...

12 years ago | 3

Answered
How to convert .c/.MEX file to .m files ?
The simplest seems to be the C/MATLAB MEX option, since that suggests you can simply take the exported files, compile them, and ...

12 years ago | 1

Answered
how to calculate power of fraction without getting complex double ?
Not sure what the overall calculation is doing, but if you will allow negative inputs, then maybe this formulation is what you c...

12 years ago | 1

| accepted

Answered
Using a .mexw64 function on a Mac.
No. The mexw64 file can only be used by a 64-bit MATLAB version running under Windows. There is no way to modify it (copying, pa...

12 years ago | 1

| accepted

Answered
How do I define log function for arguments of type int16 ?
Turn them into double. E.g., log(double(Spre)./double(Spost))

12 years ago | 2

| accepted

Answered
Edit mex configuration programmatically
Can you go into the mexopts directory, copy all of the setup files for the compiler you are using into new files with slightly d...

12 years ago | 0

Answered
calling mex function multiple times
Try changing this line: MWSIZE, EXTERNAL :: MXGETM, MXGETN to this: MWPOINTER, EXTERNAL :: MXGETM, MXGETN This...

12 years ago | 1

Answered
Matlab slow when too many files in directory
Every time you change the current directory, MATLAB has to examine each and every file in the new directory to see if there are ...

12 years ago | 1

Answered
How do I change a file from .mexw64 to .m?
A .mexw64 file is compiled machine code for a Windows 64-bit setup. So it must be used by a 64-bit MATLAB version running under ...

12 years ago | 1

| accepted

Answered
matlab command for complex exponential function.
The exp function works for complex inputs: >> z = 1 + 2i z = 1.0000 + 2.0000i >> exp(z) ans = -1.1312 +...

12 years ago | 1

| accepted

Answered
The pause and return commands of fortran 90 to matlab
The PAUSE statement does just what the name implies, pauses execution with a message until user does something (e.g., presses En...

12 years ago | 2

| accepted

Answered
(simple) problem for function that doesn't return value
How are you calling the function? The names of the variables in the calling routine have no connection to the names in the funct...

12 years ago | 3

Answered
homogeneous distribution of particles over the surface of a sphere
Consider circular horizontal slices through the sphere (latitude slices). At the equator, the circle has a certain radius(the ra...

12 years ago | 1

| accepted

Answered
mex file and gpib link
To examine what the class name is for a variable in a mex routine you can use mxGetClassName: http://www.mathworks.com/help/m...

12 years ago | 2

Answered
Fortran to Matlab converting the "where" statement
no_converge= zeros(size(A)); no_converge( abs(A-B) > e ) = 1; or no_converge= double( abs(A-B) > e ); or if you ...

12 years ago | 1

| accepted

Answered
Using a loop to create multiple variables
Are you simply trying to do something like this: D = A(FirstIndex:CycleSkip:FirstIndex+500,:); Then you can pick off X a...

12 years ago | 2

Answered
How does one return allocated memory from a Fortran Mex function?
Fundamental Principle: You cannot mix native Fortran (or C or C++) memory within an mxArray. To do so will always result in a cr...

12 years ago | 3

| accepted

Answered
How to convert a 24 bit, two’s complement value into a signed integer?
s = 2's complement 24-bit string to convert b = [s([1 1 1 1 1 1 1 1]) s]; % sign extension k = typecast(uint32(bin2dec(b...

12 years ago | 2

| accepted

Answered
Problem with mxGetScalar in mex function cuda
If MATLAB prints out the value of 72 for nV just prior to the mex call, then that is what it is inside your mex function. So my ...

12 years ago | 1

| accepted

Answered
Iterate through custom bus datatype fields CMex
If you have a struct in your mex routine (call it st) and need to get at the .Elements(1).DataType field element, you will need ...

12 years ago | 1

Answered
A PUZZLING QUESTION: Does Matlab's Mex file support external inputs and outputs?
Yes, you can use native Fortran file I/O in mex routines. Just write the code as you normally would. The main restriction is in ...

12 years ago | 2

Answered
Problem with mxGetScalar in mex function cuda
Can you verify the value of DICTIONARY.nV just prior to making the mex call? E.g., display(DICTIONARY.nV); v = makeOpera...

12 years ago | 1

Answered
How to improve efficiency of two port matrix calculations?
If your main stumbling block is doing 3D page-based matrix multiplication, you can try 3rd party submissions from the FEX. E.g.,...

12 years ago | 1

| accepted

Answered
what segment of memory does the matlab primary work space and function work space occupies?
Not sure we understand your question completely, or why you are asking it. The memory for variable data typically comes from the...

12 years ago | 1

| accepted

Answered
data structure for a matrix (2 dimensional) whose elements are a vector
For memory efficiency, you can use a 3D k-by-m-by-n array A. E.g., A(1:k,1,1) = 1st k-vector A(1:k,2,1) = 2nd k-vector ...

12 years ago | 1

| accepted

Answered
Come come. Mex File error running.
You've got several type mismatches. E.g., out2 in mexFunction is a pointer to a double (i.e., REAL*8) since you use mxCreateD...

12 years ago | 2

Answered
how to optimize a diag matrix with sparse
If you mean how to create the equivalent sparse matrix to your full matrix shown, try using the spdiags function instead of diag...

12 years ago | 1

Answered
Same Same But Different? mxGetPr and mxGetData...
mxGetData returns a (void *) type to the address of the data memory block. It can be used with a cast to get a pointer to whatev...

12 years ago | 5

| accepted

Answered
how to call a C# function, foo(out byte [])? -- help passing a byte pointer
Have you tried changing the header signature to something more friendly to MATLAB, but have the same basic I/O? E.g., b...

12 years ago | 2

Load more