Answered
How can I set bounds for ga that change with the values of the optimization variables?
You cannot. Bounds are FIXED constants. They do not vary at all, and the optimizer assumes that as fact. If you have a constrai...

4 years ago | 1

| accepted

Answered
What do I do to upgrade from MatLab 2013a to run-on MacOS Catalina
What can you do now? Looking at the system requirements page, we see that R2019b is the oldest release supported for Mac OS 10....

4 years ago | 0

Answered
how to get convolution for two signals without using conv command
Several ways you could do this. If your signal is represented as a discrete sequence, then just use a double loop, accumulating ...

4 years ago | 0

Answered
Countering error while using interp1 function
Your problem is NOT in interp1. It is in the incorrect use of datetime. Read the error message: Error using datetime (line 597)...

4 years ago | 2

| accepted

Answered
Does Matlab have a way to find the formula that defines a sequence?
Things are never as easy as you think. For example, is there a simple difference relation that will generate this sequence: P =...

4 years ago | 2

Answered
Comparison of very large numbers
@Steven Lord said it exactly correct. The problem is not that a tool like ismember rounds anything, nor that ismembertol would h...

4 years ago | 0

Answered
How to convert BigInteger into binary?
You would not expect dec2bin to do it, when you convert the number oto a double. It will fail above 2^53-1, and that number is s...

4 years ago | 1

| accepted

Answered
Matrix in matlab equation
An alternative to repmat is to use a dot product (if you are an old APL person like me, then the phrase "outer product" will com...

4 years ago | 0

Answered
How to get more than 1 ans
The thing to remember with functions that return more than one argument is what MATLAB does with those arguments. Consider any f...

4 years ago | 0

Answered
Create a double identity matrix matlab
There are many basic ways, some not so basic. Perhaps my favorite is just: n = 8; A = triu(tril(ones(n)),-1) Here is another ...

4 years ago | 2

| accepted

Answered
How to find the coefficient matrix of a set of nonlinear equations?
This is a linear problem, IF you recognize that each of the right hand sides are linear in a,b,c,d except for the cube around th...

4 years ago | 1

Answered
Difference in exp(a*b) and (exp(a))^b when b is a fraction and a is a complex number
They look like they should be the same, yes. But sometimes your intuition about what is mathematically correct leads you astray ...

4 years ago | 3

| accepted

Answered
Projection of 3D points on plane
Why do you think the original distances between the points should be the same after a projection? NOT SO!!!!!!! In fact, it is t...

4 years ago | 0

Answered
Optimization of function of 3 variables
You need first to define this as a function handle. Then you need to use FMINCON as the solver, or GA will also work. The const...

4 years ago | 1

Answered
Calculating the mathematical expression
There are two possible questions in this. You have a vector y, and a vector z. You wish to evaluate the expression for x, for A...

4 years ago | 0

| accepted

Answered
I can't calculate the integral function in this exampleCan anyone give me some advice? thank you
You can't use a tool like int to integrate a vector of numbers. In fact, all you were doing is integrating a constant. Instead,...

4 years ago | 0

Answered
Need help to solve nonlinear ode in matlab
Just for kicks, I had to try solving this using dsolve to see what it would do. syms u(x) T = 1; R = 0.5; % Just picking a va...

4 years ago | 0

| accepted

Answered
Termination tolerance with fzero function
As Torsten suggests, you cannot use fzero with no initial guess. In fact, fzero runs better with a bracket, than just a single g...

4 years ago | 2

Answered
Why am I getting an out of index error?
You created the function handle J. J has argument x1. So inside J, it sees whatever you pass in as x1, apparently you think th...

4 years ago | 0

Answered
linear least square with nonlinear constraints
Fmincon requires a single objective to optimize. So if you have a set of 18 equations, in 12 unknowns, then you formulate the ob...

4 years ago | 0

| accepted

Answered
How would you impliment this optimization in MATLAB?
This is a moderately simple problem with 5 unknowns. Another solver may be safer, because of the absolute values, but they are i...

4 years ago | 1

| accepted

Answered
Finding erf using Maclaurin series breaks down around x = 5
Do you expect that all infinite series are convergent? And sometimes, even a series that is theoretically convergent for all x, ...

4 years ago | 0

Answered
minimum distance between a given set of point and a curve
Simplest is to use my code distance2curve, as found on the file exchange. It finds the distance to a general space curve, to eac...

4 years ago | 0

| accepted

Answered
How to numerically solve and plot definite integral with variable upper limit
There are many trivial ways. Off the top of my head ... Repeatedly integrate, using a tool like integral, from 0 to x, then plo...

4 years ago | 0

Answered
Vandermonde-like matrix
The easiest way? Probably this line: (in R2016b or later) x.^(((0:-1:1-n)' + (0:-1:1-n))/2) If you want to use two lines of co...

4 years ago | 1

Answered
Best way to get rid of/ prevent function from creating complex numbers?
You cannot simply force that a complex number will never arise. There is no flag you can just set to tell MATLAB to never create...

5 years ago | 1

Answered
Buy or trial MatLab R2009b
NOBODY can just give it to you. Can you buy it? You can get a current license. That would, in theory, alow you to download an o...

5 years ago | 0

Answered
Define an event in a signal
So, are you asking someone to teach you how to write a gui interface that will do all of this? That is a big request, and it wil...

5 years ago | 0

Answered
Program helix spiral with radius?
This does not seem to be obviously a homework problem. so... To solve such a problem, you need to understand a spiral, and what...

5 years ago | 1

| accepted

Answered
I am trying to find the roots of this equation but my code doesn't work. It keeps saying theta0 is unrecognized,
It appears that your equation is: theta0= x*tan(theta0)-4.905*(x^2)/((v0^2)*((cos(theta0))^2))-(y0-yf); and you wish to solv...

5 years ago | 0

Load more