回答済み
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...

14年以上 前 | 0

回答済み
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 = ...

14年以上 前 | 1

回答済み
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年以上 前 | 1

回答済み
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...

15年弱 前 | 3

回答済み
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. ...

15年弱 前 | 1

回答済み
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...

15年弱 前 | 1

| 採用済み

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

15年弱 前 | 0

回答済み
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...

15年弱 前 | 0

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

15年弱 前 | 0

回答済み
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...

15年弱 前 | 1

回答済み
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...

15年弱 前 | 0

回答済み
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 ...

15年弱 前 | 1

| 採用済み

回答済み
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...

15年弱 前 | 1

| 採用済み

回答済み
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...

15年弱 前 | 0

回答済み
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(...

15年弱 前 | 1

| 採用済み

回答済み
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...

15年弱 前 | 0

回答済み
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...

約15年 前 | 2

| 採用済み

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

約15年 前 | 4

| 採用済み

回答済み
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 ...

約15年 前 | 6

| 採用済み

回答済み
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 ...

約15年 前 | 0

回答済み
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-...

約15年 前 | 1

| 採用済み

回答済み
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...

約15年 前 | 2

| 採用済み

回答済み
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...

約15年 前 | 0

| 採用済み

回答済み
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...

約15年 前 | 0

| 採用済み

回答済み
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...

約15年 前 | 0

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

約15年 前 | 1

| 採用済み

回答済み
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...

約15年 前 | 5

| 採用済み

回答済み
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'...

約15年 前 | 1

| 採用済み

回答済み
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...

約15年 前 | 0

回答済み
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...

約15年 前 | 4

| 採用済み

さらに読み込む