Answered
Faster / more precise logarithm of complimentary error function?
If you want speed, no, you are not going to beat log(erfc(x)), at least not without writing custom code, preferably in some comp...

9 years ago | 1

Answered
[Matlab] The product of three consecutive integers is 778596.Determine what these three integers are
There are many trivial ways to solve this. A brute force search is easy enough. But since you know the solution must be very ...

9 years ago | 0

Answered
while loop with user defined function won't cycle through all conditions of the function.
H_A is a vector. While it starts out as the scalar value 16.2, you are growing the vector in length. This is bad for other reaso...

9 years ago | 0

Answered
What is the best way to go about integrating a discrete and evenly spaced dataset?
You have a relation with a derivative singularity. Newton-cotes panels, thus trapezoidal rules, simpson rules, etc. are all impl...

9 years ago | 1

Answered
What is the smallest difference MATLAB can notice between numbers?
eps is indeed the smallest difference. However, eps is a FUNCTION, not a fixed constant. The value of eps differs for different ...

9 years ago | 3

| accepted

Answered
solving equation for one unkown
By the way, it is a really bad idea to use eps as a variable. eps already exists in MATLAB, as a function that is quite useful. ...

9 years ago | 0

Answered
How do you determine the lower limit of an integral ?
Split it into TWO problems. fun = @(a) quad(@(x) 3*exp(-x.^2),a,1); So, what does fun do? For ANY given value of a, it c...

9 years ago | 0

| accepted

Answered
How can I convert to the next integer ? for example if I have x=3.3 , if I used int8(x) result will be 3 but I need it to be 4. I want the result to be always the next integer no matter what the number after "." is
Your question was ambiguous. If all you want to do is round up, then Walter is correct, ceil(x) is the answer. But you explicitl...

9 years ago | 1

Answered
Is there an alternative to eval for delayed evaluation?
This is absolutely insane! Why would you use assignin here? Just return the arguments as a struct. Set up your code to take a...

9 years ago | 2

Answered
How can I find the angle between a cubic smoothing spline and a line ?
You have the smoothing spline. Differentiate the spline. Compute the slope of the spline at the intersection point. You already ...

9 years ago | 1

| accepted

Answered
How to solve f(X)=0 if X is a symbolic matrix and 0 is the null matrix?
If f is a nonlinear function of the variables, then just use solve. fsolve would also suffice. X = sym('X',[2 2]); R = r...

9 years ago | 0

Answered
Algorithm conversion with code generation
You don't have a color image. You have a purely grayscale image. So trying to extract the red green and blue planes is waste of ...

9 years ago | 0

Answered
plot x^2+y^3+z^4=1
You only need to go as high as 1 for a solution to exist. Beyond that point in x, y, or z, you are raising a number greater than...

9 years ago | 0

Answered
Solving 3-variable implicit equations
If the equations have symbolic coefficients, then you have no choice but to use solve. If all of the coefficients are known n...

9 years ago | 0

Answered
Fast data structure for tabu list?
Sparse matrices are NOT the answer here. In fact, that would be an actively terrible reason to use a sparse matrix. You might...

9 years ago | 0

Answered
How to plot a multiplication of two unit step functions (denoted by u(t)) ? Function I need the plot for is : F(t) = u(t) * u(10 - t)
u = @(t) double(t >= 0); v = @(t) u(t).*u(10-t); ezplot(v,[-10,20]) WTP?

9 years ago | 0

| accepted

Answered
Alternative for lsqcurvefit, to do nonlinear regression
Too many to count. - lsqnonlin (optimization toolbox) - fmincon (optimization TB, you write the objective function) - n...

9 years ago | 1

Answered
Unexpected results from 'exp2' least squares fit
Sums of exponential fits are difficult to solve. They are HIGHLY susceptible to starting value choices. <</matlabcentral/answ...

9 years ago | 0

| accepted

Answered
finding all sets that satisfy an under-determined equation?
As Walter points out, even such a simple problem as 2*x + 1*y + 4*z + 1*t = 0 has infinitely many solutions. If you rest...

9 years ago | 0

Answered
Warning: Cannot solve symbolically. Returning a numeric approximation instead.
So, what does the warning message say? It is not an error. Merely a statement of fact. Surely there are some equations that h...

9 years ago | 0

| accepted

Answered
How to set constraints for outpus of objective function in fmincon
If x1,x2,x3 are optimization parameters, then it is simple. Case 1 is simply a set of bound constraints. As I said, fmincon e...

9 years ago | 0

Answered
Interpolation, keep average over certain range to fixed value
Sorry. But interpolation tools (including any that I have ever written) do not allow a constraint that lets you tell it to maint...

9 years ago | 0

Answered
Intersection of two line segments
No, at least not for line segments. Lines are trivial. But you can download intersections from the file exchange, written by ...

9 years ago | 0

| accepted

Answered
about surface plot and its code
So you have generated a surface plot, thus a surface of the form z(x,y). Now you want to find some simple "function" that can...

9 years ago | 1

| accepted

Answered
can anyone provide a code for converting 2d point into 3d cordinate system
Sure. Trivial to do, in fact. xy2xyz = @(x,y) [x,y,1]; For any value of x and y, this creates a new set of coordinates i...

9 years ago | 0

| accepted

Answered
Moving a curve in one axis to ascertain area under the curve is zero
This answer gets complicated, because it looks forward to a problem that you have not foreseen, but you will probably trip over ...

9 years ago | 1

| accepted

Answered
Why 'lsqcurvefit' doesn't work well?
Your starting values were terrible. x = lsqcurvefit(fitfun,[10 15],xdata,ydata,lb,ub) Local minimum possible. ...

9 years ago | 0

Answered
Smoothening 3D isosurface plot as shown in the attached image.
It seems quite smooth to me. And, sorry, but smoothing tools do not apply to a surface like this anyway, since it does not repre...

9 years ago | 0

Answered
Solve Ax=b with LU factorization
The matrix is singular! Hint: read the error message. There is no solution. Worse, there could NEVER be a solution, even if t...

9 years ago | 0

| accepted

Load more