Answered

Golden Section Search algorithm, golden number why is 0.381

I think you need to spend some time in class listening, lol. Or, maybe your instructor did not explain this. It is very possible...

Golden Section Search algorithm, golden number why is 0.381

I think you need to spend some time in class listening, lol. Or, maybe your instructor did not explain this. It is very possible...

7 hours ago | 1

| accepted

Answered

"temp" was previously used as a variable, conflicting with its use here as the name of a function or command.

The MATLAB language does not include this syntax temp += 26 Just because it works in some other language, does not make it va...

"temp" was previously used as a variable, conflicting with its use here as the name of a function or command.

The MATLAB language does not include this syntax temp += 26 Just because it works in some other language, does not make it va...

17 hours ago | 0

| accepted

Answered

"Scattered Interpolant" produces invalid values

I can shed light on your problem. What you think of as extrapolation is different from the way scatteredInterpolant sees the con...

"Scattered Interpolant" produces invalid values

I can shed light on your problem. What you think of as extrapolation is different from the way scatteredInterpolant sees the con...

20 hours ago | 1

Answered

FZERO requires at least two input arguments

However you got the code you wrote, much of it is not valid syntax in MATLAB. This line, for example: fzero ltol = 10^-14; mid...

FZERO requires at least two input arguments

However you got the code you wrote, much of it is not valid syntax in MATLAB. This line, for example: fzero ltol = 10^-14; mid...

1 day ago | 0

| accepted

Answered

Contour plot ignores a set of data points

I've moved what was a comment into an answer, then added a bit... A very simple example of what I described is shown here: px ...

Contour plot ignores a set of data points

I've moved what was a comment into an answer, then added a bit... A very simple example of what I described is shown here: px ...

1 day ago | 1

| accepted

Answered

solve integral using ode45 (by derivative)

While what Ameer wrote looks like it will work, it still uses the dreaded & disallowed integral function. I'm adding this answer...

solve integral using ode45 (by derivative)

While what Ameer wrote looks like it will work, it still uses the dreaded & disallowed integral function. I'm adding this answer...

2 days ago | 1

| accepted

Answered

How can I PERMANENTLY change the path each time MATLAB is opened?

help savepath As well, if you were setting the path using pathtool, there is an option to SAVE the path. This leaves only the ...

How can I PERMANENTLY change the path each time MATLAB is opened?

help savepath As well, if you were setting the path using pathtool, there is an option to SAVE the path. This leaves only the ...

2 days ago | 0

Answered

Mean command gives wrong answer

No. the code gives the correct answer in terms of what you wrote. That the code you wrote does not solve the problem you want to...

Mean command gives wrong answer

No. the code gives the correct answer in terms of what you wrote. That the code you wrote does not solve the problem you want to...

2 days ago | 2

Answered

how to know if two lines are intersected ?

Just find the point where the lines are at their closest approach. If the point of closest approach is zero, they intersect. Gi...

how to know if two lines are intersected ?

Just find the point where the lines are at their closest approach. If the point of closest approach is zero, they intersect. Gi...

3 days ago | 1

| accepted

Answered

Finding zero crossing of equation

Are you trying to solve for a zero crossing of f(x)? if so, then computing the derivative is irrelevant, unless you might want t...

Finding zero crossing of equation

Are you trying to solve for a zero crossing of f(x)? if so, then computing the derivative is irrelevant, unless you might want t...

3 days ago | 0

Answered

Estimate best parameters using lscurvefit

You are getting lost and confused by the names x and y. They are irrelevant. You have 3 parameters. You have 5 data points, numb...

Estimate best parameters using lscurvefit

You are getting lost and confused by the names x and y. They are irrelevant. You have 3 parameters. You have 5 data points, numb...

3 days ago | 0

Answered

Scaling a vector-valued non-linear function-numerical optimization

To a large extent, I want to disagree with Michael in his recent comment, except that he is correct, in that a perusal of the gr...

Scaling a vector-valued non-linear function-numerical optimization

To a large extent, I want to disagree with Michael in his recent comment, except that he is correct, in that a perusal of the gr...

3 days ago | 0

Answered

FMINCON Linear Constraint Strictly Greater/Less Than

You cannot easily do so. fmincon assumes that the constraints do allow the bounds as possibilities. In fact, fmincon allows the ...

FMINCON Linear Constraint Strictly Greater/Less Than

You cannot easily do so. fmincon assumes that the constraints do allow the bounds as possibilities. In fact, fmincon allows the ...

3 days ago | 0

Answered

Generating random Gamma distribution

The trick is to understand how a transformation can solve the problem. This is a standard way to produce random numbers with som...

Generating random Gamma distribution

The trick is to understand how a transformation can solve the problem. This is a standard way to produce random numbers with som...

5 days ago | 0

Answered

can't plot exp * sin graph

Your problem lies in not understanding the difference between the .* and * operators. (In fact, this was probably why you were a...

can't plot exp * sin graph

Your problem lies in not understanding the difference between the .* and * operators. (In fact, this was probably why you were a...

5 days ago | 2

| accepted

Answered

whats wrong with my code

I wouldstart by saying this is not how you define a function. function fact[a,b,c]=my_fact(x) That is not valid syntax to defi...

whats wrong with my code

I wouldstart by saying this is not how you define a function. function fact[a,b,c]=my_fact(x) That is not valid syntax to defi...

6 days ago | 0

Answered

Simple Code working in the Command Line but not through function

You change grad inside nnCostFunction. But do you RETURN grad? No. What arguments do you return? J = nnCostFunction(nn_params, ...

Simple Code working in the Command Line but not through function

You change grad inside nnCostFunction. But do you RETURN grad? No. What arguments do you return? J = nnCostFunction(nn_params, ...

6 days ago | 0

Answered

Im trying to solve an equation that have variable on left and right side

How is depth relevant to anything here? It does not appear in the expression. Maybe I'm just not thinking very "deeply" today. ...

Im trying to solve an equation that have variable on left and right side

How is depth relevant to anything here? It does not appear in the expression. Maybe I'm just not thinking very "deeply" today. ...

6 days ago | 0

| accepted

Answered

How do I solve this equation?

I've added a separate answer here only to explain how you would have used dsolve, and then how you would plot the solution. You...

How do I solve this equation?

I've added a separate answer here only to explain how you would have used dsolve, and then how you would plot the solution. You...

6 days ago | 0

| accepted

Answered

Local Minimum possible - exit flag 2 - Non linear optimisation problem with Non-linear constraints.

Setting the tolerances to some absurdly tiny number is something I frequently see people do. It almost never seems to improve th...

Local Minimum possible - exit flag 2 - Non linear optimisation problem with Non-linear constraints.

Setting the tolerances to some absurdly tiny number is something I frequently see people do. It almost never seems to improve th...

6 days ago | 1

Answered

Explicit solution using Syms tool box

You WANT to find a solution to a general 12'th degree polynomial. There are things I want, but cannot have either. In this case...

Explicit solution using Syms tool box

You WANT to find a solution to a general 12'th degree polynomial. There are things I want, but cannot have either. In this case...

7 days ago | 0

Answered

Generate a vector under norm condition

As long as you are willing to specify that the vector is normally distributed under a constraint, you can do this. In fact, it i...

Generate a vector under norm condition

As long as you are willing to specify that the vector is normally distributed under a constraint, you can do this. In fact, it i...

7 days ago | 1

Answered

Creating 3d surfaces from two independent functions

Why is this not just f3 = @(x,y) min(f1(x,y),f2(x,y)); You want the result which is the smaller of two functions. In your ex...

Creating 3d surfaces from two independent functions

Why is this not just f3 = @(x,y) min(f1(x,y),f2(x,y)); You want the result which is the smaller of two functions. In your ex...

7 days ago | 0

| accepted

Answered

I can't solve this nonlinear equation

You have too many equations, too few unknowns. 8 equations, with 9 unknowns. This is often called an under-determined problem. ...

I can't solve this nonlinear equation

You have too many equations, too few unknowns. 8 equations, with 9 unknowns. This is often called an under-determined problem. ...

7 days ago | 0

| accepted

Answered

Doesn't calculate the integral (only int sign is added)

Actually, Wolfram Alpha got this one with no help. But sometime you need to do a little extra. The obvious thing I would try is ...

Doesn't calculate the integral (only int sign is added)

Actually, Wolfram Alpha got this one with no help. But sometime you need to do a little extra. The obvious thing I would try is ...

8 days ago | 0

| accepted

Answered

Stepsize in integral2 or quad2d

integral (as with integral2) does not have a "stepsize". As an adaptive code, it looks at the local shape of the function, in th...

Stepsize in integral2 or quad2d

integral (as with integral2) does not have a "stepsize". As an adaptive code, it looks at the local shape of the function, in th...

8 days ago | 0

| accepted

Answered

Plotting functions with removable singularities

I can't really think of anything obviously easy. I might do it like this: F = @(x) x + 3; fplot(F,[-3,3],'m') hold on H1...

Plotting functions with removable singularities

I can't really think of anything obviously easy. I might do it like this: F = @(x) x + 3; fplot(F,[-3,3],'m') hold on H1...

8 days ago | 1

| accepted

Answered

Research program support MathWorks

You may be confused. MathWorks is not here as a service company, where they will write software to your specs to accomplish you...

Research program support MathWorks

You may be confused. MathWorks is not here as a service company, where they will write software to your specs to accomplish you...

8 days ago | 0

Answered

Please check if I have wrote the functions correctly:

There are three issues that you have problems on here, although only one of them may be perceived as significant. The important...

Please check if I have wrote the functions correctly:

There are three issues that you have problems on here, although only one of them may be perceived as significant. The important...

8 days ago | 0

| accepted

Answered

Curve Fitting Weibull error

We are given not much more than this: fun = @(P,x)(-P(1)/P(2)).*(((x-P(3))/P(2)).^(P(1)-1)).*exp(-((x-P(3))/n).^P(1)); fun is ...

Curve Fitting Weibull error

We are given not much more than this: fun = @(P,x)(-P(1)/P(2)).*(((x-P(3))/P(2)).^(P(1)-1)).*exp(-((x-P(3))/n).^P(1)); fun is ...

9 days ago | 0

| accepted