Answered
Optimization: Capacitated Facility Location Problem
First, what is the difference between the summation over i in a sum like this: sum(f(i)*yi)) and the dot product of two ve...

4 years ago | 1

Answered
im trying to solve a system of 4 nonlinear equations with 4 unknowns
x = sym('x',[1,4]) eq1 = x(1)+.17*x(1)-x(2)-x(3)-x(4) == 0 eq2 = (((x(3)^(1/2))*x(4))/x(2))-.465797 == 0 eq3 = 2*x(1)-2*x(2)-...

4 years ago | 0

Answered
Another question on eliminating for loops....
Try it. If you can't see ndgrid doing it, then look harder. :) (By the way, lower case l (L) is a really bad variable name to us...

4 years ago | 0

| accepted

Answered
How to do piecewise linear approximation from x and y points?
x = [20 60 240 480 1440 2880]; y = [0.0278 0.1626 1.8126 4.006 18.2491 44.4084]; plot(x,y,'o-') You have only 6 data points...

4 years ago | 0

| accepted

Answered
How do I access an element of an array of equations
If x is symbolic, you CANNOT use it in a colon call. But in the end, you did not ask for a symbolic result, but a function of x....

4 years ago | 0

Answered
I want to build the square wave: build a 6 subplot figure to show the time domain, and use respectively 1, 3, 5, 10, 50, 500 frequencies.How can i achieve this?
Solve a problem that is too large for you to handle by breaking it up into small enough chunks to handle. Do you know how to u...

4 years ago | 0

Answered
How to get the numerical rank of the matrix in matlab?
To compute the numerical rank of a matrix, use rank. Surely that seems logical. And you even know about rank. Bu then you seem ...

4 years ago | 2

Answered
Function to solve an equation for a given variable
If it is symbolic problem, then it is trivial. Just assign those variables, subs them in, and use solve. WTP? If it is a numeri...

4 years ago | 0

| accepted

Answered
How to identify the infeasibility from the set of equality and inequality constraints
You have a scalar problem? But then, you have TWO equality constraints? So a solution will exist only if BOTH equalities are s...

4 years ago | 0

Answered
I wanna make a .mat file
help save

4 years ago | 0

Answered
Problém with graph of implicit function
If you change the value of a, then the implicit function itself changes. So you MIGHT decide to use fimplicit3. But if you need...

4 years ago | 0

| accepted

Answered
degrees of freedom chi2inv
This really should be asked on a different forum, as only barely about MATLAB, and a good answer requires teaching a class in st...

4 years ago | 0

Answered
error with the trapmf function
You wrote this: x1 = 0:1:25; y1 = trapmf(x, [0 5 15 25]) ; So you created the variable x1. Then you called the function trapm...

4 years ago | 1

| accepted

Answered
How to determine the relationship between two variables from a plotted graph
Walter is correct in everything said. My answer here is just to expand. Once something becomes no longer linear, what is it? F...

4 years ago | 0

Answered
Power method to determine largest eigenvalue and corresponding eigenvector had some wrong
I would claim you have two problems here. One is a pretty common mistake, the other more subtle. Do you understand that eig nor...

4 years ago | 0

| accepted

Answered
Magnitude of cross product
syms theta phi r = [2.*sin(phi).*cos(theta) 2.*sin(phi).*sin(theta) 2.*cos(phi)]; P=diff(r,theta); R=diff(r,phi); C = cross(...

4 years ago | 0

Answered
Trouble plottiing a trig function
Ok. You knew you had to use the .^ operator to raise the elements to a power, element-wise. There are also .* and ./ operators, ...

4 years ago | 2

| accepted

Answered
how to make a 3x3 matrix a 9x1 matrix?
The point to the answers you have gotten is if you want it to run across columns, then you can easily convert columns into rows,...

4 years ago | 1

Answered
RREF with unknown variables
WTP? Why not try it? syms a b c rref([1, 2, 3, a; 4, 5, 6, b; 7, 8, 9, c])

4 years ago | 1

Answered
Various functions depending on X
If the function is symbolic, then use piecewise. help piecewise Note that your function lacks definition, since you do not say...

4 years ago | 0

Answered
How can I fix my issue with regstats "design matrix has more predictor variables than observations"?
Get more data. Simple enough. Supose you want to fit a very simple linear model with say three independent variables. With a co...

4 years ago | 0

Answered
How to derive a function from 6 variables
Knowing which function to use, given 6 independent variables is terribly difficult to know. If you lack knowledge of a good nonl...

4 years ago | 0

| accepted

Answered
how to pass from x y z plane to toroidal coordinate?
You have a line in three dimensionas, and you want to find the equation of that line in a toroidal coordinate system? First, wh...

4 years ago | 0

Answered
Singular value decomposition method for solving least squares problems
Please stop asking this same question multiple times. If you are asking how to solve a least squares problem of the form A*x = ...

4 years ago | 0

Answered
Finding unknow of equation
I'll use syms here, because it displays things nicely. syms x y a b c d B=[0;0;x;0;0;y] C=[a;b;0;c;d;-2000] So B and C are V...

4 years ago | 0

Answered
Am I writing this exponential function the right way?
You need to learn about the dotted operators. They are used when you will be performing ELEMENT-wise squaring, multiplications, ...

4 years ago | 1

Answered
Interpolate Scattered Data on another mesh
But what is the problem? Using scatteredInterpolant, interpolate set 2 (x,y,z) using the data for set 1. Some of the points fr...

4 years ago | 0

| accepted

Answered
I want to solve this equation for Xp while I know all others parameters.
In almost all cases when you have a variable that lies both inside, and outside of a nonlinear function, like sin or cos, log an...

4 years ago | 0

Answered
MATLAB can't symbolically solve a definite integration
Not all problems you can write down have some nuce simple algebraic solution. In fact, almost all problems you can write down do...

4 years ago | 0

Answered
Best Practice: Many Functions relying on Global Variables?
By far the simplest is to just stuff all of your variables into one struct. then pass it around to anything that will need it. T...

4 years ago | 3

Load more