Answered
Power function fitting with my data
Since you have not posted your data, it is difficult to help you very much. But... You can use polyfit to fit the linear curv...

8 years ago | 0

| accepted

Answered
ToolBox for Zernike polynomial surface_Fitting
You can find tools for evaluation of Zernike polynomials on the file exchange, here: <https://www.mathworks.com/matlabcentral...

8 years ago | 0

Answered
Integrating a curve fitted with Sgolay
1. You are not fitting your data using sgolayfilt. All that does is try to reduce the noise in the data, assuming the underlying...

8 years ago | 0

Answered
How to create a symbolic expression with a string like '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1'?
str2sym( '5.01e-7*x2 - 5.01e-7 + (-9*x1 + 4)/x1') ans = 0.000000501*x2 - (9*x1 - 4)/x1 - 0.000000501

8 years ago | 0

| accepted

Answered
Matlab 2018a with parallel computing too slow
Parallel computing need not always gain. Why not? Because MATLAB already automatically does some multi-threading when it thinks ...

8 years ago | 0

Answered
Why is ScatteredInterpolant (linear) returning a value far outside of input data?
You are making a major error here in what you are trying to do. plot3(inX,inY,inZ,'bo') box on grid on Now, rotate...

8 years ago | 2

| accepted

Answered
How to obtain integer solutions only with fsolve?
Far too late to answer this, but worth explaining how to solve it. Intlinprog, has been suggested is not a viable solution, b...

8 years ago | 1

| accepted

Answered
Numerical evaluation of integral gives warning message
Ignoring the fact that you cannot just factor out -1 from that term in the integral, and get what you think you got, we have the...

8 years ago | 0

Answered
First-order optimality of system of non-linear equations is not converging to 0
A basic presumption of fsolve is that the objective equations to be solved are continuous and differentiable. Your equations ALL...

8 years ago | 1

Answered
Functions vs scripts: speed
Option B is a REALLY bad programming style. It is slow, as you found out. It prevents MATLAB from optimizing your code for effic...

8 years ago | 3

Answered
Hot to create a matrix with elements which moves to right as row increases
There are MANY ways to solve this. I'm not at all sure what the final dimension of the matrix is expected to be. Is it 100x100? ...

8 years ago | 2

| accepted

Answered
Function of the interpolation function
Um, you said interpolation, but you never said what kind of interpolation was used. The crystal ball is very foggy today, so I a...

8 years ago | 0

Answered
outputs of generated code are NAN
The crystal ball is so foggy today. Strange, because it is a nice, sunny day here. Sorry, but we cannot read your mind, nor c...

8 years ago | 0

Answered
Is it possible to partition a curve and fit it using different funtions
Yes. If you know what you are doing. But that means you need to learn about how to use piecewise functions. You need to learn ab...

8 years ago | 0

Answered
Hi.I have been trying a lot to "find" the answer. I still can not get it.
The error? Yours, in making an assumption about floating point arithmetic, and how numbers are stored. x1=(0:0.001:50 )'; ...

8 years ago | 0

Answered
Am I allowed to write functions that have names of matlab functions (copyright)?
I am not a lawyer. But I would argue that it is the code that matters, and the code that has a copyright, which will reside in t...

8 years ago | 0

Answered
What's the difference between gammainc & igamma? Which one should I use to compute incomplete upper gamma function? Which one is scaled??
igamma lives in the stats toolbox. It gives you an upper tail integral. gammainc lives in MATLAB proper. gammainc is scaled. ...

8 years ago | 2

| accepted

Answered
How to get a set of elements from a matrix given a set of index pairs?
If you want efficiency, assuming your real problem is much larger, then you need to learn how to use sub2ind. That means you nee...

8 years ago | 0

| accepted

Answered
How I generate random numbers with constraints?
This is NOT that hard to do. Yeah, I know it seems hard as hell. The first trick is to build a triangulation that describes t...

8 years ago | 0

Answered
I would like to offer a new algorithm to Matlab. Whom should I contact?
Contact nobody. Seriously, just because you have a neat new algorithm, the odds of The MathWorks wanting to add it to the la...

8 years ago | 3

| accepted

Answered
How to obtain the number of asymptotes from a function handle?
I will suggest what you are lacking is a basic understanding of modeling and statistics. Of the concepts of replication of a dat...

8 years ago | 1

Answered
Which one is faster: trace(a' * b) or sum(sum(a .* b', 2))?
Well, I could tell you, but then... Seriously, I cannot tell you, because this is something I cannot know. Nor can anyone els...

8 years ago | 1

Answered
Problem In curve fitting
You won't find a function that fits any arbitrary, essentially scattered set of data. And that is what you seem to have. Anyw...

8 years ago | 0

| accepted

Answered
Simple function constrainting a polyfit with lsqlin is giving strange fits
Is this homework? It seems more sophisticated than the classical homework assignment, so I will guess not. But, sorry, just thro...

8 years ago | 0

| accepted

Answered
3D interpolating polynomial
Now that you have shown the problem you are trying to solve... I'm pretty sure I remember telling you that you should not use...

8 years ago | 0

Answered
I have a 6x6 symbolic matrix A that I want to inverse. I am trying both inv(A) an d A\I to do the inversion. However, it takes forever (more than a day) until I stop it. My hardware is also very good. Core i7, 16 GN RAM.
People think their computers are huge. Super fast. They can do anything. So they get spoiled, expecting anything to work like th...

8 years ago | 3

| accepted

Answered
Finding x such that 1 is eigenvalue
You are trying to do too much in one line. Making your code super compact does nothing, except make it unreadable. And it did no...

8 years ago | 0

| accepted

Answered
exp*prod*exp(x(lnx)^k) solving equation
Read what I said. Again. TAKE THE LOG!!!!!!! That gives you something like this: -lambda*pi*r^2*P + lambda*pi*R^2*P*(log(P)...

8 years ago | 1

| accepted

Answered
Does interp3 (with linear option) perform trilinear interpolation?
Both interp2 and interp3 use n-dimensional tensor product linear interpolation, thus respectively bilinear and trilinear interpo...

8 years ago | 2

| accepted

Answered
Order of roots obtained from function roots
Roots does not assure any specific order of the returned roots, nor should it rationally do so. Feel free to sort them in any...

8 years ago | 1

| accepted

Load more