Numerical Analyst

Answered

How can I translate matlab functions to C/C++ void functions using codegen?

The code generator is usually smart enough to detect when computations have no side effects and have no impact on return values....

How can I translate matlab functions to C/C++ void functions using codegen?

The code generator is usually smart enough to detect when computations have no side effects and have no impact on return values....

17 days ago | 2

| accepted

Answered

what is the significance of 3.3121686421112381E-170 ?

Walter is on the right track. What we see above is essentually a loop-unrolled version of the reference BLAS algorithm of DNRM2...

what is the significance of 3.3121686421112381E-170 ?

Walter is on the right track. What we see above is essentually a loop-unrolled version of the reference BLAS algorithm of DNRM2...

1 month ago | 2

| accepted

Answered

How can compile in C/C++ the lpc funciton ?

Extrinsic calls can work only when the target is mex or one is simulating in Simulink. This is because extrinsic calls are call...

How can compile in C/C++ the lpc funciton ?

Extrinsic calls can work only when the target is mex or one is simulating in Simulink. This is because extrinsic calls are call...

7 months ago | 0

| accepted

Answered

Coder, randsample: Variable 'edges' is not fully defined on some execution paths.

This is a bug in the code generation version of RANDSAMPLE. The compiler is complaining about a situation that it really doesn'...

Coder, randsample: Variable 'edges' is not fully defined on some execution paths.

This is a bug in the code generation version of RANDSAMPLE. The compiler is complaining about a situation that it really doesn'...

9 months ago | 0

| accepted

Answered

Multiple calls to interpn using same vectors

Unfortunately, there will be a separate look-up for each call. The only thing I can think of is to find the bounding box yourse...

Multiple calls to interpn using same vectors

Unfortunately, there will be a separate look-up for each call. The only thing I can think of is to find the bounding box yourse...

1 year ago | 1

| accepted

Answered

how use Curve Fitting functions in Matlab coder?

I'm not sure what you need. MATLAB Coder does support the SPLINE, PCHIP, and PPVAL. I don't know that much about what C libr...

how use Curve Fitting functions in Matlab coder?

I'm not sure what you need. MATLAB Coder does support the SPLINE, PCHIP, and PPVAL. I don't know that much about what C libr...

1 year ago | 0

| accepted

Answered

How can I calculate this triple integral when I have a rotated euler matrix. All that is attached in the file,

INTEGRAL3 does not support integrating a matrix of functions. For example, suppose you wanted to integrate f = @(x,y,z)[co...

How can I calculate this triple integral when I have a rotated euler matrix. All that is attached in the file,

INTEGRAL3 does not support integrating a matrix of functions. For example, suppose you wanted to integrate f = @(x,y,z)[co...

3 years ago | 0

Answered

Why i have this errors in my triple integral ? change numeric methods ?

Well, theoretically like this: ss=0.6; T=0.1; a = 0.0001; f2 = @(r,b,g) 1./(r.^2.*sqrt(1 - (b./r).^2 - (g^-2)*...

Why i have this errors in my triple integral ? change numeric methods ?

Well, theoretically like this: ss=0.6; T=0.1; a = 0.0001; f2 = @(r,b,g) 1./(r.^2.*sqrt(1 - (b./r).^2 - (g^-2)*...

3 years ago | 0

| accepted

Answered

how can I solve a triple integral (x,y,z) with y not defined

Your integrand will be evaluated at an array of points each time (not just with one x, y, and z!), so it must return an array of...

how can I solve a triple integral (x,y,z) with y not defined

Your integrand will be evaluated at an array of points each time (not just with one x, y, and z!), so it must return an array of...

3 years ago | 0

Answered

Matlab R2015a coder error:Dimension 1 is fixed on the left-hand side but varies on the right ([1024 x 1] ~= [:? x 1]).

Use coder.varsize to create a variable-size copy of the Phi input. Rename the Phi input to something like PhiInput and just bef...

Matlab R2015a coder error:Dimension 1 is fixed on the left-hand side but varies on the right ([1024 x 1] ~= [:? x 1]).

Use coder.varsize to create a variable-size copy of the Phi input. Rename the Phi input to something like PhiInput and just bef...

3 years ago | 1

| accepted

Answered

Generating c++ Code from *.slx

I'm not in sales, so I could be out-of-date in my recollection of how the product catalog is built, but my understanding is that...

Generating c++ Code from *.slx

I'm not in sales, so I could be out-of-date in my recollection of how the product catalog is built, but my understanding is that...

3 years ago | 0

Answered

randn() function generates the same sequence whenever I called it.

Every time you start MATLAB it will deliver the same sequence if you don't provide your own seed first. Your generated code mus...

randn() function generates the same sequence whenever I called it.

Every time you start MATLAB it will deliver the same sequence if you don't provide your own seed first. Your generated code mus...

3 years ago | 1

Answered

simulink matlab function block error

You need to tell the compiler what the output of lqr will look like. Kr = zeros(1,2); % Define the output type for the extr...

simulink matlab function block error

You need to tell the compiler what the output of lqr will look like. Kr = zeros(1,2); % Define the output type for the extr...

3 years ago | 2

| accepted

Answered

Run ANY matlab Function.m from simulink simulation

If you just want to run it from Simulink, just call _your_ function as extrinsic. For example if your function is called myfun(...

Run ANY matlab Function.m from simulink simulation

If you just want to run it from Simulink, just call _your_ function as extrinsic. For example if your function is called myfun(...

3 years ago | 0

| accepted

Answered

Matlab Coder : Error using interpolation function interp1(x,y,z,'spline');

This all works fine for me. I just tried it in 15a. INTERP1 doesn't need to do anything fancy to figure out the _size_ of the ...

Matlab Coder : Error using interpolation function interp1(x,y,z,'spline');

This all works fine for me. I just tried it in 15a. INTERP1 doesn't need to do anything fancy to figure out the _size_ of the ...

4 years ago | 0

Answered

Anyone know where to begin truing to solve an nth order integral? (n up to 10)

There's a good reason why there's no integraln function. There's a function called integralN on the file exchange that goes up ...

Anyone know where to begin truing to solve an nth order integral? (n up to 10)

There's a good reason why there's no integraln function. There's a function called integralN on the file exchange that goes up ...

4 years ago | 0

Answered

How can I shrink the time of getting the results please?

That code never gave you results because it isn't working--there is a syntax error. Specific suggestions are therefore hard to ...

How can I shrink the time of getting the results please?

That code never gave you results because it isn't working--there is a syntax error. Specific suggestions are therefore hard to ...

4 years ago | 0

| accepted

Answered

triple integral of parametrized function

Something like this? psf = @(x,y,z)exp(-2*(x.^2+y.^2)-2*z.^2); fun1 = @(k,e,x,y,z)((e.*psf(x,y,z)).^k).*exp(-e.*psf(x,y,...

triple integral of parametrized function

Something like this? psf = @(x,y,z)exp(-2*(x.^2+y.^2)-2*z.^2); fun1 = @(k,e,x,y,z)((e.*psf(x,y,z)).^k).*exp(-e.*psf(x,y,...

4 years ago | 1

| accepted

Answered

A and B must be floating-point scalars.

>> help integral integral Numerically evaluate integral. Q = integral(FUN,A,B) approximates the integral of functi...

A and B must be floating-point scalars.

>> help integral integral Numerically evaluate integral. Q = integral(FUN,A,B) approximates the integral of functi...

4 years ago | 0

| accepted

Answered

Why does integral2 function changes the array size of variable over which integration is performed?

The iterated mode uses adaptive quadrature in each dimension, though your integrand function will, in a sense, be aware of only ...

Why does integral2 function changes the array size of variable over which integration is performed?

The iterated mode uses adaptive quadrature in each dimension, though your integrand function will, in a sense, be aware of only ...

4 years ago | 1

| accepted

Answered

Inner matrix dimensions must agree.

You wrote I =@(x) U(x)*H(x)*D(x); That is probably not right. The * operator is _matrix_ multiplication. You probably...

Inner matrix dimensions must agree.

You wrote I =@(x) U(x)*H(x)*D(x); That is probably not right. The * operator is _matrix_ multiplication. You probably...

4 years ago | 1

Answered

İntegral with array boundaries Need help

I've answered this question in a follow-up comment on the other question. It will work, but you have to debug your code. You w...

İntegral with array boundaries Need help

I've answered this question in a follow-up comment on the other question. It will work, but you have to debug your code. You w...

4 years ago | 0

Answered

synchronization of matlab function blocks

The MATLAB Function Block can return arrays. The problem with your code is probably just that you can't return the *persistent*...

synchronization of matlab function blocks

The MATLAB Function Block can return arrays. The problem with your code is probably just that you can't return the *persistent*...

4 years ago | 0

| accepted

Answered

MATLAB Coder - How to use "save" command

Unfortunately, the SAVE command is not supported for code generation, and it doesn't make sense to call it as an extrinsic funct...

MATLAB Coder - How to use "save" command

Unfortunately, the SAVE command is not supported for code generation, and it doesn't make sense to call it as an extrinsic funct...

4 years ago | 0

Answered

how to integrate over array boundaries

Two steps to set it up. First make it work with a scalar x: >> Qscalarx = @(x)integral(@(y)(y - x).^2,0,x); Now vector...

how to integrate over array boundaries

Two steps to set it up. First make it work with a scalar x: >> Qscalarx = @(x)integral(@(y)(y - x).^2,0,x); Now vector...

4 years ago | 0

Answered

closed contour complex integral

MTIMES is matrix multiplication. The functional notation is mtimes(A,B), but the operator notation for matrix multiplication is...

closed contour complex integral

MTIMES is matrix multiplication. The functional notation is mtimes(A,B), but the operator notation for matrix multiplication is...

4 years ago | 0

Answered

How to do a double integral on a function with 3 variables, so the answer is dependent on the 3 variable

Not sure what your problem with INTEGRAL2 was, but you're using matrix multiplication in your definition of FUN, which probably ...

How to do a double integral on a function with 3 variables, so the answer is dependent on the 3 variable

Not sure what your problem with INTEGRAL2 was, but you're using matrix multiplication in your definition of FUN, which probably ...

4 years ago | 0

| accepted

Answered

How to do a double integration of a multivariate normal probability density function

If you have the statistic toolbox, you'll want to use MVNCDF for a multivariate normal distribution. However, in case not every...

How to do a double integration of a multivariate normal probability density function

If you have the statistic toolbox, you'll want to use MVNCDF for a multivariate normal distribution. However, in case not every...

4 years ago | 0

| accepted

Answered

Speeding up integral3 command is taking too long to execute

These two articles might help. http://blogs.mathworks.com/loren/category/integration/ Try different variable orderings. M...

Speeding up integral3 command is taking too long to execute

These two articles might help. http://blogs.mathworks.com/loren/category/integration/ Try different variable orderings. M...

4 years ago | 0