Answered
nested calls to fmincon
Um, yes, you can use nested calls to fmincon, but with a huge, massive caveat. fmincon requires differentiability of the object...

7 years ago | 1

Answered
How to draw a 3D graph with constraints?
The simple answer is to just use meshgrid. [x,y] = meshgrid(linspace(0,1,100)); keepind = (x + y) <= 1; x(keepind) = NaN; ...

7 years ago | 2

| accepted

Answered
How to create a complex normal i.i.d.?
Is it correct? It is what it is. You are creating a rotationally symmetric complex random variable, where if we define the varia...

7 years ago | 0

| accepted

Answered
How to write a function for this simple purpose?
Here are other approaches that are nicely vectorized, but do not require you to set explicit tests for each bin. For example, su...

7 years ago | 1

Answered
Matlab Solver - fmincon, minimization problem with constraint
" Q1. Although the weight for w1 is greatly increased, there is a very small tendency to minimize the function for J1. What ...

7 years ago | 0

Answered
Deconvolution of a Convolved Gaussian and Expoential curve
As I recall from long ago, numeical deconvolution is a variation of a first kind integral equation. https://epubs.siam.org/doi/...

7 years ago | 0

Answered
How can i creat varibales, varible1, viable2, into loop
Simple answer, don't do it. You even state that you are a beginner. So instead, learn to use MATLAB properly. Use vectors, use a...

7 years ago | 0

Answered
Numerical Multiplication in MATLAB
So what is your problem? If you think the result should always be an exact integer, that just means you don't appreciate floatin...

7 years ago | 1

| accepted

Answered
Solution when number equations is less than than the number of variables
There is no unique solution in general. That is, infinitely many possible solutions. In this case, you have TWO variables, and...

7 years ago | 0

| accepted

Answered
Mean of the third dimension
Not entirely sure what you are asking. Do you want to compute the mean for each year for each combination of X and Y? That woul...

7 years ago | 1

| accepted

Answered
I need help with my code using gaussian elimination.
Well, we COULD try to help you solve it using Gaussian elimination, but actually we can't. In fact, nobody can. rank(A) ans = ...

7 years ago | 0

Answered
MATLAB help with functions
Ok, you know that you have to use .^ to raise to a power. Then look carefully at the error message. What does it tell you? "Err...

7 years ago | 0

Answered
Invalid use of operator
That you know what your made up syntax means is great. But MATLAB cannot read your mind (yet, the mind reading toolbox has not b...

7 years ago | 4

Answered
How to smooth an airfoil given through a set of points ?
You cannot fit a spline directly to data of that form. (I don't have your data, so I cannot give an example using it.) But for e...

7 years ago | 3

| accepted

Answered
Equivalent to lsqcurvefit() without the need of the optimisation toolbox
If you are hoping to find someone who provides code in MATLAB here to yield the identically exact same results as lsqcurvefit, i...

7 years ago | 2

| accepted

Answered
Starting with a displacement function, can I use ODE 45 to calculate acceleration?
You cannot differentiate data using a ODE solver. Think of an ODE solver as a numerical integration tool. In fact, you can perf...

7 years ago | 0

| accepted

Answered
A problem that the Ode45 solver did not finish the computations
The answer is (probably) simple. I need point out only a couple of lines of your code that tells me it is so. (In fact, I was al...

7 years ago | 0

Answered
How to use questdlg to ask the user for an action?
Your first problem is you are not using it correctly. The last argument should be one of the choices, to give it a default butt...

7 years ago | 0

Answered
Using a tolerance in X with fzero function (by default the tolerance is evaluated on Y axis).
Actually, if you check the docs for fzero, you will find it uses exactly 5 of the possible options properties - Display, FunValC...

7 years ago | 1

Answered
When using polarplot, why does the argument come before the modulus?
There is no officiially agreed convention, nor can there really be one. Don't expect the author to have used the same convention...

7 years ago | 1

| accepted

Answered
Problems with fmincon for design optimization
Jeff Miller told you this, the first time you asked this question. I'll repeat it, since you don't seem to believe him. You CAN...

7 years ago | 1

Answered
Solving a 2nd order ODE
It is arguably bad notation to have x0 and x_0 as two variables that mean very different things. Confusing as hell, and if you d...

7 years ago | 2

| accepted

Answered
Fit data to sawtooth shape
Too late for an answer for Angela, since I never saw the question a year ago. But a simple model for such a curve will not be to...

7 years ago | 0

Answered
How to perform norm on each row of a matrix?
What is a norm? I assume by norm, you mean the common Euclidean norm, thus the 2-norm. (Other norms will be just as easy for the...

7 years ago | 2

| accepted

Answered
Randi worked in a program I ran 5 weeks ago, today it doesn't-what gives?
Don't write an m-file that is named randi, at least, if you will ever want to use randi. Try this: which randi -all If there i...

7 years ago | 1

| accepted

Answered
Finding Complex root for the nonlinear equation with single variable
Please don't answer your question with a comment. But the answer is, not you cannot use fzero to find a complex root. fzero ONL...

7 years ago | 0

Answered
How to interpolate over long section of bad data?
I had to laugh. No, your problem is not how you defined xq, but more in how you defined x! At least you were thinking in sort of...

7 years ago | 0

Answered
Some insight on mvnrnd function
For once, someone asks a good question, that says they saw something they did not understand, and want to understand what happen...

7 years ago | 2

| accepted

Answered
Non-reproducible solution with non-linear fitting
Do you understand that when you do not specify astart point, that fit uses a RANDOM start point? So why would you expect the sam...

7 years ago | 0

Answered
What is the best way to store different variables into 1 variable?
Use a cell array. Or use a srruct. Either can store anything you put into it. Here, a struct will allow you to store everything...

7 years ago | 0

Load more