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

13 years ago | 1

| accepted

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

13 years ago | 0

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

13 years ago | 0

| accepted

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

13 years ago | 0

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

13 years ago | 3

| accepted

Answered
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 =...

13 years ago | 0

| accepted

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

13 years ago | 1

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

13 years ago | 1

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

13 years ago | 0

Answered
Taylor series expansion of cosine function
doc taylor

13 years ago | 1

| accepted

Answered
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"

13 years ago | 0

Answered
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, ...

13 years ago | 2

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

13 years ago | 4

| accepted

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

13 years ago | 2

| accepted

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

13 years ago | 3

Answered
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]; ...

13 years ago | 2

| accepted

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

13 years ago | 0

Question


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

13 years ago | 1 answer | 5

1

answer

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

13 years ago | 2

| accepted

Answered
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)...

13 years ago | 1

| accepted

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

13 years ago | 0

| accepted

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

13 years ago | 0

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

13 years ago | 0

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

13 years ago | 0

Answered
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);...

13 years ago | 1

| accepted

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

13 years ago | 1

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

13 years ago | 2

| accepted

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

13 years ago | 1

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

13 years ago | 3

Answered
How to solve this matrix using inverse function?
Assuming inv(A) is a typo and you really meant inv(AA): "a" and "e" are the same, so you have two rows in AA that are the sam...

13 years ago | 1

| accepted

Load more