Answered

Numerically solve differential equation

This is just a parabolic PDE, assuming that Bi is a KNOWN constant. You just say it is constant. But you should be able to use ...

Numerically solve differential equation

This is just a parabolic PDE, assuming that Bi is a KNOWN constant. You just say it is constant. But you should be able to use ...

23 hours ago | 0

Answered

3D best fit curve from x,y and z data points

You may think it is easy, if only you can find someone who has the magic touch. Sorry, but not so easy. If the curve is presum...

3D best fit curve from x,y and z data points

You may think it is easy, if only you can find someone who has the magic touch. Sorry, but not so easy. If the curve is presum...

2 days ago | 1

Answered

HOW TO GET THE VALUES OF CONSTANTS

Please don't YELL! Next, NEVER define pi. pi already exists, and I hate to tell you, it ain't 3.14. That only happens in certai...

HOW TO GET THE VALUES OF CONSTANTS

Please don't YELL! Next, NEVER define pi. pi already exists, and I hate to tell you, it ain't 3.14. That only happens in certai...

2 days ago | 0

Answered

Code help on Euler's method

What you need to understand is that Euler is a poor method to use. Easy to write, easy to understand. But is it good? NO. And th...

Code help on Euler's method

What you need to understand is that Euler is a poor method to use. Easy to write, easy to understand. But is it good? NO. And th...

4 days ago | 2

| accepted

Answered

Can I change a 3-tensor into a matrix by indexing with a matrix?

A = randn(4,4,3) % Not very creative in making up numbers. So sue me. :) [~,I] = min(abs(A),[],3) What is I? For every combina...

Can I change a 3-tensor into a matrix by indexing with a matrix?

A = randn(4,4,3) % Not very creative in making up numbers. So sue me. :) [~,I] = min(abs(A),[],3) What is I? For every combina...

4 days ago | 1

| accepted

Answered

Newton Raphson Method not solving

This answer is here just to add some information. I try to teach that one should always plot everything, then look at what they ...

Newton Raphson Method not solving

This answer is here just to add some information. I try to teach that one should always plot everything, then look at what they ...

5 days ago | 0

Answered

How do I fit along the curve.

Why would there be code written to do something completely strange? Well, perhaps I should not call it strange, but your idea of...

How do I fit along the curve.

Why would there be code written to do something completely strange? Well, perhaps I should not call it strange, but your idea of...

5 days ago | 0

Answered

Interpolation error for one column increasing and one column decreasing

This is impossible to answer, since what you show is clearly not what you have. The error that is given indicates the vector (x...

Interpolation error for one column increasing and one column decreasing

This is impossible to answer, since what you show is clearly not what you have. The error that is given indicates the vector (x...

6 days ago | 1

Answered

How can I test a long function in Matlab?

Don't test your long function. Because you should be writing SHORT functions. Then you can test each piece, verify it works as d...

How can I test a long function in Matlab?

Don't test your long function. Because you should be writing SHORT functions. Then you can test each piece, verify it works as d...

6 days ago | 0

Answered

Simple limit returning NaN: f(x) = exp(-1/x)

Think of it like this. For a limit to exist at x==0, it MUST have the same limit as x approaches 0 from above, as it does when x...

Simple limit returning NaN: f(x) = exp(-1/x)

Think of it like this. For a limit to exist at x==0, it MUST have the same limit as x approaches 0 from above, as it does when x...

6 days ago | 1

| accepted

Answered

Continuity of a function in a interval

It may seem basic to you. However, that just means you need to understand computing and floating point arithmetic. Nope. In fac...

Continuity of a function in a interval

It may seem basic to you. However, that just means you need to understand computing and floating point arithmetic. Nope. In fac...

7 days ago | 0

Answered

How to stop MATLAB from opening every time I switch on my computer?

This is not MATLAB that is your problem, but your MAC, and what you apparently told it to do. :) You have MATLAB set as a start...

How to stop MATLAB from opening every time I switch on my computer?

This is not MATLAB that is your problem, but your MAC, and what you apparently told it to do. :) You have MATLAB set as a start...

7 days ago | 0

Answered

understanding "<" operator line

In order to understand this, I'd STRONGLY recommend you do the MATLAB Onramp tutorials. Try some examples. Look at what happens!...

understanding "<" operator line

In order to understand this, I'd STRONGLY recommend you do the MATLAB Onramp tutorials. Try some examples. Look at what happens!...

8 days ago | 0

| accepted

Answered

Logical indexing of table failing

No. You do NOT know it contains 0.35. In fact, MATLAB cannot represent 0.35 exactly in floating point arithmetic. This is for th...

Logical indexing of table failing

No. You do NOT know it contains 0.35. In fact, MATLAB cannot represent 0.35 exactly in floating point arithmetic. This is for th...

8 days ago | 0

Answered

Summing using simspons rule for a given range

If I might suggest, your goal is actively a poor one. Why? Simpson's rule is a higher order rule. It tries to give you a higher...

Summing using simspons rule for a given range

If I might suggest, your goal is actively a poor one. Why? Simpson's rule is a higher order rule. It tries to give you a higher...

9 days ago | 0

Answered

Successive over-relaxation of Laplace equation is converging to slightly wrong value. Floating-point error or code error?

To understand what is happening, you need to first understand what the equations represent! Is this effectively a partial diffe...

Successive over-relaxation of Laplace equation is converging to slightly wrong value. Floating-point error or code error?

To understand what is happening, you need to first understand what the equations represent! Is this effectively a partial diffe...

9 days ago | 0

Answered

How can I find the eigenvalues of an n-by-n matrix using For Loops?

Simpler than what Matt has suggested is to just use matrix multiplication, coupled with deflation. That is, can you find the LA...

How can I find the eigenvalues of an n-by-n matrix using For Loops?

Simpler than what Matt has suggested is to just use matrix multiplication, coupled with deflation. That is, can you find the LA...

10 days ago | 0

Answered

Linear approximation of data set's points.

Don't do it that way!!!!!!! You cannot achieve a continuous piecewise linear function that way. Instead, use a tool designed to ...

Linear approximation of data set's points.

Don't do it that way!!!!!!! You cannot achieve a continuous piecewise linear function that way. Instead, use a tool designed to ...

10 days ago | 1

Answered

Matlab integration of numerical data

In order for it to be truly general, you will need to interpolate the "function". For example, we might do this: x = 0:10; y =...

Matlab integration of numerical data

In order for it to be truly general, you will need to interpolate the "function". For example, we might do this: x = 0:10; y =...

10 days ago | 0

Answered

How to select complementary elements from a vector?

d = [3 2 1 5 6 7 8 9 0]; I = [1 3 7]; setdiff(d,I) Note that your example is actually incorrect, in that you claim 7 should...

How to select complementary elements from a vector?

d = [3 2 1 5 6 7 8 9 0]; I = [1 3 7]; setdiff(d,I) Note that your example is actually incorrect, in that you claim 7 should...

11 days ago | 0

Answered

Applying Newton's Method to Sound Level Equation

Since we cannot solve it directly.... Are you absolutely positive of that? L0 = 80; beta = 32.2; L = 20; syms r solve(L0...

Applying Newton's Method to Sound Level Equation

Since we cannot solve it directly.... Are you absolutely positive of that? L0 = 80; beta = 32.2; L = 20; syms r solve(L0...

12 days ago | 0

Answered

Output all possible results on a 7 equation system

First, it can be proven that not all mathematical equations of this sort can be "solved". This goes back as far as Abel-Ruffini....

Output all possible results on a 7 equation system

First, it can be proven that not all mathematical equations of this sort can be "solved". This goes back as far as Abel-Ruffini....

12 days ago | 1

| accepted

Answered

solving equations with trigonometric functions

Note that x1, x2, x5, x6 are just NUMBERS. Defining them as syms in advance does nothing. MATLAB is a language with dynamic vari...

solving equations with trigonometric functions

Note that x1, x2, x5, x6 are just NUMBERS. Defining them as syms in advance does nothing. MATLAB is a language with dynamic vari...

12 days ago | 1

| accepted

Answered

error in matrix multiplication while solving system of differential equations

What you do not understand is that the exponential function is exp. Thus, instead of writing e^(-t), you write exp(-t). Next, y...

error in matrix multiplication while solving system of differential equations

What you do not understand is that the exponential function is exp. Thus, instead of writing e^(-t), you write exp(-t). Next, y...

12 days ago | 0

Answered

How to solve an optimization problem over two variables using fmincon?

You CANNOT use fmincon on a problem with binary variables or any form of discrete variables. However, IF y is indeed binary, th...

How to solve an optimization problem over two variables using fmincon?

You CANNOT use fmincon on a problem with binary variables or any form of discrete variables. However, IF y is indeed binary, th...

13 days ago | 0

Answered

Equation to Matlab code

ALWAYS show what you wrote. Ony you know what you mean by dealing with vectors, etc. In the first case, do you have a vector of ...

Equation to Matlab code

ALWAYS show what you wrote. Ony you know what you mean by dealing with vectors, etc. In the first case, do you have a vector of ...

13 days ago | 0

| accepted

Answered

How to calculate partial area-under-the-curve?

After all of those comments, to be honest, sorry, but you were both working far too hard on a moderately simple problem. Simpl...

How to calculate partial area-under-the-curve?

After all of those comments, to be honest, sorry, but you were both working far too hard on a moderately simple problem. Simpl...

14 days ago | 0

Answered

How to call fminsearch on my function

Um, you misunderstand the problem. Your function has TWO arguments. PR and PC, both of which you want to be optimized. And while...

How to call fminsearch on my function

Um, you misunderstand the problem. Your function has TWO arguments. PR and PC, both of which you want to be optimized. And while...

15 days ago | 0

Answered

Uniform Random Variable PDF

What are you doing wrong? Um, pretty much everything? Sorry, but true. ;) However, you do seem to have made some credible effort...

Uniform Random Variable PDF

What are you doing wrong? Um, pretty much everything? Sorry, but true. ;) However, you do seem to have made some credible effort...

15 days ago | 0

Answered

Solving Exponencial fuction is not returning the right answer

Yes, you THINK the true answer is 3. But it is not. format long g log(2653/2500) / log(51/50) And that is effectively the exa...

Solving Exponencial fuction is not returning the right answer

Yes, you THINK the true answer is 3. But it is not. format long g log(2653/2500) / log(51/50) And that is effectively the exa...

16 days ago | 1

| accepted