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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 1

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

oltre 14 anni fa | 1

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

oltre 14 anni fa | 3

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

oltre 14 anni fa | 1

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

oltre 14 anni fa | 1

| accettato

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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 1

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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 1

| accettato

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

oltre 14 anni fa | 1

| accettato

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

oltre 14 anni fa | 0

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

oltre 14 anni fa | 1

| accettato

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

oltre 14 anni fa | 0

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

quasi 15 anni fa | 2

| accettato

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

quasi 15 anni fa | 4

| accettato

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

quasi 15 anni fa | 6

| accettato

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

quasi 15 anni fa | 0

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

quasi 15 anni fa | 1

| accettato

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

quasi 15 anni fa | 2

| accettato

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

quasi 15 anni fa | 0

| accettato

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

quasi 15 anni fa | 0

| accettato

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

quasi 15 anni fa | 0

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

quasi 15 anni fa | 1

| accettato

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

quasi 15 anni fa | 5

| accettato

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

quasi 15 anni fa | 1

| accettato

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

quasi 15 anni fa | 0

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

quasi 15 anni fa | 4

| accettato

Carica altro