Answered

Why doesn't my script work? It comes back with Error: File: equTriPrismSurfArea.m Line: 6 Column: 1 This statement is not inside any function.

READ THE CODE YOU WROTE. function [SA]=equTriPrismSurfArea(s,h) SA=((sqrt(3)/2)*(s^2))+(3*s*h); end s = [1 2 3 4 5]; ...

Why doesn't my script work? It comes back with Error: File: equTriPrismSurfArea.m Line: 6 Column: 1 This statement is not inside any function.

READ THE CODE YOU WROTE. function [SA]=equTriPrismSurfArea(s,h) SA=((sqrt(3)/2)*(s^2))+(3*s*h); end s = [1 2 3 4 5]; ...

18 days ago | 0

| accepted

Answered

symbolic calculation for series

But you defined U as a double precision array! See the difference. V = zeros(5) Note that zeros(5) creates a 5x5 array. If you...

symbolic calculation for series

But you defined U as a double precision array! See the difference. V = zeros(5) Note that zeros(5) creates a 5x5 array. If you...

19 days ago | 1

Answered

What is a symbolic expression (syms) and how do I use this when doing differentiation in matlab?

No. You misunderstand what diff does, and why diff is used there. diff, when applied to a numeric vector, forms the difference ...

What is a symbolic expression (syms) and how do I use this when doing differentiation in matlab?

No. You misunderstand what diff does, and why diff is used there. diff, when applied to a numeric vector, forms the difference ...

19 days ago | 0

Answered

How to plot a multivariable function with constraints

Can you solve for y, as a function of k, given the constraint? (YES.) If so, then do you really have a TWO variable problem? (N...

How to plot a multivariable function with constraints

Can you solve for y, as a function of k, given the constraint? (YES.) If so, then do you really have a TWO variable problem? (N...

19 days ago | 1

Answered

How to remove outliers and smooth the complex signals?

Is it valid to work with the real and imaginary parts separately? Possibly, though you know the data better than we do. What cau...

How to remove outliers and smooth the complex signals?

Is it valid to work with the real and imaginary parts separately? Possibly, though you know the data better than we do. What cau...

20 days ago | 0

Answered

Why do I receive Index exceeds the number of array elements (1)?

You would be best served to learn to use the debugger. But I can see what happens. At the first iteration, i = 1. And all of yo...

Why do I receive Index exceeds the number of array elements (1)?

You would be best served to learn to use the debugger. But I can see what happens. At the first iteration, i = 1. And all of yo...

22 days ago | 2

Answered

How to write following equation with "dsolve" command?

Oh well. My fault, as i saw this question posted just before I went to bed last night. No rest for the weary. :) But we can at l...

How to write following equation with "dsolve" command?

Oh well. My fault, as i saw this question posted just before I went to bed last night. No rest for the weary. :) But we can at l...

22 days ago | 1

Answered

how to evaluate integral for given input function ?

No, you don't want to fit a polynomial to that vector. Polynomials are just bad news for anything. After seeing the your pictur...

how to evaluate integral for given input function ?

No, you don't want to fit a polynomial to that vector. Polynomials are just bad news for anything. After seeing the your pictur...

23 days ago | 1

| accepted

Answered

What determines computation speed in MatLab?

What determines computation speed? A huge number of things. Try running bench on your computer. It looks at a many computations...

What determines computation speed in MatLab?

What determines computation speed? A huge number of things. Try running bench on your computer. It looks at a many computations...

23 days ago | 0

| accepted

Answered

Matrix 'if' statement

One thing that new users of MATLAB mistake, is they want an if statement to apply to every element of a matrix or vector. For e...

Matrix 'if' statement

One thing that new users of MATLAB mistake, is they want an if statement to apply to every element of a matrix or vector. For e...

23 days ago | 1

Answered

Plot with varying variable in optimization

You want to vary q, and for every value of q, get a corresponding value for K? w=2; y=10 q=0.5:1.5 % here q is the varing var...

Plot with varying variable in optimization

You want to vary q, and for every value of q, get a corresponding value for K? w=2; y=10 q=0.5:1.5 % here q is the varing var...

25 days ago | 0

| accepted

Answered

Non-linear system of inequalities

Start with, what can we do in symbolic form? syms S G real Eq(1) = G > 21; Eq(2) = S >= 15; Eq(3) = S <= 18; Eq(4) = 61 <...

Non-linear system of inequalities

Start with, what can we do in symbolic form? syms S G real Eq(1) = G > 21; Eq(2) = S >= 15; Eq(3) = S <= 18; Eq(4) = 61 <...

26 days ago | 1

| accepted

Answered

How do I find If one polygon is inside another?

There is a simple solution. It involves two tests, both of which are essentially vectorized. In fact, now that I think of it, th...

How do I find If one polygon is inside another?

There is a simple solution. It involves two tests, both of which are essentially vectorized. In fact, now that I think of it, th...

28 days ago | 0

Answered

How to display the nth term where the nth term is found by adding x number previous term?

Admit it. This is homework, since nobody would ask you to do this if it were not. And since it is homework, NOBODY should write ...

How to display the nth term where the nth term is found by adding x number previous term?

Admit it. This is homework, since nobody would ask you to do this if it were not. And since it is homework, NOBODY should write ...

28 days ago | 0

Answered

Integrating discrete values to determine the absolute value of displacement

Find any consecutive pair of points that change the sign of their velocity. Between such a pair, use (linear) interpolation to ...

Integrating discrete values to determine the absolute value of displacement

Find any consecutive pair of points that change the sign of their velocity. Between such a pair, use (linear) interpolation to ...

1 month ago | 1

| accepted

Answered

I want to loop an equation over multiple rows

Your problem is you want to write this as if you are still using Excel. MATLAB is not a spreadsheet, but you are still thinking ...

I want to loop an equation over multiple rows

Your problem is you want to write this as if you are still using Excel. MATLAB is not a spreadsheet, but you are still thinking ...

1 month ago | 0

| accepted

Answered

Intersection of Parametric Curves Using vpasolve

Your probem is when you zoomed in. The mathematics seems fine. >> tn tn = 11.4745470305524 >> un un = ...

Intersection of Parametric Curves Using vpasolve

Your probem is when you zoomed in. The mathematics seems fine. >> tn tn = 11.4745470305524 >> un un = ...

1 month ago | 1

| accepted

Answered

how can I solve this double integral?

Why does this look like homework? Why do you assume it has a finite solution? The integral over y is trivial. syms y phi K =...

how can I solve this double integral?

Why does this look like homework? Why do you assume it has a finite solution? The integral over y is trivial. syms y phi K =...

1 month ago | 0

| accepted

Answered

How can I speed up vpasolve?

Seriously, it has no solution? Gosh, am I surprised. So what does this do? syms z thetaz a = 1; b = 2; theta0 = 0; eqn = (a...

How can I speed up vpasolve?

Seriously, it has no solution? Gosh, am I surprised. So what does this do? syms z thetaz a = 1; b = 2; theta0 = 0; eqn = (a...

1 month ago | 0

| accepted

Answered

What does a=[b(90:end) b(1:89)] represent ?

You very clearly need to spend some time with a MATLAB manual or tutorial. You are asking a basic question, that would be covere...

What does a=[b(90:end) b(1:89)] represent ?

You very clearly need to spend some time with a MATLAB manual or tutorial. You are asking a basic question, that would be covere...

1 month ago | 0

Answered

Fit a transform to remove piecewise discontinuities

Honestly, I don't see the problem, at least if the discontinuity is as large as you show it. That will make it clear where the b...

Fit a transform to remove piecewise discontinuities

Honestly, I don't see the problem, at least if the discontinuity is as large as you show it. That will make it clear where the b...

1 month ago | 0

Answered

How to symbolically integrate f(T) = exp (E/(8.314*T) through integration by parts or with trapezoidal method?

It is simply not true that there is no UNIQUE solution. There is no EXACT, analytical solution that can be written in a simple a...

How to symbolically integrate f(T) = exp (E/(8.314*T) through integration by parts or with trapezoidal method?

It is simply not true that there is no UNIQUE solution. There is no EXACT, analytical solution that can be written in a simple a...

1 month ago | 0

| accepted

Answered

Is there anyway to Re-grid one dataset to another dataset resolution without interpolating??

What you are asking to do is arguably still "interpolation" of a sort. In fact, Walter''s use of nearest neighbor is quite reaso...

Is there anyway to Re-grid one dataset to another dataset resolution without interpolating??

What you are asking to do is arguably still "interpolation" of a sort. In fact, Walter''s use of nearest neighbor is quite reaso...

1 month ago | 0

Answered

cross multiplication of algebra expression denominators

syms x y a b k eq = y/a == k+x/b Symple enough. :) eq = expand(eq*a*b)

cross multiplication of algebra expression denominators

syms x y a b k eq = y/a == k+x/b Symple enough. :) eq = expand(eq*a*b)

2 months ago | 0

| accepted

Answered

Optimal values dynamic programming and mathematical programming

The crystal ball is very foggy today. What does it matter what we think? We know nothing about what you actually did, if the cod...

Optimal values dynamic programming and mathematical programming

The crystal ball is very foggy today. What does it matter what we think? We know nothing about what you actually did, if the cod...

2 months ago | 1

Answered

correlation of nonlinear variables

Correlation does not really make sense in respect to nonlinear variables. Depending on the values of the variables, they will be...

correlation of nonlinear variables

Correlation does not really make sense in respect to nonlinear variables. Depending on the values of the variables, they will be...

2 months ago | 0

Answered

Why does N-D convexhulln give a matrix as an output instead of vector containing indices of inputs?

The convex hull of a 2-d data set will be simply a polygon. So the convex hull code returns the set of points in the polygon, in...

Why does N-D convexhulln give a matrix as an output instead of vector containing indices of inputs?

The convex hull of a 2-d data set will be simply a polygon. So the convex hull code returns the set of points in the polygon, in...

2 months ago | 0

| accepted

Answered

Modification in besselk (Modified Bessel fn of 2nd kind order zero)

Simple answer - No. Utilities like this, erf is another excellent example, that while they can be defined in terms of an integr...

Modification in besselk (Modified Bessel fn of 2nd kind order zero)

Simple answer - No. Utilities like this, erf is another excellent example, that while they can be defined in terms of an integr...

2 months ago | 0

| accepted

Answered

I am trying to solve for w using determinants

Why do you think there is a problem. We can shorten the coefficients of Z a bit, just to look at what is happening. vpa(Z,3) a...

I am trying to solve for w using determinants

Why do you think there is a problem. We can shorten the coefficients of Z a bit, just to look at what is happening. vpa(Z,3) a...

2 months ago | 0

Answered

Is there a way to get the same results for linprog & fmincon given the same optimization problem?

Well, NO. You cannot insure exactly the same solution will arise from both solvers. I can think of several ways for the two solv...

Is there a way to get the same results for linprog & fmincon given the same optimization problem?

Well, NO. You cannot insure exactly the same solution will arise from both solvers. I can think of several ways for the two solv...

2 months ago | 1

| accepted