Respondida
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...

más de 12 años hace | 2

Respondida
How to use the dot product within a loop to multiply a series of rows?!
A direct matrix multiply is likely to be faster than using dot. E.g., assuming the variables are real: C = coordNORMALS * V...

más de 12 años hace | 2

Respondida
How to read 'long long' from binary file?
For precision use '*int64'. If the file was written on a different machine you may need to deal with endian stuff as well.

más de 12 años hace | 1

| aceptada

Respondida
How to create an empty struc with fields of a given struct?
One way, which will give you a 0x0 struct, is: f = fieldnames(A)'; f{2,1} = {}; B = struct(f{:}); Method basically...

más de 12 años hace | 6

| aceptada

Pregunta


Preferred method to report documentation errors / typos?
To: MathWorks Support Team What is the preferred method these days for reporting documentation errors & typos etc? This Answe...

más de 12 años hace | 1 respuesta | 1

1

respuesta

Respondida
Error during Mex compilation
It is possible the compiler you are using does not support the uint8_t type (or related types). If so, you might have to manuall...

más de 12 años hace | 1

Respondida
What does this mean?
Change 1: Each element of the 2nd row is a cell array. And each of those cell arrays has two elements (1x2 dimension). Each o...

más de 12 años hace | 0

Respondida
Multiply a "stack" of matrices with a "stack" of vectors
Some options in the FEX: C-mex code: http://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multipl...

más de 12 años hace | 0

Respondida
Opposite operation of XOR
a = xor(Cipher,key)

más de 12 años hace | 3

Respondida
Datenum: how many seconds in a day?
With regards to the datenum and related functions, MATLAB days are exactly 24h (86400s) always. There *is* accounting for leap d...

más de 12 años hace | 5

| aceptada

Respondida
MATLAB crashes when I run MEX file - HELP
I don't see any place in your code where you allocate temp. So the first time you use it you dereference an invalid pointer, and...

más de 12 años hace | 1

Respondida
Matlab code for Euler's method
Look at this link: http://en.wikipedia.org/wiki/Euler%27s_method Look at the "Formulation of the method" and "Example" sec...

más de 12 años hace | 1

Respondida
What extra data is stored by an anonymous function?
This topic has already been addressed in this thread: http://www.mathworks.com/matlabcentral/answers/65963-function-handles-a...

más de 12 años hace | 0

Respondida
Crash during mxCopyReal8toPtr in Fortan 90 Mex File when Arrays are Large
I haven't looked at your code in any great detail, but one thing I noticed was this: call mxCopyPtrToReal8(mxGetData(PR...

más de 12 años hace | 2

Respondida
How implement constrain of being positive in Nelder-Mead Method?
Another trick is to return f(x) = infinity whenever any of the x(i) are not positive. Have your starting guess all positive and ...

más de 12 años hace | 2

Respondida
Error using mex (line 206) Unable to complete successfully.
Usually the file-not-found error is because the 'GraphCutMex.cpp' file is not in the current default directory. E.g., can you se...

más de 12 años hace | 0

Respondida
Calling mex sub-routines - runs out of memory? Any specific destroyArray required for prhs after using it?
No, you should not be calling mxDestroyArray for any of the prhs after using them. What does the utc2UT1 routine look like? Are ...

más de 12 años hace | 1

Respondida
Parsing problems with Matricies in C++ Mex Files
You are printing out a double floating point value using an integer format %d. Use a floating point format instead (%f, %g). E.g...

más de 12 años hace | 2

| aceptada

Respondida
Segmentation error in mex file
I don't see anywhere where you allocate field_names: const char **field_names; /* pointers to field names */ :...

más de 12 años hace | 1

| aceptada

Respondida
"Unable to locate 'mexopts.bat', and therefore cannot determine which compiler to use for simulation builds. Use 'mex -setup' to select a supported compiler." I am getting this error. Suggest me what to do.
At the MATLAB command line, type exactly what the error message told you to type: mex -setup Then press Enter when it as...

más de 12 años hace | 0

| aceptada

Respondida
mxGetPr crashing for no reason
If you want to operate on a calling workspace variable in-place iteratively, you will have to pass that variable into the mex ro...

más de 12 años hace | 0

| aceptada

Respondida
how to get the length of a array?
Pass the length of the "array" as part of the argument list. You can't get this info by simply examining the "array" pointer its...

más de 12 años hace | 1

Respondida
Matlab engine - C++ doesn't call matlab function written by myself
The Engine starts up with the default folder, so if your function is not on the path at start up then the Engine will not see it...

más de 12 años hace | 0

| aceptada

Respondida
Guidance in writing mexFunction for convert.c
Try putting this at the top of the file and then mex it: // One input argument: The Filename int main(int argc, char **a...

más de 12 años hace | 1

| aceptada

Respondida
Highly variable execution time of mex file
I have no real explanation for this behavior (underlying cache system?), but I have noticed it on many occasions for some of my ...

más de 12 años hace | 1

Respondida
Get the data in rows and/or columns from a matrix in a MEX file
The signature for ddot from this link: http://www.netlib.org/blas/ is: DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX...

más de 12 años hace | 0

| aceptada

Respondida
Can someone write an example of using the secant method to find roots of equations?
You can find an example here: http://en.wikipedia.org/wiki/Secant_method

más de 12 años hace | 2

| aceptada

Respondida
How to Read Fortran 90 Unformatted Binary Files into Matlab
See this thread for an example of reading Fortran unformatted binary data into MATLAB: http://www.mathworks.com/matlabcentral...

más de 12 años hace | 0

Respondida
Question on the use of function 'load' to open a *.mat file
The statement: load File is equivalent to: load('File') What you want to do is load(File) This is a ge...

más de 12 años hace | 0

| aceptada

Respondida
why does preallocating space for array of structures by brute force leave my editor upset?
As shown, I agree that s is already allocated for the 2nd loop. The editor may simply not be smart enough to recognize this. Is ...

más de 12 años hace | 0

Cargar más