Answered
Curve Fitting and extrapolation for a semi-circle
There are many circle fitting tools to be found on the file exchange. You can use and download one of them, but I will concede t...

5 years ago | 0

Answered
Elementary matrices in Matlab
So many ways to do this. DGM showed a great way using toeplitz. But there are others. For example, you could use diag. n = 5; ...

5 years ago | 1

Answered
Is the solver 'lsqnonlin' boundary dependent?
This is unlikely to be the case of lsqnonlin being "boundary dependent". That is not true in my experience. It is more likely a ...

5 years ago | 0

Answered
What is the underlying mathematical method used by fittype() to fit data to a defined formula?
Well, fittype des not do the fitting itself. That would fall more into the regime of fit. fittype merely allows you to specify ...

5 years ago | 0

Answered
finding the start and end points of a unimodal peak
Wait a second! You are using findpeaks. It returns as one argument the peaks it finds, as well as the associated width. But you ...

5 years ago | 0

Answered
Can I take data while setting them
I'll write this as an answer, intead of a comment on @Yongjian Feng's excellent response, as otherwise my thought can become los...

5 years ago | 3

Answered
How to convert all array values into negative ones?
So many ways. Don't forget the simple solution: A = [2; 3; 5; -8; 9; 1; -1] B = -abs(A) % this makes all of the signs positive...

5 years ago | 0

Answered
How to find constants of integral knowing initial conditions
Raz=26.67*10^3; qo=20; L=3000; M=10*10^6; E=2.1*10^5; d=100; Izz=(pi*d^4)/64; syms x C1 C2 My_x=-Raz*x+(qo*x^2/2)-M; ph...

5 years ago | 1

Answered
how do i get the solution from ODE45?
You cannot do so. PERIOD. ODE45 is NOT an analytical solving tool. Would you expect code written for one purpose to perform what...

5 years ago | 0

Answered
I am trying to plot the following function but there is a syntax error which I am not sure about
How do you often write the square of cos(x)? Yes, a common mathematical notation is to use cos^2. In MATLAB? Sorry but not valid...

5 years ago | 0

| accepted

Answered
Coding in m-file, for a func defined in an interval [x0, xn] like Fi(x)(=(c1(i)+c2(i)*sin(w1*(x-x(i)))+c3(i)*cos(w2*(x-x(i)))+c4(i)*sin(w2*(x-x(i)))+c5(i)*cos(w1*(x-x(i))))?
There are still some issues with the question. Note that it is a REALLY bad idea to use the vector x(i) to indicate break points...

5 years ago | 0

Answered
how to code binary integer programming model?
So you have 18 unknowns. What is the problem? What have you tried? You will call intlinprog, (older releases will call bintprog,...

5 years ago | 0

| accepted

Answered
Generate a numerical series
While @DGM is correct (+1 from me on that answer, please accept that answer, as it is the correct one), in that it is what I wou...

5 years ago | 1

Answered
Solve a System of five non linear equation
E_i=[( w1*gamma(mu1+1/a1)/( ( mu1^(1/a1) )*gamma(mu1) ) )+( (1-w1)*gamma(mu2+1/a2)/( ( mu2^(1/a2) )*gamma(mu2) ) )==C1,... ...

5 years ago | 0

| accepted

Answered
Which is Better for Polynomial Equations: roots or solve?
Roots versus solve can be VERY different in the result. The answer is you need to understand the differences. When is increased ...

5 years ago | 2

| accepted

Answered
Create a vector from repetition of two others
A=[1 2 3 4 5]; B=[6 7 8 9 10]; reshape([A;B],1,[])

5 years ago | 1

Answered
issue with 'intersect' function
I'm sorry, but your problem lies in understanding floating point arithmetic. Two sets of floating point numbers, created by even...

5 years ago | 1

| accepted

Answered
common tangent of double-well function
This is actually not a difficult problem to solve, IF you think about what a tangent line means. For example, consider the pol...

5 years ago | 3

Answered
I want to find rate constant from function fminsearch.
Here is a start. First, fminsearch will probably be a poor solver to use here. At least, make sure you have good starting values...

5 years ago | 0

Answered
How can I solve this problem in MATLAB? Warning!
That you need to solve it is not relevant. Does an analytical solution exist? Almost surely not. We all sometimes want for thing...

5 years ago | 1

| accepted

Answered
Finding all local/global minima of an Optimization Problem
Do you understand there are infinitely many such equivalent solutions to that problem, not just TWO? And, while I'd like to writ...

5 years ago | 0

| accepted

Answered
how to make a vector z that consists of odd-indexed entries of y (y=[100:1])?
A very confusing question. I'll take a wild guess. If this does not answer your question, then you need to be FAR more lear. y ...

5 years ago | 0

Answered
Is applying a binary operator (+,-,*,/) to char arrays supported by MATLAB or just a "trick"
The plus operator has long been supported, as it applies to character arrays. I recall it existing for as long as I go back usin...

5 years ago | 0

| accepted

Answered
if statement for every possibility
Ok. Let me see if I understand. A wierd number x is a positive integer, such that given the set of proper divisors of x (that is...

5 years ago | 2

Answered
random matrix with a minimum number difference for adjacent numbers accepted
Let me start out by saying it is a terrible idea to use max and min as variable names. Your next anguished question will be why ...

5 years ago | 0

| accepted

Answered
How to solve for unknown function in integral equation?
One idea can lie in the use of a family of functions the decompose the unknown f. Choose an orthogonal family over the chosen do...

5 years ago | 0

Answered
Numeric derivative with multiple variables
Here is a simple trick to remember. See how I used da1 and da2 below. f = @(a) sin(a(1)) + cos(a(2)) + a(1) - 2*a(2); a0 = [...

5 years ago | 2

| accepted

Answered
Is there any easy way to calculate integral with cylinder coordinates in Matlab numerically?
It seems pretty easy. Go back to calc 101. Maybe 102. WTP? For example, what is the integral of z*(x^2+y^2), over a unit cylind...

5 years ago | 0

| accepted

Answered
How to get multi-solution using 'lsqnonlin'?
lsqnonlin is a numerical optimization tool. It iterations fro mthe start point to a solution. And the solution you get is depend...

5 years ago | 1

Answered
What can I use instead of 'lsqcurvefit'
A solver CANNOT know if it is in the global minimum or a local minimum. Even a putatively "global" solver cannot be certain exce...

5 years ago | 0

Load more