Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

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

quasi 15 anni fa | 2

| accettato

Risposto
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, ...

quasi 15 anni fa | 0

Risposto
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);...

quasi 15 anni fa | 1

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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);...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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....

quasi 15 anni fa | 1

| accettato

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

Risposto
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...

quasi 15 anni fa | 0

Risposto
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...

quasi 15 anni fa | 1

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

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

Risposto
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 ...

quasi 15 anni fa | 0

| accettato

Risposto
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]) = ...

quasi 15 anni fa | 0

| accettato

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

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 1

| accettato

Risposto
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...

quasi 15 anni fa | 0

Risposto
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...

quasi 15 anni fa | 1

| accettato

Risposto
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 ...

quasi 15 anni fa | 0

Risposto
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...

quasi 15 anni fa | 3

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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=...

quasi 15 anni fa | 1

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

quasi 15 anni fa | 0

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

| accettato

Risposto
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...

quasi 15 anni fa | 0

| accettato

Carica altro