Answered
Want to add two 2D array with special condition
Easy peasy. A = [0 0 1;1 2 3; 0 0 0 ]; B = [1 2 1; 1 0 0; 2, 3, 0]; C = (A + B)./(1 + (A&B)) The trick is to look carefully ...

4 years ago | 0

| accepted

Answered
slope of non linear
Are you right to use a second order difference? NO. That is not the slope, but something proportional to the SECOND derivative. ...

4 years ago | 0

Answered
Will Spanish be supported at some point in Matlab Text Analytics Toolbox?
That is a definite maybe. Or maybe not. Answers is not a direct line to the MathWorks. Those who answer a question here are doi...

4 years ago | 0

Answered
Plotting a system of nonlinear equations
Learn first that MATLAB uses log(x) as the NATURAL log, NOT ln(x). As well, learn that MATLAB does NOT use implicit multiplicat...

4 years ago | 0

| accepted

Answered
How to find the integer values of the following system of equations
These are called Diophantine equations, as integer solutions are required. The square terms and products make them nonlinear. As...

4 years ago | 1

| accepted

Answered
Finding an initial feasible point x0 for fmincon
Two simple rules apply. If it was easy, then all solvers would do it for you, automatically. There would never be any issues. N...

4 years ago | 2

Answered
I have a very simple markov chain and I was wondering if there is a simplified equation for times spend in each state
This is not even a question about MATLAB. And worse, this is very likely a homework problem. However, since you have gotten an a...

4 years ago | 2

| accepted

Answered
Failed to add constant in the middle of a long array
I'm sorry, but you are simply wrong. It may mean that you did some other computations, or that you are confused. But this is a b...

4 years ago | 0

| accepted

Answered
fminunc Converging at a strange point
This is a common mistake made by people. x varies over a moderately large range. That means the POWERS of x will get very large....

4 years ago | 0

Answered
Aligning two noisy signals
Smoothing is NOT necessary. Lacking your data to use as an example... t = 0:500; S1 = sin(t/10) + randn(size(t))/10; S2 = cos...

4 years ago | 0

Answered
Verify analytical expression: derivative of an integral with undefined function
You define a function of a variable as I do here: syms n omega phi(t) T diff(int(phi*exp(-i*n*omega*t),[0,T]),T) Looks like y...

4 years ago | 1

| accepted

Answered
Three terms exponential fit without initial guess
There are a lot of misconceptions here. Can you do a fit without ANY initial guesses? No. Any nonlinear fit will use initial gu...

4 years ago | 2

| accepted

Answered
Bound 3D function with asymptote
Your problem is that zlim ONLY limits the plot axes. It does not impact the shape of the surface itself. Instead, define the sur...

4 years ago | 0

| accepted

Answered
Fitting a sine to data
Are you doing something fundamentally wrong? Sort of, yes. Fitting periodic functions has a probem, in that you will need to pr...

4 years ago | 1

Answered
How can I avoid pseudo random and confirm natural random ?
It is not possible to do that. For example, suppose I give you a number, but I won't tell you where it came from, or how I gener...

4 years ago | 1

| accepted

Answered
24 Hours for run my for loop
The crystal ball is soooo foggy today. I just cannot look into your computer to know why your code is slow. All the darned thing...

4 years ago | 1

Answered
Find equally (almost equal) distanced elements in an array
As a subtly different answer, now that I understand your question a little better, consider this idea. My goal in this answer wi...

4 years ago | 1

Answered
Find equally (almost equal) distanced elements in an array
You don't really say enough about your question to make it easy to solve. How long will these vectors be? How many non-zeros? Do...

4 years ago | 1

Answered
How to calculate the mean of all neighbouring elements in a matrix
This is actually trivially easy to solve, using a nice trick that is well worth remembering. (Note that this is a great trick th...

4 years ago | 1

Answered
Retreive standard deviation from noise
If it is purely white noise stored in the vector, then just use std. Even if the noise is not gaussian, std will still apply. S...

4 years ago | 0

Answered
Exponential curve fitting with nonlinearleastsquares methood
You DID get an exponential fit. However, your data is relatively noisy. And it does not span a wide enough interval so that the ...

4 years ago | 0

Answered
How to call a function over a rolling window of data?
Yes, there are more sophisticated ways to do this. But for gods sake, why not just write a loop? You don't say what size the re...

4 years ago | 1

| accepted

Answered
Different commands to do spline interpolation, are they the same?
Can two different functions exist that happen to do the same thing? Of course. MATLAB is a complicated language, that was create...

4 years ago | 1

Answered
Increasing number of data points by linear interpolation method
The problem is, as voiced by others, is it depends on why you are doing this. Certainly you can use interpolation tools to perfo...

4 years ago | 1

Answered
Converting a list of binary numbers to a decimal numbers
You have a list of binary numbers, as a character array. So zeros, ones, and a decimal point. (Personally, I think that should b...

4 years ago | 0

Answered
Why is lscov giving me a very different solution to a simple system with an analytical solution?
This is not the fault of lscov. As you have written it, t_matrix is quite well conditioned. There is only one solution to the pr...

4 years ago | 0

Answered
Curve fitting tool does not respect the upper and lower limits of parameters of custom equation
Sorry, but the confidence limits are not impacted by the bounds. To get better confidence limits they would need to do considera...

4 years ago | 0

| accepted

Answered
A compact way to find single digit numbers (i.e. numbers between 0 and 9) and replace them with two digit numbers
In MATLAB, you CANNOT store a number in a numeric format as one that has a leading zero. If you want to convert the numbers to ...

4 years ago | 0

| accepted

Answered
How to calculate the rotation of this egg?
Find a bounding box, where the box can be rotated, not a box that is aligned with the axes. Find the orientation (angle of incl...

4 years ago | 0

| accepted

Answered
How can I find negative factorial ? (-0.5)!
Simple. Yes, you could use MATLAB, IF you knew that the extension of the function factorial(n) onto the real line is just gamma(...

4 years ago | 1

Load more