Answered
How to round a large array to the nearest factor of 0.0064
Hint: What would happen if you divided the entire array by 0.0064? What if you then rounded the result to the nearest inte...

8 years ago | 1

Answered
lsqcurvefit problem. Error using snls (line 48) Objective function is returning undefined values at initial point. lsqcurvefit cannot continue.
There are multiple issues here to deal with. First of all, why is the objective returning undefined values? Probably because ...

8 years ago | 4

| accepted

Answered
A bug in pearsrnd?
I'm not amazed. These things can be tricky. Looks like pearsrnd is tripping over the very near zero skewness. X = pearsrnd(...

8 years ago | 0

| accepted

Answered
VERY odd error with simple multiplication ... OK... not so odd.
Nope. It is just that you need to learn about arithmetic in general on a computer, and how numbers are stored in floating point ...

8 years ago | 4

Answered
Genetic Algorithm - Special constraint
Um, the constraints allow you to supply inequality constraints. In fact, the A and b arguments are INEQUALITY constraints, NOT E...

8 years ago | 0

| accepted

Answered
I am not able to solve this system of two non-linear equations. Any ideas ?
Seems trivial. Solve the second equation, isolating y. You would get this: y = (927625*x - 264799270)/(650*x - 214174) ...

8 years ago | 0

| accepted

Answered
How to calculate normal to a point on random contour ?
Not that difficult. It helps if you have the curve fitting toolbox, as that is where cscvn resides. Else, you would need somethi...

8 years ago | 3

| accepted

Answered
fmincon rough estimation in little time
fmincon is pretty much the wrong tool for this for multiple reasons. It is not designed to allow for low precision. It certainly...

8 years ago | 0

Answered
Getting an index out of bounds error in my matlab program. Please help. Stuck in this for quite a while now.
READ the error message. Look at what you are doing. What size is conn? (810x3) Where does the error message say the error...

8 years ago | 0

Answered
Finding solutions of a transcendental function
What have you tried? If nothing, then why not? First, create IT. n = 100; IT = linspace(0,5,n); Initialize wbar...

8 years ago | 2

| accepted

Answered
Array indices must be positive integers or logical values.
What is t? You may think you are creating a function by doing this: s(t)=[0.1553567*(t^6)-2.0416*(t^5)+9.1837*(t^4)-14.829*...

8 years ago | 0

Answered
I would like to find all roots of a nonlinear equation in one variable, e.g., f(x) = 0.
As has been said, unless you can limit the nastiness of your function, one can construct functions whee you cannot know the numb...

8 years ago | 0

Answered
How to raise an equational identitity with fractional powers to an identity with integral powers
I suppose it is far easier to do this with pencil and paper. That is, consider the case: x^(1/2)*y^(3/4)==z^(1/2) Now, w...

8 years ago | 0

Answered
Making a script that will generate a random "walker" that will walk along the x-axis randomly.
I'll guess: n = 1000; x = cumsum([0,-1 + 2*(rand(1,n-1)>0.5)]); comet(x,0:n-1) <</matlabcentral/answers/uploaded...

8 years ago | 0

| accepted

Answered
How to solve for multiple roots
The first 500 roots? Why 500? Are there 500 such roots? By the way, I think you need to learn to use fewer parens. f = ...

8 years ago | 2

| accepted

Answered
Is there any way to convert "*" to ".*"?
Why do you think you need to do so? In the symbolic expression you refer to, all of the * operators are multiplying a scalar...

8 years ago | 2

| accepted

Answered
for loop running like a forever loop
Be serious. How many loops do you have here? How many passes? Is your computer infinitely large and fast? counter = 75 B...

8 years ago | 1

Answered
Infinite or Not-a-Number value encountered during Integration
You don't tell us the value of c or m1 or m2, so it s impossible to show you clearly what is wrong. But it is pretty easy to kno...

8 years ago | 1

| accepted

Answered
I upgraded my Mac OS to Mojave and now I cannot run MatLab, my go-to app and get the error message that says it cannot recognize my computer. What next?
The pertinent question is which version of MATLAB do you have? According to this link: <https://www.mathworks.com/support/sys...

8 years ago | 0

Answered
Proper rational check with symbols
Hard to say, because your question is not at all clear. A proper fraction is one that is less than 1 in absolute value. Thus ...

8 years ago | 1

Answered
How to plot equally distributed points on 1/8th part of Spherical surface?
Your rather confusing question PROBABLY implies you want to plot points that are equally distributed on the surface of a unit sp...

8 years ago | 1

Answered
Finding R squared in a loop
There are several issues here. 1. Using this form is a bad idea: Parameters = inv(G'*G) * G'* d; Sigh. It gets used ...

8 years ago | 3

| accepted

Answered
Finding an Equation to a set of Data
You cannot "extract an equation from a spline". In fact, a spline has no simply written equation, but it is a list of many polyn...

8 years ago | 0

Answered
does anyone know how to rewrite this into switch/case statements
The immediate answer is to look at histcounts. It will allow you to set up a series of break points, returning an integer that i...

8 years ago | 0

| accepted

Answered
What is wrong with: [betta;delta;gamma]=inv([ab ab_cd -cd])*[C-A];
Why? This is because what you want to do is not valid in MATLAB. You can want for anything. If wishes were horses, beggars would...

8 years ago | 1

Answered
How do you save really big integers in the symbolic toolbox?
VPI has no problem dividing a number by 2. Here, for example, is one of my favorite moderately large primes. (That is, it is the...

8 years ago | 2

| accepted

Answered
distribution of consecutive numbers
Actually, easy. No loop needed, and just one line of code. You are essentially looking to find an array, I'll call it Counts, su...

8 years ago | 2

Answered
Solving a system of nonlinear equations
he he. I just noticed a major flaw with what you are trying to compute. l=[5 5 5 5]; %arbitrary values for rope length ...

8 years ago | 2

| accepted

Answered
How to avoid long decimals and unnecessary fractions on syms calculation
You can't avoid them, as long as you do symbolic computations. Symbolic computations are represented using integers and ratios o...

8 years ago | 0

| accepted

Load more