Answered

Find a value in a matrix

help max Look at the SECOND argument returned from max.

Find a value in a matrix

help max Look at the SECOND argument returned from max.

ungefär 21 timmar ago | 0

Answered

How to find solution using VPASOLVE

You have 2 variables, with 4 equations. vpasolve is NOT a tool that attmepts to solve a problem APPROXIMATELY. You cannot use vp...

How to find solution using VPASOLVE

You have 2 variables, with 4 equations. vpasolve is NOT a tool that attmepts to solve a problem APPROXIMATELY. You cannot use vp...

en dag ago | 0

Answered

how can I solve this problem..

Um, what do you expect? syms theta0 x=90; g=9.81; v0=30; y0=1.8; y=1; th = -y+tan(theta0)*x-g*x^2/(2*v0^2*cos(theta0)^2)+y0; ...

how can I solve this problem..

Um, what do you expect? syms theta0 x=90; g=9.81; v0=30; y0=1.8; y=1; th = -y+tan(theta0)*x-g*x^2/(2*v0^2*cos(theta0)^2)+y0; ...

en dag ago | 0

Answered

How to find the row and column for a value within a matrix [c] nearest or equal to 700.

Easy. And there would be many ways to do it. c = rand(5,5)*1000 [~,ind] = min(abs(c(:) - 700)) [rowind,colind] = ind2sub(size...

How to find the row and column for a value within a matrix [c] nearest or equal to 700.

Easy. And there would be many ways to do it. c = rand(5,5)*1000 [~,ind] = min(abs(c(:) - 700)) [rowind,colind] = ind2sub(size...

2 dagar ago | 0

| accepted

Answered

function for addition 2^16 modulo

Your numbers are in BINARY form, and you want to add modulo 2^16. The simplest solution is to convert to a decimal integer. I'l...

function for addition 2^16 modulo

Your numbers are in BINARY form, and you want to add modulo 2^16. The simplest solution is to convert to a decimal integer. I'l...

3 dagar ago | 0

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 ...

5 dagar 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...

6 dagar 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...

6 dagar 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...

8 dagar 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...

8 dagar 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 ...

9 dagar 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...

9 dagar 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...

10 dagar 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...

10 dagar 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...

10 dagar 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...

11 dagar 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...

11 dagar 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!...

12 dagar 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...

12 dagar 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...

13 dagar 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...

13 dagar 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...

14 dagar 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 ...

14 dagar 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 =...

14 dagar 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...

15 dagar 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...

15 dagar 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....

16 dagar 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...

16 dagar 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...

16 dagar 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...

17 dagar ago | 0