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

casi 15 años hace | 0

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

casi 15 años hace | 1

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

casi 15 años hace | 1

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

casi 15 años hace | 3

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

casi 15 años hace | 1

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

casi 15 años hace | 1

| aceptada

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

casi 15 años hace | 0

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

casi 15 años hace | 0

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

casi 15 años hace | 0

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

casi 15 años hace | 1

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

casi 15 años hace | 0

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

casi 15 años hace | 1

| aceptada

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

casi 15 años hace | 1

| aceptada

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

casi 15 años hace | 0

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

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 2

| aceptada

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

alrededor de 15 años hace | 4

| aceptada

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

alrededor de 15 años hace | 6

| aceptada

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

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 2

| aceptada

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

alrededor de 15 años hace | 0

| aceptada

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

más de 15 años hace | 0

| aceptada

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

más de 15 años hace | 0

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

más de 15 años hace | 1

| aceptada

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

más de 15 años hace | 5

| aceptada

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

más de 15 años hace | 1

| aceptada

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

más de 15 años hace | 0

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

más de 15 años hace | 4

| aceptada

Cargar más