Answered
Weibull 0 time failures
I assume you were trying to fit the data using something like parmhat = wblfit(data); I tried a few experiments and it d...

14 years ago | 0

| accepted

Answered
plotting energy as a function of angles
Sounds like you want a polar plot like <http://www.mathworks.com/help/techdoc/ref/polar.html polar> or <http://www.mathworks.com...

14 years ago | 0

Answered
Awkward copy/paste question
If your two vectors are |v1| and |v2|, use: v2(isnan(v1)) = nan;

14 years ago | 2

| accepted

Answered
Counting zeros
In general, no. You can try doing it by counting sign changes, but there is no guarantee you'll catch all the answers. However, ...

14 years ago | 0

Answered
Differentiation Of A Function.
You could do the following (I tack |num| onto the name to indicate it is numerical, not symbolic): Xnum = linspace(-1,1,128);...

14 years ago | 1

Answered
lsqnonneg
x = C\d; *EDIT*: The least squares estimate for |x| is xhat = (C'*C)\(C'*d); You can estimate the error in the fit as fol...

14 years ago | 0

| accepted

Answered
General question about how do I loop this process?
It depends. If you want just line 2645, you could do the following: for ii=1:2644 fgetl(fid); end tline = fgetl(fid);...

14 years ago | 0

| accepted

Answered
error in plotting lyapunov exponent from time series
Is |lyap| supposed to be a variable or the function in the Control Toolbox? If the former, you can't index it with |t| and |x| b...

14 years ago | 0

| accepted

Answered
Multiple Answers From 'solve'
syms theta2 theta4 S=(-4.19*sin(theta2*pi/180)-5.166*sin(theta4*pi/180)+23.3*sin(82.99*pi/180))^2+(-4.19*cos(theta2*pi/180)-5....

14 years ago | 1

| accepted

Answered
How to use who within eval
This is a working example: clear x = zeros(10,1); y = x; save matlab.mat file_name='matlab.mat'; eval('file_length = length(w...

14 years ago | 0

| accepted

Answered
Calculating standard deviation from a confidence interval?
If the underlying distribution of the coefficients is normal, the 95% confidence interval is [mean-2*sigma,mean+2*sigma], so the...

14 years ago | 0

Answered
Constraining a fitted curve
Tricky. Suppose that your fit is y = p(1)*x^3 + p(2)*x^2 + p(3)*x+p(4); You'll need to ensure that the first derivative y...

14 years ago | 0

Answered
Getting divergence of a 3D pointcloud
You have worse than a formatting problem, if your point cloud is, as the name implies, an irregularly spaced collection of point...

14 years ago | 1

Answered
Combining the data
[F(1:end-1)' F(2:end)']

14 years ago | 0

| accepted

Answered
Curve fitting with fails misarebly
I got a nice looking fit using <http://www.mathworks.com/help/toolbox/curvefit/cftool.html cftool> with the type of fit chosen t...

14 years ago | 0

Answered
Accuracy issues when reading data from an input file
You can't do better than that because the decimal numbers are really represented by binary numbers, which can't represent a lot ...

14 years ago | 0

| accepted

Answered
make incorrect values as nan
Here is one way: I = find(diff(T)>1); T(I+1)=NaN; *EDIT*: And here is another using logical indexing: T([1 diff(T)>1]) = ...

14 years ago | 0

| accepted

Answered
accessing particular parts of an array
See <http://www.mathworks.com/company/newsletters/articles/Matrix-Indexing-in-MATLAB/matrix.html;jsessionid=6NB5PLjLyRkpY76DQ0nb...

14 years ago | 0

| accepted

Answered
Cell array summation
The slowdown seems to be caused by the use of cell data for indices into |ItemInfo|. Try this: Ys = sum([ItemInfo{UserDataC...

14 years ago | 1

| accepted

Answered
Cutting time using optimization instead of a potentially endless for loop ?
Certainly there is, but I'm not sure quite how to formulate it with the information given. It will look something like this. Put...

14 years ago | 0

Answered
How to solve an integral?
If you get that warning from the Symbolic Math Toolbox, it may mean that there really is no symbolic solution. You could still i...

14 years ago | 1

| accepted

Answered
How to save struct datatype to disk
What exactly is the problem you are having? If you just want to save the whole structure, save('name.mat',structname) will ...

14 years ago | 0

Answered
Why should I stay?
I always try to steer people asking installation questions to Mathworks Support. I'm guessing that they don't answer such quest...

14 years ago | 3

Answered
fzero problem when doing integration using quadl.
You get those error messages because |quadl| expects a function that can input a vector but |fzero| can only solve for a scalar...

14 years ago | 0

| accepted

Answered
Quadrature method using vectors
One approach is the trapezoidal rule: vecsum = dot(diff(t),x(1:end-1)+x(2:end))/2; or, in loop form, vecsum = 0; for i=...

14 years ago | 1

Answered
w - value
Here is a numerical solution. First, create the file |polyDet.m| with the following code in it: function out = polyDet(x) ...

14 years ago | 0

Answered
Select the largest two numbers with their indices
Here is one approach that is efficient enough: n = 4; h=randn(n)+1i.*randn(n); h2 = sum(h.*conj(h),2); %sum of squares for ea...

14 years ago | 0

| accepted

Answered
xpos(i) in Polygonal domain
You could generate random points in a rectangle enclosing the polygon and then choose the points that lie inside using <http://w...

14 years ago | 0

| accepted

Answered
plot bar graph where each bar represents a range on the x axis?
I think what you're after is hist(x,xbins) where |x| is the data vector and |xbins| is a vector containing the center of eac...

14 years ago | 0

| accepted

Answered
Solving for an x value using ppval
It depends - if |x| and |y| are 1-1, you can just switch them in the above two lines. In general, however, there is probably mor...

14 years ago | 0

| accepted

Load more