Beantwortet
How can I calculate the Chi-Squared CDF if I use MATLAB C-Coder?
This function is now supported for code generation in R2013b.

mehr als 12 Jahre vor | 1

Beantwortet
Why Matlab integral function does not work properly?
The problem is that "if" is not vectorized the way you would expect. I think if x > 0 means if all(x(:) > 0) S...

mehr als 12 Jahre vor | 3

Beantwortet
Nested integral within integral2
The problem here is that integral2 requires that the integrand accept arrays as inputs and return arrays as outputs, but integra...

mehr als 12 Jahre vor | 2

| akzeptiert

Beantwortet
how to solve a integral when the parameters are matrix
I don't get the final assignment to x(t1) of what I presume to be a matrix result. Also, I am not certain whether e^A means exp...

mehr als 12 Jahre vor | 0

Beantwortet
Integration HELP Mie Scattering
Since I don't know much about this application area, I'm not in position to work on the code here. I would approach a problem l...

mehr als 12 Jahre vor | 0

Beantwortet
Why does strcmp take numerical arguments?
I think the intent was that the semantics of strcmp be ischar(a) && ischar(b) && strcmp(a,b) where in that expression i...

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
(Numerically) Integrating bump functions --- on R^1 vs R^2 and R^n
Avoid masking the integrand in this manner if possible. It is numerically toxic. INTEGRAL2 is written to accept functional lim...

mehr als 12 Jahre vor | 1

Beantwortet
How can I declear a struct array in m file when generating C++ codes through Matlab Coder?
I would use repmat. Initially MATLAB Coder did not support empty struct arrays. Unfortunately, I don't remember when that restr...

mehr als 12 Jahre vor | 0

Beantwortet
integral with (sin x)^4
You have two errors. One, you need 1./sqrt instead of 1/sqrt. Second, you have \0.0865^2 instead of /0.0865^2. Here is how to ...

mehr als 12 Jahre vor | 0

Beantwortet
double integral and fitted functions
I'm going to treat this like a homework problem. You'll need to define some anonymous functions. For example, if b is a pp-form...

mehr als 12 Jahre vor | 0

Beantwortet
MATLAB Coder indexing out of bounds
If x is a scalar passed to this function, then attempting to reference x(2) will error in MATLAB and in MATLAB Coder in exactly ...

mehr als 12 Jahre vor | 0

Beantwortet
How to delete rows/columns of a matrix in Embedded Matlab Fcn?
I don't know what version you have. MATLAB Coder does currently support deleting rows and columns from a matrix. You will need...

mehr als 12 Jahre vor | 2

| akzeptiert

Beantwortet
Implementing generalized cosine and sine integrals
Well, first of all, I think we need 0 < k < 2 for the generalized sine integral and 0 < k < 1 for the generalized cosine integra...

mehr als 12 Jahre vor | 0

Beantwortet
Porblem in Converting MATLAB code to C using MATLAB Coder
It sounds like you are supplying each of the functions to be compiled. If you do that, you will need to supply the argument typ...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How can I make definite integral to Bessel function in the interval from 0 to infinite
I'm not sure I understand the problem. The answer is 1, so use 1 instead of quadgk(f,0,inf). However, if you are concerned abou...

mehr als 12 Jahre vor | 0

Beantwortet
Problem with quad: how to handle a loop in the integrand function ?
QUAD, and most of the other integration functions in MATLAB, is written to evaluate the integrand at more than one point at a ti...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Matlab Coder: how can I eliminate the date in c-code comments
I agree that this would be a useful thing. The only solution I know about is a "nuclear option". Under "Code Appearance" there...

mehr als 12 Jahre vor | 2

Beantwortet
Using MATLAB, what is the best way to find the integral of a bounded range of a CDF?
Well, you _have_ the function as well, not just the vector. If I understand you correctly, integral(@(x)cdf(pd,x),r(1),r(2...

mehr als 12 Jahre vor | 2

| akzeptiert

Beantwortet
Is it possible to convert a global optimization matlab code, using multistart with lsqnonlin , in to c using codegen?
Unfortunately, no. LSQNONLIN is not supported for code generation. It is possible to use functions that are not supported with...

mehr als 12 Jahre vor | 0

Beantwortet
How to perform 4D integral in matlab ?
The easiest way to integrate f(x,y,z,w) from a <= x <= b, c <= y <= d, e <= z <= g, and h <= w <= i is Q = integral(@(x)int...

mehr als 12 Jahre vor | 4

| akzeptiert

Beantwortet
How can I prevent the calculation of intermediary results while code generation with the embedded coder?
I think you have misapprehended the source of your problem. The exact mathematical result p1*p2*p3 is 1301.55464561. This numb...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Please help with the trig integral
On the line defining fun2, change "fun1" to "fun1(x)".

fast 13 Jahre vor | 0

Beantwortet
Using Quad2d with indicator function
QUAD2D sends in m-by-m matrices, which you are required to evaluate "elementwise", i.e. if Z = f(X,Y), then Z is the same size a...

fast 13 Jahre vor | 0

Beantwortet
Anonymous functions and integration
MATLAB files can be flexible when they are combined with the use of anonymous functions. Anonymous functions can also be suppli...

fast 13 Jahre vor | 1

Beantwortet
dblquad integral strange behaviour
Since adaptive quadrature relies on finite sampling, and the number of initial points tends to be fixed, regardless of interval ...

fast 13 Jahre vor | 0

Beantwortet
Getting Error using quad2d
Let f be the integrand function and let Z = f(X,Y). QUAD2D requires that # size(Z) matches size(X) and size(Y). The inputs ...

fast 13 Jahre vor | 0

Beantwortet
numerical integration with nonarray function
It is, indeed, unnecessary to perform numerical integration on this integrand. However, to answer the question in _general_, Th...

fast 13 Jahre vor | 0

| akzeptiert

Beantwortet
How to know starting which MATLAB release a particular function was implemented?
INTEGRAL was added in R2012a along with INTEGRAL2 and INTEGRAL3.

fast 13 Jahre vor | 0

Beantwortet
How can i evaluate this surface integral? (It has some singularities)
When I split the integral up into regions with difficult parts (a couple of circles) on the boundaries, I can get QUAD2D and INT...

fast 13 Jahre vor | 0

Beantwortet
Integral2 and array valued functions
Not in the same way. INTEGRAL2 does not support an 'ArrayValued' option. I prototyped it, but testing revealed that it did not...

fast 13 Jahre vor | 2

| akzeptiert

Mehr laden