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

14 years ago | 1

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

14 years ago | 3

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

14 years ago | 1

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

14 years ago | 1

| accepted

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

14 years ago | 0

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

14 years ago | 0

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

14 years ago | 0

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

14 years ago | 1

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

14 years ago | 0

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

14 years ago | 1

| accepted

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

14 years ago | 1

| accepted

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

14 years ago | 0

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

14 years ago | 1

| accepted

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

14 years ago | 0

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

14 years ago | 2

| accepted

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

14 years ago | 4

| accepted

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

14 years ago | 6

| accepted

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

14 years ago | 0

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

14 years ago | 1

| accepted

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

14 years ago | 2

| accepted

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

14 years ago | 0

| accepted

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

14 years ago | 0

| accepted

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

14 years ago | 0

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

14 years ago | 1

| accepted

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

14 years ago | 5

| accepted

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

14 years ago | 1

| accepted

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

14 years ago | 0

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

14 years ago | 4

| accepted

Answered
emlc mxArray issue
The LOGSIG function is not supported for code generation, so you must have declared it extrinsic. Read the documentation about ...

14 years ago | 0

Answered
MATLAb Integration
Walter's suggestion of symbolic integration might work in some cases. Barring that, the only integration function that works on...

14 years ago | 0

Load more