Answered

Code that calculate possible combination of vertices to form triangle from the generated 20 by 2 matrix.

help convhull

Code that calculate possible combination of vertices to form triangle from the generated 20 by 2 matrix.

help convhull

23 days ago | 0

| accepted

Answered

Double Integral of a function that contains factorials

This is not really a question about MATLAB, but of mathematics in general. The problem with your integral is factorials are n...

Double Integral of a function that contains factorials

This is not really a question about MATLAB, but of mathematics in general. The problem with your integral is factorials are n...

23 days ago | 0

| accepted

Answered

How to interpret the outputs of the function "runstest.m"?

This is a problem of appreciating the terminology, and the double negative way things get worded. Do two negatives make a positi...

How to interpret the outputs of the function "runstest.m"?

This is a problem of appreciating the terminology, and the double negative way things get worded. Do two negatives make a positi...

24 days ago | 3

| accepted

Answered

Diffrence between cubic spline (csaps) and smoothing spline in curve fitting toolbox

If you read the docs somewhere below fittype, you will find this comment: Note The smoothing spline algorithm is based o...

Diffrence between cubic spline (csaps) and smoothing spline in curve fitting toolbox

If you read the docs somewhere below fittype, you will find this comment: Note The smoothing spline algorithm is based o...

25 days ago | 1

Answered

Does wblrnd use the inverse tranform method to generate random numbers?

The answer to many questions about MATLAB, is to just read the code. So, I did this... type wblrnd Then look at the code...

Does wblrnd use the inverse tranform method to generate random numbers?

The answer to many questions about MATLAB, is to just read the code. So, I did this... type wblrnd Then look at the code...

26 days ago | 0

| accepted

Answered

Answers given as equation

Do you mean this? vpa(SurfaceAreaOfASphere) ans = 1256.6370614359172953850573533118*[ft]^2

Answers given as equation

Do you mean this? vpa(SurfaceAreaOfASphere) ans = 1256.6370614359172953850573533118*[ft]^2

26 days ago | 2

Answered

parallel computing sig problem

So, you simply cannot put those 500 lines of code inside a function? Or if not as a function, as a script m-file? There is ab...

parallel computing sig problem

So, you simply cannot put those 500 lines of code inside a function? Or if not as a function, as a script m-file? There is ab...

26 days ago | 0

Answered

Computing Divergence of a vector field numerically

First, divergence computes a NUMERICAL approximation to the gradients necessary. It has no clue as to the real derivatives, or t...

Computing Divergence of a vector field numerically

First, divergence computes a NUMERICAL approximation to the gradients necessary. It has no clue as to the real derivatives, or t...

27 days ago | 0

Answered

Generate poisson numbers which sum a certain value?

I frequently see this happen, where someone wants to generate random numbers, subject to some constraint, that essentially inval...

Generate poisson numbers which sum a certain value?

I frequently see this happen, where someone wants to generate random numbers, subject to some constraint, that essentially inval...

29 days ago | 2

| accepted

Answered

Numerically integrate over function that gives out a matrix

While integral offers the option of integrating an array valued function, integral2 does not. However, nothing makes a loop a...

Numerically integrate over function that gives out a matrix

While integral offers the option of integrating an array valued function, integral2 does not. However, nothing makes a loop a...

3 months ago | 0

| accepted

Answered

How can i find the first inersection point of tow functions?

You can't use the intersect function to find the intersection of two curves. Just because the name is similar does not mean it w...

How can i find the first inersection point of tow functions?

You can't use the intersect function to find the intersection of two curves. Just because the name is similar does not mean it w...

3 months ago | 0

| accepted

Answered

Integrating bivariate normal distribution in polar coordinates efficiently

Why do you need to re-express the PDF in polar form? It is one line of code to convert polar form into cartesian form to do the ...

Integrating bivariate normal distribution in polar coordinates efficiently

Why do you need to re-express the PDF in polar form? It is one line of code to convert polar form into cartesian form to do the ...

3 months ago | 0

Answered

How Do I Create/Fix My Code For Collatz Conjecture Using A For Or While Loop?

I'm not sure what assume(x>0) has to do with anything, because you are working with the variable n. But why have you not just...

How Do I Create/Fix My Code For Collatz Conjecture Using A For Or While Loop?

I'm not sure what assume(x>0) has to do with anything, because you are working with the variable n. But why have you not just...

3 months ago | 0

Answered

Power function fitting with my data

Since you have not posted your data, it is difficult to help you very much. But... You can use polyfit to fit the linear curv...

Power function fitting with my data

Since you have not posted your data, it is difficult to help you very much. But... You can use polyfit to fit the linear curv...

3 months ago | 0

| accepted

Answered

ToolBox for Zernike polynomial surface_Fitting

You can find tools for evaluation of Zernike polynomials on the file exchange, here: <https://www.mathworks.com/matlabcentral...

ToolBox for Zernike polynomial surface_Fitting

You can find tools for evaluation of Zernike polynomials on the file exchange, here: <https://www.mathworks.com/matlabcentral...

3 months ago | 0

Answered

Integrating a curve fitted with Sgolay

1. You are not fitting your data using sgolayfilt. All that does is try to reduce the noise in the data, assuming the underlying...

Integrating a curve fitted with Sgolay

1. You are not fitting your data using sgolayfilt. All that does is try to reduce the noise in the data, assuming the underlying...

3 months ago | 0

Answered

How to create a symbolic expression with a string like '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1'?

str2sym( '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1') ans = 0.000000501*x2 - (9*x1 - 4)/x1 - 0.000000501

How to create a symbolic expression with a string like '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1'?

str2sym( '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1') ans = 0.000000501*x2 - (9*x1 - 4)/x1 - 0.000000501

3 months ago | 0

| accepted

Answered

Matlab 2018a with parallel computing too slow

Parallel computing need not always gain. Why not? Because MATLAB already automatically does some multi-threading when it thinks ...

Matlab 2018a with parallel computing too slow

Parallel computing need not always gain. Why not? Because MATLAB already automatically does some multi-threading when it thinks ...

3 months ago | 0

Answered

Why is ScatteredInterpolant (linear) returning a value far outside of input data?

You are making a major error here in what you are trying to do. plot3(inX,inY,inZ,'bo') box on grid on Now, rotate...

Why is ScatteredInterpolant (linear) returning a value far outside of input data?

You are making a major error here in what you are trying to do. plot3(inX,inY,inZ,'bo') box on grid on Now, rotate...

3 months ago | 1

| accepted

Answered

How to obtain integer solutions only with fsolve?

Far too late to answer this, but worth explaining how to solve it. Intlinprog, has been suggested is not a viable solution, b...

How to obtain integer solutions only with fsolve?

Far too late to answer this, but worth explaining how to solve it. Intlinprog, has been suggested is not a viable solution, b...

3 months ago | 0

| accepted

Answered

Numerical evaluation of integral gives warning message

Ignoring the fact that you cannot just factor out -1 from that term in the integral, and get what you think you got, we have the...

Numerical evaluation of integral gives warning message

Ignoring the fact that you cannot just factor out -1 from that term in the integral, and get what you think you got, we have the...

3 months ago | 0

Answered

First-order optimality of system of non-linear equations is not converging to 0

A basic presumption of fsolve is that the objective equations to be solved are continuous and differentiable. Your equations ALL...

First-order optimality of system of non-linear equations is not converging to 0

A basic presumption of fsolve is that the objective equations to be solved are continuous and differentiable. Your equations ALL...

3 months ago | 0

Answered

Functions vs scripts: speed

Option B is a REALLY bad programming style. It is slow, as you found out. It prevents MATLAB from optimizing your code for effic...

Functions vs scripts: speed

Option B is a REALLY bad programming style. It is slow, as you found out. It prevents MATLAB from optimizing your code for effic...

3 months ago | 2

Answered

Hot to create a matrix with elements which moves to right as row increases

There are MANY ways to solve this. I'm not at all sure what the final dimension of the matrix is expected to be. Is it 100x100? ...

Hot to create a matrix with elements which moves to right as row increases

There are MANY ways to solve this. I'm not at all sure what the final dimension of the matrix is expected to be. Is it 100x100? ...

3 months ago | 2

| accepted

Answered

Function of the interpolation function

Um, you said interpolation, but you never said what kind of interpolation was used. The crystal ball is very foggy today, so I a...

Function of the interpolation function

Um, you said interpolation, but you never said what kind of interpolation was used. The crystal ball is very foggy today, so I a...

3 months ago | 0

Answered

outputs of generated code are NAN

The crystal ball is so foggy today. Strange, because it is a nice, sunny day here. Sorry, but we cannot read your mind, nor c...

outputs of generated code are NAN

The crystal ball is so foggy today. Strange, because it is a nice, sunny day here. Sorry, but we cannot read your mind, nor c...

3 months ago | 0

Answered

Is it possible to partition a curve and fit it using different funtions

Yes. If you know what you are doing. But that means you need to learn about how to use piecewise functions. You need to learn ab...

Is it possible to partition a curve and fit it using different funtions

Yes. If you know what you are doing. But that means you need to learn about how to use piecewise functions. You need to learn ab...

3 months ago | 0

Answered

Hi.I have been trying a lot to "find" the answer. I still can not get it.

The error? Yours, in making an assumption about floating point arithmetic, and how numbers are stored. x1=(0:0.001:50 )'; ...

Hi.I have been trying a lot to "find" the answer. I still can not get it.

The error? Yours, in making an assumption about floating point arithmetic, and how numbers are stored. x1=(0:0.001:50 )'; ...

3 months ago | 0

Answered

Am I allowed to write functions that have names of matlab functions (copyright)?

I am not a lawyer. But I would argue that it is the code that matters, and the code that has a copyright, which will reside in t...

Am I allowed to write functions that have names of matlab functions (copyright)?

I am not a lawyer. But I would argue that it is the code that matters, and the code that has a copyright, which will reside in t...

3 months ago | 0

Answered

What's the difference between gammainc & igamma? Which one should I use to compute incomplete upper gamma function? Which one is scaled??

igamma lives in the stats toolbox. It gives you an upper tail integral. gammainc lives in MATLAB proper. gammainc is scaled. ...

What's the difference between gammainc & igamma? Which one should I use to compute incomplete upper gamma function? Which one is scaled??

igamma lives in the stats toolbox. It gives you an upper tail integral. gammainc lives in MATLAB proper. gammainc is scaled. ...

3 months ago | 2

| accepted