Answered
Finding intersection of 2 parabolic curve fits with different y-axes
Um, trivial, sort of? You want to find the intersection of these two polynomial curves as plotted? They are quadratics, for g...

7 years ago | 1

Answered
optimization code with pso
You can't optimize two things at once, unless they both happen to be optimal at the same location. However, you can try to optim...

7 years ago | 0

| accepted

Answered
Curve fitting tool generating different results with same data
Has nobody answered this question? The common reason why a method produces different results on a repeated start is there was a ...

7 years ago | 2

Answered
Undefined function or method 'unit8'
Perhaps the problem is with your typing or your spelling. ;-) While unit8 does not exist, uint8 does. MATLAB can be so picky.

7 years ago | 3

| accepted

Answered
Generate unevenly-spaced synthetic time series
It failed, because the colon operator does not accept a random increment. Anyway, randn(1:5) does not generate a random number b...

7 years ago | 0

Answered
Shuffle matrix rows so that common elements are in completely different order than in a said row
What you are looking for is a variation of derangement - thus a permutation such that no element is in the same location as it s...

7 years ago | 1

Answered
Can someone provide me a simplest solution for this?
Easy peasy? Pretty fast too. tic n = 1:50000; M = 10.^(floor(log10(n))+1); nsteady3 = sum(n == mod(n.^3,M)); toc Elapsed...

7 years ago | 0

Answered
Jacobi iterative method problem
Note that the Jacobi method for solution of a linear system is only convergent for SOME matrices. It is NOT always convergent. Y...

7 years ago | 3

| accepted

Answered
Vectorizing code for sign flipping of eigenvectors
I would suggest your code is needlessly complex. Trivial to write too. Choose an orientation for the eigenvectors such that the...

7 years ago | 0

Answered
Error while integrating a piecewise constant function
As an alternative to that which Madhan shows, you can make sure the result is of the correct shape. A1 = @(x) reshape(temp(floo...

7 years ago | 1

Answered
creating binary vector with determed number of ones
nones = 10; nv = 50; V = zeros(1,nv); V(randperm(nv,nones)) = 1;

7 years ago | 1

| accepted

Answered
How to find the minimum distance between two fitted curves
Not impossible to do. I can think of two ways to do this. You give no data, so let me make some up. x1 = sort(rand(100,1))-.5;...

7 years ago | 1

| accepted

Answered
How to use polyfit to get the difference out of two functions?
Polynomials are linear in the coefficients. So the difference of two polynomials is obtained by just subtracting the coefficient...

7 years ago | 1

Answered
Simulating a Markov chain
There seems to be many followup questions, it may be worth discussing the problem in some depth, how you might attack it in MATL...

7 years ago | 9

Answered
random deployment of nodes
I don't see the problem. You don't start by solving the entire problem in one line of code. You start by going as slowly as you ...

7 years ago | 0

| accepted

Answered
if condition for infinity
You cannot test for the word 'finite', and expect it to return a valid result, when compared to an inf value. x = inf x = ...

7 years ago | 0

Answered
Sum of a 4D matrix
The problem is a relatively easy one, as long as the total sum does not exceed 1. It gets nasty above that. I'll look at the pr...

7 years ago | 1

| accepted

Answered
Linear Programming With geq constraints
You switch the sign of a constraint simply by multiplying everything by -1. I thought that was like elementary school math. Did ...

7 years ago | 0

| accepted

Answered
How to create a spline for data without sorting?
I can certainly do it with interparc. But it gets tricky, because interparc is set up to find points that are designated in term...

7 years ago | 1

| accepted

Answered
How can I reverse C = mpower(A,B)
Um, you can't. Information tossed into the bit bucket is irretrievably lost. In your example, A1 is upper triangular, with 0 on...

7 years ago | 0

| accepted

Answered
Extract rectangular grid from triangulation
The simple answer is to just round the points to a lattice. That is, just assign each point to the nearest lattice point. Since ...

7 years ago | 0

Answered
non linear equation with single root
fzero does not find a root, cannot find it, because it has no zero crossing. That is a requirement for fzero. Effectively, there...

7 years ago | 1

| accepted

Answered
Curve Fitting Equation result
Those are approximate confidence limits on the variable as estimated. (Not always very good limits, as I said, approximate.) I...

7 years ago | 0

| accepted

Answered
coefficients of the polynomial - the least squares method
Sort of correct. But I see at least two subtle problems. First, you have 9 data points. So a polynomial with as many coefficien...

7 years ago | 0

| accepted

Answered
excel linear regression trouble vs excel linear regression
Simple enough. polyfit(x,y,1) ans = -0.002965 1.7919 Or: regress(y',[x',ones(length(x),1)]) ans = -0.002965...

7 years ago | 0

Answered
Solving linear equations with large matrices
Enough information now that I'll hazard an answer. By the way, the logic behind suggesting GMRES is NOT that your matrix is spa...

7 years ago | 1

| accepted

Answered
Why is the answer from the calculator and matlab different?
Because 455^100 is a computation done in DOUBLE PRECISION. Assuch, it goes well beyond the limits of what a double can represent...

7 years ago | 1

Answered
How to solve an equation, with infinite solutions, to find only n number of solutions?
Provably getting the FIRST 5 solutions is essentially impossible on a completely general function, as it is trivial to write a f...

7 years ago | 0

Answered
Solving system of n equations
syms a x b y EQ = y == a*x + b; isolate(EQ,x) ans = x == -(b - y)/a

7 years ago | 0

Answered
How do I create a repeating number series?
LEARN TO USE MATLAB. 0.25:.5:25 ans = Columns 1 through 11 0.25 0.75 1.25 1.75 2...

7 years ago | 0

| accepted

Load more