Answered
Is NaN ok here?
Sure. It does not bother me. Why does it bother you? B = [1.66000000e-01 6.60000000e-02 1.40000000e-02 3.90000000e-02 1.4000000...

6 years ago | 0

| accepted

Answered
Gaussian Quadrature Error Help
I think you misiunderstand Gaussian quadrature. You claim to have 4 points. WRONG. You have TWO points in x, and TWO in y, the...

6 years ago | 1

| accepted

Answered
Tic, Toc Behavior
Using tic and toc to masure any time is a bad idea. Using tic and toc to masure any time is a bad idea. Using tic and toc to m...

6 years ago | 1

Answered
What does squeeze() do in MATLAB?
Squeeze is a useful tool to help compress dimensions of a multidimensional array when you have performed some operations. Let me...

6 years ago | 3

| accepted

Answered
Solve as Optimization Problem in Matlab
In MATLAB, the solution is intlinprog. Of course, there may be multiple solutions. intlinprog does not give them, if any could e...

6 years ago | 0

Answered
Matrix multiplication from the right with inverse matrix
a is a 3x2 matrix. No matter what, you cannot compute the inverse of a, so U=R*A^-1 is meaningless. I assume you want to sol...

6 years ago | 0

Answered
Look-up Table "Newton Interpolation"
Let me suggest this is a bad idea. The result will be an interpolant that is not even differentiable across the data points. A n...

6 years ago | 0

Answered
radius and height of a cylinder with given volume and cost per m^2
I won't do your homework for you, and I truly hope nobody else does it either, as that would be inappropriate. But it seems if ...

6 years ago | 1

| accepted

Answered
How to do a non linear fit in MATLAB?
Only VERY poorly. Your data is barely sufficient to estimate anything more than a straight line. R=8.314; P=[0.1 0.1 0.1 0.1 ...

6 years ago | 0

Answered
Fit with exp2 doesn't working
I'll assume you want to fit this using a sum of two exponentials? Since that is the way you plotted it, I assume that is so. ...

6 years ago | 1

Answered
Curve is not fitting
With only one or two points where the function is not essentially constant to within the noise of the system, a good fit will be...

6 years ago | 1

Answered
How can i find equilibrium points of 2 ODEs?
You have a system of ODEs. An equilibrium point is where the derivative is zero. So just use solve, applied to the derivatives...

6 years ago | 0

| accepted

Answered
Use or Pi and raising matrix to a Power
MATLAB tells you exactly what is wrong, and how to fix it. (This has nothing to do with your use of pi.) Error using ^ (lin...

6 years ago | 0

Answered
Inverse linear/nonlinear regression model
You cannot do this. There are infinitely many possible solutions there, as you should recognize.

6 years ago | 0

Answered
checking input an integer greater than 0?
If you want to check for an integer that exceeds zero, first use the && and || operators. So assuming you want to throw an erro...

6 years ago | 1

Answered
Between ei(vpa(5)) and vpa (ei(5) ) which command would provide a higher precision for the integral ei(5) ?
Is this a homework assignment? My spidey sense is tingling. However, a quick glance at your other questions suggests you are hop...

6 years ago | 0

| accepted

Answered
solve two equations with 2 unknowns(pbar,rho)
The symbolic toolbox does not always work well with the stats toolbox. And stats is where normcdf and norminv come from. So do...

6 years ago | 0

Answered
Optimization Problem with Inverse Matrix
Of course, the simple answer to this question is you are trying to use the wrong algorithm. If you want to find the vector a, s...

6 years ago | 0

Answered
Simpson's Improved rule help?
What is the name for this method? It is just a basic Simpson scheme where the interval is subdivided, recursively. As such, it f...

6 years ago | 0

Answered
square brackets indexing of vectors
This has never existed as an option, and I doubt it ever will. That is, there is no need for [] bracket indexing to exist, since...

6 years ago | 0

Answered
simple arithmetic!
A question asked and answered MANY times on Answers. https://www.mathworks.com/matlabcentral/answers/316889-why-two-equal-numbe...

6 years ago | 0

Answered
Poor delaunay triangulation output
Since a delauny triangulation describes a convex domain ALWAYS, this is the expected behavior. If your data is not truly convex ...

6 years ago | 0

Answered
How does Matlab know the boudary condition of spline while I did not provide?
Depending on the specific spline tool used, you can often set the boundary conditions. Spline, for example, allows you to set th...

6 years ago | 0

Answered
Cody challenge hard coded answers
Should it? Not really, but what are you going to do? A good problem should include at least one random test input. But that al...

6 years ago | 0

Answered
How to define contour level in percentage?
Um, you first find the minimum. Then the maximum. Then find the point 30% of the way between those two numbers. zmin = min(z,[...

6 years ago | 0

| accepted

Answered
How can i solve for the maximum? (a little complex)
First, learn to use vectors and matrices. This is MATLAB. Naming all of your variables like that will lead to a huge headache as...

6 years ago | 2

Answered
Trying to do central difference method
You need to understand this: 6/2*3 Why does it return 9, and not 1? I told matlab to divide 6 by 2, and then to multiply the...

6 years ago | 1

| accepted

Answered
Euler's number syntax in matlab
So what is wrong with what you wrote? In fact, that is how you do it (and how most common languages I can think of usually do it...

6 years ago | 1

Answered
surface plot of three independent variables
Let me see. You want to create a plot from 3 independent variables, but one of them is always zero. So there is no information c...

6 years ago | 0

| accepted

Answered
Finding the zeros of a function
That is the expected behavior of a method like NR. Sorry, but it is. Seriously, NR is literally the WRONG way to try to solve su...

6 years ago | 0

Load more