Respondida
Help figuring out this Function file
Your test should be: if a<=x(k) && x(k)<=b Your original line is interpreted as follows: if (a<=x(k))<=b The fir...

más de 13 años hace | 1

| aceptada

Respondida
Beginner: Mex array size too large?
Your myArray is a *local* variable, meaning that the memory for it is obtained from the stack. The stack for your program is typ...

más de 13 años hace | 1

| aceptada

Respondida
could i instal MATLAB R2007a in windows 7
Some people have had success in updating the Java that MATLAB uses and which display mode (Classic, etc) that Windows uses. I do...

más de 13 años hace | 0

Respondida
Matlab cast before calculation rule
I will caveat everything below with the caution that the JIT can sometimes optimize things differently than you might expect. E....

más de 13 años hace | 0

| aceptada

Respondida
Regarding to calling Matlab from Fortran program (fengdemo.f, matdemo1.f)
For the API function interfaces, it is quite possible that the integers involved need to be 8-byte integers instead of 4-byte in...

más de 13 años hace | 0

Respondida
How to get arg min of an N-dimensional Matrix ?
[m n] = min(M(:)); [x y z] = ind2sub(size(M),n); x, y, z will be the indexes (i.e., argmin) of the minimum value of your...

más de 13 años hace | 3

| aceptada

Respondida
How to make my bisection method more accurate?
Change tol to a smaller value. E.g., >> f = @sin f = @sin >> a = -.1 a = -0.1000 >> b = .2 b =...

más de 13 años hace | 0

| aceptada

Respondida
Question about mxCallMATLAB in mex Files
Calling randn and returning a single value: #include "mex.h" void mexFunction( int nlhs, mxArray *plhs[], int nrhs, cons...

más de 13 años hace | 1

Respondida
adding matrix to every column in other matrix
bsxfun(@plus,a,b)

más de 13 años hace | 1

Respondida
Have problem when learn mex
The file yprime.c needs to be in your current directory if you don't use the full pathname. So copy the file yprime.c from the M...

más de 13 años hace | 0

Respondida
Taylor series expansion of cosine function
doc taylor

más de 13 años hace | 1

| aceptada

Respondida
the definitions of some functions, such as mxDestroyArray_proxy, mxGetPr_proxy, mxarray
How did you build this? Did you have this line at the very top of your code: #include "mex.h"

más de 13 años hace | 0

Respondida
sum(w) and ones(1,size(w,2))*w' results totally different numbers
The answer is on the order of eps of the numbers you are dealing with. You have massive cancellation going on in the operation, ...

más de 13 años hace | 2

Respondida
add vector to an existing matrix
Did you mean this? data9(:,9) = moneyness; Another way to do it: data9 = [data8 moneyness];

más de 13 años hace | 4

| aceptada

Respondida
Adding C file into Matlab routine
The difference is that in your original code you did not create any variables in the plhs[0], plhs[1], etc spots before you trie...

más de 13 años hace | 2

| aceptada

Respondida
What is a function that takes the diagonal of a matrix (N) and converts the diagonal to all zeros.
Another method if you know m is square: r = size(m,1) + 1; m(1:r:end) = 0; If you don't know if m is square or no...

más de 13 años hace | 3

Respondida
How to read back (and use) a matrix from a matlab function called from a mex file?
I don't see anywhere in your code where you create a variable in histforce_ips[0]. E.g., mxArray * histforce_ips[1]; ...

más de 13 años hace | 2

| aceptada

Respondida
Memory Leaks using MEX file
If your mex file has a bug in it that is leaking memory, then the only thing you can do is get your hands on the source code, fi...

más de 13 años hace | 0

Pregunta


Setting Break Point Changes Answer
I recently observed that setting a break point inside a function had the effect of changing the calculation being made downstrea...

más de 13 años hace | 1 respuesta | 5

1

respuesta

Respondida
Use function handle in MEX file (serialize it)
You might look into these undocumented API functions: mxSerialize mxDeserialize I have never used them myself, but yo...

más de 13 años hace | 2

| aceptada

Respondida
Invalid MEX-file error after compiling matcreat.cpp
Are you trying to create a mex function to run from the MATLAB environment, or are you trying to create a program (i.e., an exe)...

más de 13 años hace | 1

| aceptada

Respondida
Convert a function with 6 variables to a function with a vector of variables
One way: Create an m-file function from your code and make a function handle to it. E.g., fht = @fht_fun The file fht_fu...

más de 13 años hace | 0

| aceptada

Respondida
What is the largest size matrix that matlab can handle
100M x 100M full matrix is over 71 PETA bytes! No, I don't think you have enough memory (or time) to do this. Is your matrix spa...

más de 13 años hace | 0

Respondida
Matlab and Visual Sudio
Haven't looked at the code in detail, but for sure you don't want to close the engine before you do the pause because that will ...

más de 13 años hace | 0

Respondida
How to make elements in an array permanant
You could fix the seed used every time so you get the same stream of random numbers with each trial. See the rng function: <h...

más de 13 años hace | 0

Respondida
dynamic naming using eval(.)
I would advise using a cell array instead. E.g., IP = IP_count(:); x = IP_count_length; FB = cell(1,IP_count_length);...

más de 13 años hace | 1

| aceptada

Respondida
C++ callbacks to matlab?
See the C/C++ API documentation: <http://www.mathworks.com/help/matlab/programming-interfaces-for-c-c-fortran-com.html> Yo...

más de 13 años hace | 1

Respondida
What is the minimum number greater than zero in matlab?
realmin returns the smallest normalized number. To get the smallest denormalized number (not as much precision as a normalized n...

más de 13 años hace | 2

| aceptada

Respondida
Expressing floating point numbers in IEEE standard?
In addition to the links provided in the previous answers I would point you to the MATLAB function [F,E] = log2(X) to extract th...

más de 13 años hace | 1

Respondida
The mantissa of a floating point number???
A word or caution here. The mantissa referred to in the mathworld link above is *NOT* the same as the mantissa referred to i...

más de 13 años hace | 3

Cargar más