Réponse apportée
coverting to c code
CODEGEN is the command-line way, CODER is the graphical user interface. It's the same technology "under the hood". I expect "c...

plus de 14 ans il y a | 0

Réponse apportée
why dblquad can not be used to evaluate the bessel function of the second kind bessely
Integrate using QUAD2D and put the singularity on the boundary. >> f = @(x,y)-abs(x-y).*bessely(1,abs(x-y)) f = ...

plus de 14 ans il y a | 1

Réponse apportée
eml.extrinsic in Simulink MATLAB function blocks
Are you pre-defining the outputs of each extrinsic call as you should? That is to say, your call sites should look something li...

plus de 14 ans il y a | 1

Réponse apportée
Absolute and relative tolerance definitions
The numerical method works with an error estimate, i.e. it computes an _approximation_ for abs(x-x0), where x is the approximate...

plus de 14 ans il y a | 3

Réponse apportée
Arrays and embedded MATLAB function in Simulink
All signal inputs to an Embedded MATLAB Function block are inherently variable, even if they are emitted from a constant block. ...

plus de 14 ans il y a | 1

Réponse apportée
2D Integration with infinite limits (Fourier Transform)
You're using L as both a function and as a variable there. Must have happened when you were trying to simplify the presentation...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
Integration
QUADGK can handle infinite limits. >> quadgk(@(x)exp(-x.^2./2)./sqrt(2*pi),-inf,inf) ans = 1.000000000000038 Th...

plus de 14 ans il y a | 0

Réponse apportée
Failed to eliminate a call to the MATLAB function 'quadprog'.
I agree with Titus, but if you can share it, I would be very interested to hear more about your application. Are you going to g...

plus de 14 ans il y a | 0

Réponse apportée
Use of Quadv
I don't understand your application. However, speaking quite generally, QUADV is the vector-valued form of QUAD. There is no...

plus de 14 ans il y a | 0

Réponse apportée
How to use the Output function of a Cubic Spline Interpolation?
Just wanted to add that the _best_ way of integrating a piecewise-defined function in MATLAB is quadgk(@(t)ppval(pp,t),x(1...

plus de 14 ans il y a | 1

Réponse apportée
using QUADGK vs QUADL numerical integration algorithm
I'm not sure what notifications the poster gets. Since I added an "I'll take a look" answer first and later edited it, maybe I s...

plus de 14 ans il y a | 0

Réponse apportée
using QUADGK vs QUADL numerical integration algorithm
Yes, you're on the right track. The problem here is that you are computing in finite precision and you don't have enough of it ...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
using quad2d
DOT doesn't work on function handles, and as Walter says, QUAD2D requires that the integrand be able to handle matrix input. Yo...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
Matlab Coder : Problem with string
You are passing texte as a read+write argument. If your function does not modify the argument, try coder.rref(): coder.ceval...

plus de 14 ans il y a | 0

Réponse apportée
Using quad or quad2d to evalute a 1-D integral of 2-D function
You need to "bind" one of the arguments to whatever value you choose. This is done with an "anonymous" function. fx = @(x)f(...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
quad2d problem
I've only spent a little time looking at this. I get the warning but with passing the global error test. My impression is that...

plus de 14 ans il y a | 0

Réponse apportée
Arithmetic promotion: floating-point to integer?
I don't know. Since I work in code generation, these sorts of behaviors are a regular nuisance to me, but maybe I can imagine w...

presque 15 ans il y a | 2

| A accepté

Réponse apportée
Numerical Integration with functions as borders
QUAD2D accepts function handles for limits. Take care that you make them "vectorized" (usually just use .*, .+, and ./ instead ...

presque 15 ans il y a | 4

| A accepté

Réponse apportée
coder and error passing handles to extrinsic functions
You need to refactor your code so that you don't pass function handles across the extrinsic function call boundary. Instead of ...

presque 15 ans il y a | 6

| A accepté

Réponse apportée
FINDING DETERMINANT OF MATRIX AFTER TAKING COVARIANCE
I can give you a quick manual calculation of det(cov(x)). It's just 0. The problem is that determinant is not well-behaved in ...

presque 15 ans il y a | 0

Réponse apportée
integral multiple infinite limits
Try this: function q = paris(fun1,fun2,x,Kt) % q = ∫[exp(-u^2)*(∫fun1(v,u,x,Kt)dv)*(∫fun2(v,u,x,Kt)dv]du % The limits are 1e-...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Quartic solver using Embedded matlab function
The problem here is that ROOTS always returns a variable-size result. That's because it ignores leading zeros (or extremely sma...

presque 15 ans il y a | 2

| A accepté

Réponse apportée
double integral infinite limits
This is easy to modify if you want c and/or d to be a function handle, like for QUAD2D. Also, it should be easy to add toleranc...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Matlab coder automatically inlines m file returning multiple values
Although I'm not an expert in the inlining heuristics of the compiler, I'm not aware that inlining has anything to do with the n...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
About incomplete gamma function
I'm confused by the swapping parameters aspect, perhaps because I have not used Mathematica for nearly two decades. Could we for...

presque 15 ans il y a | 0

Réponse apportée
Simulink Compiled Code NaN
Look under Simulation-->Configuration Parameters-->Diagnostics-->Data Validity There is a setting for "Inf or NaN block outpu...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Subscripting into an mxArray
That is the error you get when you use coder.extrinsic and fail to declare the output before calling the extrinsic function. If...

presque 15 ans il y a | 5

| A accepté

Réponse apportée
Quad 2d giving inconsistant answers
Did you turn the warnings off? Your second integration failed: >> quad2d(@(x,y)(of_Nd_ExpHimmelblau(x,y)),-5,5,-5,5,'AbsTol'...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
matlab to c
I echo the requests for more of the code. However, let me just point out that MATLAB Coder performs some optimizations. If you...

presque 15 ans il y a | 0

Réponse apportée
Floor function for int8
Using your later example, idivide(a,4,'floor') does what you want there. I prefer to make both arguments integers of the s...

presque 15 ans il y a | 4

| A accepté

Charger plus