Answered

Euler's Method and exact solution plot

Sorry, but your code is wrong (so is your exact solution.) Why? Look at what you wrote. h=0.05; % time step t=...

Euler's Method and exact solution plot

Sorry, but your code is wrong (so is your exact solution.) Why? Look at what you wrote. h=0.05; % time step t=...

1 day ago | 1

Answered

MATLAB cannot integrate trigonometry in the form of degree

I think you do not understand integration, IF your expectation really is the two should be the same. That is, you think the inte...

MATLAB cannot integrate trigonometry in the form of degree

I think you do not understand integration, IF your expectation really is the two should be the same. That is, you think the inte...

2 days ago | 1

Answered

how to plot a function symbolically?

You have the relationship z(r) = H - C^2/(2*g*r^2) If H and C are not known, with g fixed at 9.8, then they make this in...

how to plot a function symbolically?

You have the relationship z(r) = H - C^2/(2*g*r^2) If H and C are not known, with g fixed at 9.8, then they make this in...

2 days ago | 0

Answered

Query regarding finding the index which will give 90% of the total area under the curve

No. You found some approximations of the area, using either trapz or polyarea. In both cases, they produced what is a trapezoida...

Query regarding finding the index which will give 90% of the total area under the curve

No. You found some approximations of the area, using either trapz or polyarea. In both cases, they produced what is a trapezoida...

2 days ago | 1

Answered

fit these curves and what type of fit they are?

Your data is noisy. There is NO specific function that describes the data. It is NOT truly linear. It is NOT truly exponential, ...

fit these curves and what type of fit they are?

Your data is noisy. There is NO specific function that describes the data. It is NOT truly linear. It is NOT truly exponential, ...

2 days ago | 0

| accepted

Answered

I want to set a range of variable to three or four places of decimals

Are you asking to create a variable that only carries 3 or 4 digits of precision? You can't choose to set an arbitrary precision...

I want to set a range of variable to three or four places of decimals

Are you asking to create a variable that only carries 3 or 4 digits of precision? You can't choose to set an arbitrary precision...

2 days ago | 0

Answered

atan2 not consisent

What you don't understand is that just because MATLAB displays a number represented to 15 digits, does not mean it is EXACTLY th...

atan2 not consisent

What you don't understand is that just because MATLAB displays a number represented to 15 digits, does not mean it is EXACTLY th...

3 days ago | 0

Answered

Error using ==> asind Argument should be real.

So what is the problem? It seems the error message states exactly what happened, and why MATLAB sees a problem. Honestly, it ju...

Error using ==> asind Argument should be real.

So what is the problem? It seems the error message states exactly what happened, and why MATLAB sees a problem. Honestly, it ju...

4 days ago | 1

| accepted

Answered

how do I right x^2 in MATLAB

Is x a scalar? If so, then you write it as x^2. Is x a vector? Then, assuming you want to perform an element-wise squaring, yo...

how do I right x^2 in MATLAB

Is x a scalar? If so, then you write it as x^2. Is x a vector? Then, assuming you want to perform an element-wise squaring, yo...

5 days ago | 0

| accepted

Answered

4D Interpolation scattered Data

Sorry, but you cannot use tools like griddata or scatteredInterpolant to interpolate non-single valued relations. It seems all y...

4D Interpolation scattered Data

Sorry, but you cannot use tools like griddata or scatteredInterpolant to interpolate non-single valued relations. It seems all y...

5 days ago | 0

Answered

How to draw a 3D circle that is tangent to two lines

First, if the lines are in the same plane, then you can pretend this is a problem in 2-dimensions. You can always rotate everyth...

How to draw a 3D circle that is tangent to two lines

First, if the lines are in the same plane, then you can pretend this is a problem in 2-dimensions. You can always rotate everyth...

5 days ago | 0

| accepted

Answered

Determinant of a unitary matrix

Gosh. I wonder, if there were really much better ways to compute the determinant, they might have used it? ;-) There are no spe...

Determinant of a unitary matrix

Gosh. I wonder, if there were really much better ways to compute the determinant, they might have used it? ;-) There are no spe...

5 days ago | 0

| accepted

Answered

How to remove duplicates from a matrix without using unique?

How could you use the output of a sort to help? Why not make an effort?

How to remove duplicates from a matrix without using unique?

How could you use the output of a sort to help? Why not make an effort?

5 days ago | 1

Answered

Can anyone tell what is this line doing

You asked again, why you cannot use f(1,3), instead of f(1,2). LOOK CAREFULLY AT WHAT YOU HAVE. TAKE IT ONE STEP AT A TIME. f...

Can anyone tell what is this line doing

You asked again, why you cannot use f(1,3), instead of f(1,2). LOOK CAREFULLY AT WHAT YOU HAVE. TAKE IT ONE STEP AT A TIME. f...

5 days ago | 0

| accepted

Answered

Create Random Points in Elliptical Belt

If you already know how to generate random points uniformly over an elliptical region, then you already have the simple answer. ...

Create Random Points in Elliptical Belt

If you already know how to generate random points uniformly over an elliptical region, then you already have the simple answer. ...

5 days ago | 0

| accepted

Answered

Exponential distributed random values

You need to do that since your exponential rate parameter varies. If it were constant, this would not be necessary. The first a...

Exponential distributed random values

You need to do that since your exponential rate parameter varies. If it were constant, this would not be necessary. The first a...

5 days ago | 0

| accepted

Answered

How can I solve the determinant of large-sized symbolic matrix: det(A)=0?

First, you don't want to solve for a zero determinant! Period. This will never be a well-posed problem, simply because we can tr...

How can I solve the determinant of large-sized symbolic matrix: det(A)=0?

First, you don't want to solve for a zero determinant! Period. This will never be a well-posed problem, simply because we can tr...

6 days ago | 0

| accepted

Answered

Composite Simpson's 1/3 rule code error

Tell me, what is fx? fx is NOT a function. It is a scalar, vector, or array. Whatever x was, fx is the same thing. If it NOT a ...

Composite Simpson's 1/3 rule code error

Tell me, what is fx? fx is NOT a function. It is a scalar, vector, or array. Whatever x was, fx is the same thing. If it NOT a ...

6 days ago | 0

Answered

excluding a small combinations from a combination?

There are not that many combinations that include the subset [2 4 6] out of nchoosek(1:10,4). This means the oversampling will n...

excluding a small combinations from a combination?

There are not that many combinations that include the subset [2 4 6] out of nchoosek(1:10,4). This means the oversampling will n...

7 days ago | 0

Answered

How to plot a complex function in matlab like : f(z)=sin(z)?

The problem is, if z is a complex variable, then so is the extension of sin(z) into the complex plane. For example... sin(1 + i...

How to plot a complex function in matlab like : f(z)=sin(z)?

The problem is, if z is a complex variable, then so is the extension of sin(z) into the complex plane. For example... sin(1 + i...

7 days ago | 1

Answered

Integration of a function

It can be confusing at times I have seen for newcomers to know which tools apply where, because we have symbolic tools and numer...

Integration of a function

It can be confusing at times I have seen for newcomers to know which tools apply where, because we have symbolic tools and numer...

7 days ago | 0

| accepted

Answered

what does this line do

It does nothing on its own. A single line of code has little meaning, out of context. What does it do? It sets some elements o...

what does this line do

It does nothing on its own. A single line of code has little meaning, out of context. What does it do? It sets some elements o...

7 days ago | 0

Answered

Matlab solver for natural log equation

Does a solution near(er) to zero exist? PLOT IT!!!!!! syms x f = (-27109/x)-0.95*log(x)+25.18 - log(0.5); fplot(f,[10,1000]) ...

Matlab solver for natural log equation

Does a solution near(er) to zero exist? PLOT IT!!!!!! syms x f = (-27109/x)-0.95*log(x)+25.18 - log(0.5); fplot(f,[10,1000]) ...

8 days ago | 0

| accepted

Answered

Is NaN ok here?

Sure. It does not bother me. Why does it bother you? B = [1.66000000e-01 6.60000000e-02 1.40000000e-02 3.90000000e-02 1.4000000...

Is NaN ok here?

Sure. It does not bother me. Why does it bother you? B = [1.66000000e-01 6.60000000e-02 1.40000000e-02 3.90000000e-02 1.4000000...

8 days ago | 0

| accepted

Answered

Gaussian Quadrature Error Help

I think you misiunderstand Gaussian quadrature. You claim to have 4 points. WRONG. You have TWO points in x, and TWO in y, the...

Gaussian Quadrature Error Help

I think you misiunderstand Gaussian quadrature. You claim to have 4 points. WRONG. You have TWO points in x, and TWO in y, the...

9 days ago | 1

| accepted

Answered

Tic, Toc Behavior

Using tic and toc to masure any time is a bad idea. Using tic and toc to masure any time is a bad idea. Using tic and toc to m...

Tic, Toc Behavior

Using tic and toc to masure any time is a bad idea. Using tic and toc to masure any time is a bad idea. Using tic and toc to m...

9 days ago | 1

Answered

What does squeeze() do in MATLAB?

Squeeze is a useful tool to help compress dimensions of a multidimensional array when you have performed some operations. Let me...

What does squeeze() do in MATLAB?

Squeeze is a useful tool to help compress dimensions of a multidimensional array when you have performed some operations. Let me...

9 days ago | 1

| accepted

Answered

Solve as Optimization Problem in Matlab

In MATLAB, the solution is intlinprog. Of course, there may be multiple solutions. intlinprog does not give them, if any could e...

Solve as Optimization Problem in Matlab

In MATLAB, the solution is intlinprog. Of course, there may be multiple solutions. intlinprog does not give them, if any could e...

10 days ago | 0

Answered

Matrix multiplication from the right with inverse matrix

a is a 3x2 matrix. No matter what, you cannot compute the inverse of a, so U=R*A^-1 is meaningless. I assume you want to sol...

Matrix multiplication from the right with inverse matrix

a is a 3x2 matrix. No matter what, you cannot compute the inverse of a, so U=R*A^-1 is meaningless. I assume you want to sol...

10 days ago | 0