simpsons 1/3 rule calculating error
Before you worry about how to plot things, and compute the error, should you worry if your code is correct at all? Gosh, that ju...

10日 前 | 1

| 採用済み

How find the function (equation) of the fitting surface using interpolation (method biharmonic)?
This question is asked hundreds of times on the site. The answer is, there is no simple "equation" you can write down. That is t...

11日 前 | 1

What distribution is appropriate for my data?
Why would you expect a distribution like that, with a strange hump on one side to have some predefined distribution that fits it...

11日 前 | 0

Plot two functions in one diagramm with different y-axis limits
Easy peasy. x = linspace(-5,5,1000); y1 = sin(x); y2 = cos(x); y2(y2 > 0) = NaN; plot(x,y1,'b-',x,y2,'r-') ylim([-1,1]) y...

12日 前 | 1

| 採用済み

How to change Options of PSO during iterations?
Sorry, but no. You cannot change the options for a solver in the middle of the solve. This is essentially true for any solver. (...

12日 前 | 0

Solving Nonlinear System of Equations with 10 variables
Use fsolve. You are trying to formulate this in terrm of a symbolic variables, but fsolve is a NUMERICAL solver. So you need to ...

12日 前 | 0

i want to solve for 'L' using iteration method in MATLAB for the equation below
help fzero Consider that your question is the same as (gT^2)/(2*pi) tanh (2*pi*d/L) - L == 0

12日 前 | 0

How to find the maximum element by length without a loop?
I'm a bit confused as to your question. If you want to choose the longer of two strings, then do as @Florian Bidaud suggests. Bu...

12日 前 | 1

MatLab eig vs LAPACK
If I had to guess, you don't need to use it. A = randn(500); timeit(@() eig(A)) ans = 0.0800828164545 B = A + A'; timeit...

12日 前 | 0

| 採用済み

How to solve 'Equation solved at initial point' with fsolve?
As is often necessary on a problem like this, it helps to look carefully at what you have. x = sym('x',[1 2]); mu_earth = 39...

12日 前 | 0

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

12日 前 | 1

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

13日 前 | 0

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

13日 前 | 0

| 採用済み

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

14日 前 | 0

| 採用済み

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

14日 前 | 0

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

14日 前 | 0

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

14日 前 | 2

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

14日 前 | 0

| 採用済み

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

15日 前 | 0

I wanna make a .mat file
help save

15日 前 | 0

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

15日 前 | 0

| 採用済み

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

15日 前 | 0

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

16日 前 | 1

| 採用済み

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

16日 前 | 0

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

17日 前 | 0

| 採用済み

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

18日 前 | 0

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

18日 前 | 2

| 採用済み

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

18日 前 | 1

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])

18日 前 | 1

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

18日 前 | 0