Answered
How can I solve optimization polynomial problem?
It looks like it should work just fine. Why do you think it needs correction? lol. Note that in real life, you would NEVER wa...

8 years ago | 0

Answered
better than if else conditions
Look at the third output argument from the function histcounts. It does everything you need, in a fully vectorized form. Yes, I ...

8 years ago | 0

Answered
Command skewness(x) vs calculating sample skewness by hand
This is not a rounding issue. The answer is almost always to check the docs for the function in question. doc skewness ...

8 years ago | 1

| accepted

Answered
How to curve fit a data with multiple linear line, which regression method suits?
Your problem as described is a spline, a LINEAR spline, as opposed to a cubic spline. You want to estimate it using a least squa...

8 years ago | 0

Answered
Eigenvector are different for eig(A)=eig(A,I) {I is identity matrix} but eig(K/M,M/M) not equal to eig(K,M)
Ok, looking at what you did, lets see... The generalized eigenvalue problem solves A*X = lambda*B*X where A and B are...

8 years ago | 0

Answered
problem of generations of values in a matrix
No. You are thinking about it the wrong way. m = [1 1 1 1, 2 2 2, 3 3]; You can use repelem for the general case m = res...

8 years ago | 0

Answered
I have to find out all the non-negative solutions for an underdetermined system of linear equations.
Not gonna happen. Period. Think about it. We can even use your example to make the point. But, first, learn to write things in a...

8 years ago | 1

Answered
How do I approximate real roots of a polynomial?
There really is not too much magic in this. If the coefficients of the polynomial are real (probably the most common case whe...

8 years ago | 0

Answered
Specified number of ones in the matrix (column and row)
Just a quick guess... This reduces to finding a set of 3 permutations of the numbers 1:5, such that none of them fall in the ...

8 years ago | 0

Answered
I have 2 clusters with some outliers is there any way I can clear up those points?
Without your data in hand to show you how, I'll need to make up some data. X = [randn(100,3);5 + randn(100,3)] + randn(200,...

8 years ago | 0

Answered
is there a matlab code for gaussion integration!!!
Did you look on the file exchange? (Clearly not.) <https://www.mathworks.com/matlabcentral/fileexchange/8679-gaussquad> <...

8 years ago | 4

| accepted

Answered
How to multiply all values in the diagonal of a matrix by -1 in Matlab?
A bit simpler than what you did is... A = max(a21,a21').^2; A(1:6:end) = -A(1:6:end); A A = -1 4 9 ...

8 years ago | 2

Answered
How to use a cloud of points to interpolate the value at a given point?
You were close. griddata is there for problems of the form z(x,y), thus two independent variables. You have three. That is wh...

8 years ago | 0

Answered
cart2pol angle sin 0 to 2pi range instead of -pi to pi range?
The most efficient solution is to use mod. Thus... theta = mod(cart2pol(x,y),2*pi); This works, because what you really ...

8 years ago | 2

Answered
Passing a line in middle of random lines
You have a long list of line segments. Not lines, unless you mean the extension of those lines to infinity in each direction. Bu...

8 years ago | 0

Answered
Is it possible to define constant value in a matrix ?
You cannot enforce the requirement that any specific element of a matrix will never be changed (or fix some matrix as a whole to...

8 years ago | 0

| accepted

Answered
How to decrypt a .mat file ?
I believe the complete file specs for a .mat file are not published outside of The MathWorks. That means if you want to fully "d...

8 years ago | 0

| accepted

Answered
Solution is not matching with actual equation
That the solution is not exact is not even remotely surprising, for several reasons. First, an over-determined system will gener...

8 years ago | 0

| accepted

Answered
How to solve this weird problem in Matlab?
A technical term for this is massive subtractive cancellation. I suppose you could also call it an ill-posed problem. So what is...

8 years ago | 2

Answered
how can i write square root of mod x1(t)
Huh? It looks like you already know how to write sqrt(x(1)*t). So what is your question? Are you looking to find a modular sq...

8 years ago | 0

Answered
How to use Least Square fitting to fit a MR Spectroscopy data?
Um, no, you can't. Or, well, least squares may be inappropriate. Or, yes, it is completely possible. Anything in that spectrum o...

8 years ago | 0

| accepted

Answered
roots of the equation
Are you claiming that v is a cubic polynomial? pretty(vpa(v,5)) / 0.0961 0.000019792 \ ...

8 years ago | 0

| accepted

Answered
How to find all solutions to a function?
This could be a deflating experience. ;-) x(1) = vpasolve(f) x = -1.8454863060096746759606364851789 >> x(2) = vpas...

8 years ago | 1

Answered
How can I get a value not NaN when calculating ''inf/inf''?
There is no consistent numeric value you can obtain when taking the ration inf/inf. Should it be 1? Clearly x/x is always 1, ...

8 years ago | 0

| accepted

Answered
How to calculate a derivative of function numerically?
You can use symbolic tools to compute the derivative, if you have that toolbox. But if you wish todo so numerically, then you ne...

8 years ago | 0

Answered
How to permanently set the search path?
Once your search path has been established, using tools like pathdef, addpath, rmpath, userpath, path, pathtool, you can then us...

8 years ago | 0

Answered
How do I display even numbers between A and 100 in one single column?
How do you turn a row into acolumn? Use reshape. Or, use transpose. Or, use V(:) In any case, all will create a co...

8 years ago | 1

Answered
I have ( An ) matrix, I need generalised algorithm to calculate An-1 = An *B. Here An-1, An, and B are matrices.
You have A3, and you want to compute A2 and A1? A2 = A3*B; A1 = A2*B; You want a general "algorithm"? DON'T DO IT....

8 years ago | 1

| accepted

Answered
Zscore and solving by definition differ
Source? Basic mathematics. An eigenvector is NOT unique. If A is a square matrix, with eigenvalue lambda, and eigenvector X, ...

8 years ago | 0

| accepted

Load more