Answered
To calculate the area under a series of curves
First, the for loops should both be: for i = 1:cycl The areas calculation appears to be straightforward: for i=1:cycl AUC ...

6 years ago | 1

| accepted

Answered
Non-linear curve fitting for forced vibration acceleration data
There are some errors. First, ‘w’ should be calculated by multiplying it by , or using the deg2rad function. It also needs t...

6 years ago | 1

| accepted

Answered
Solving nonlinear equations using fmincon
The error is straightforward: Error using fmincon (line 635) Supplied objective function must return a scalar value. This is...

6 years ago | 0

| accepted

Answered
Selecting a part of the frequency spectrum
It is difficult to follow what you are doing, however it appears that you are ignoring half of the fft results, and that is caus...

6 years ago | 0

Answered
FFT Plot different Vector not same length?
Try this: plot(t, f(1:n)), hold on plot (freq(L), fhat(L)), hold on plot (t,ffilt(1:n)); Note that with no knowldege of ‘...

6 years ago | 1

| accepted

Answered
How to generate a vector of a shifted impulse function?
‘If we write, d=dirac(x-25), it does not shift the impulse function like the H=heaviside(t-25) translates the heaviside function...

6 years ago | 1

| accepted

Answered
Calculation of mean signal frequency
There are two small errors. Correcting them: P2 = abs(Y/L).^2; % Power = Amplitud...

6 years ago | 0

| accepted

Answered
Counting number of individuals between a box
Try this: A = [1 25 58 2 18 30 3 5 45 4 26 60 5 27 61 6 14 ...

6 years ago | 0

Answered
How can I control the behavior of tabulated data
If the voltage signal is not noisy, one option to get ‘T2’ would be to use the gradient function to get the approximate numerica...

6 years ago | 0

Answered
digital signal related question(fft,pspectrum)
If you only want to isolate those two frequencies, use the bandpass function to design filters for each frequency. (That group ...

6 years ago | 0

| accepted

Answered
How find FWHM for large numbers of plots?
Try this: x=-4:5; for k = 1:numel(x) z=x(k).^2; y(k) = z; end [miny,idx] = min(y); left_x = interp1(y(1:idx),x...

6 years ago | 1

| accepted

Answered
nlinfit ERROR ( Matrix dimensions must agree.)
Try this: %Model to fit NiHCF % % % MAPPING: tao = b(a), n = b(2) Model_Fit = @(b,R) (67.4.*1.2).* (1-((R.*b(1)).^b(2)))....

6 years ago | 1

| accepted

Answered
plotting 4 variables in the same graph
I have no idea what ‘s’ is, since it only appears in your question, not in your code. Try this: syms y(t) t Y a b [V,Subs...

6 years ago | 0

Answered
Assinging variable names to data read from files
Use readtable (R2013b and later versions) and then define a cell array of VariableNames to use with it.

6 years ago | 0

Answered
DateTime equal but report not equal
They are not the same: Time1=datetime('04:00:00','InputFormat',"HH:mm:ss") Time2=datetime(0,0,0,4,0,0) produces: Time1 = ...

6 years ago | 1

| accepted

Answered
replacing Nan with 0
Try this: auPoints - fillmissing(auPoints, 'constant',0); It might be advisable to save the output to a different variable, i...

6 years ago | 1

Answered
How do I plot all the points on a matrix (in 3d) with the x and y being the locations of the elements of the matrix, and the z being the value of the elements?
Try this: M = rand(49); % Original Matrix [rv,cv] = ndgrid(1:size(M,1), 1:size(M,2)); ...

6 years ago | 1

| accepted

Answered
how to read day of the year as datetime ?
Another approach: ydv = [2019001 2019002 2019364 2019365]; % ‘Y...

6 years ago | 0

Answered
Dealing with NaN values in FFT
If you have R2016b or later, the fillmissing function is an option.

6 years ago | 2

| accepted

Answered
fplot shows no output
Try this: figure fplot(real(psolution)) hold on fplot(imag(psolution)) hold off grid set(gca, 'YScale','log', 'Ylim',[mi...

6 years ago | 0

Answered
Butterworth Bandpass filter issues
That is likely asking too much of a Butterworth design. Use an elliptic filter instead: Fs = 44100; ...

6 years ago | 0

| accepted

Answered
ODE not evaluating correctly with time dependent parameter
Create ‘kred’ and ‘kox’ as anonymous functions, and it runs: Eo = 0.4; Ei = 0; v = -0.1; a = 0.5; F = 96485.33289; R = 8....

6 years ago | 0

| accepted

Answered
nlparci() resid length
If you have two curves of 4 data points each, the length of resid is 4, since each curve will create 1 residual value of each da...

6 years ago | 0

Answered
Polar Plot with 3rd variable
The text function should be able to do that.

6 years ago | 0

| accepted

Answered
find index of missing data point/ extrapolatation
Another option: A1= load('data.txt'); T=A1(:,1); %Time I=A1(:,2); %Current [Imx,iImx]=max(I); %locate peak value and index...

6 years ago | 0

| accepted

Answered
x-y plot: how to shade the difference between two lines in multiple colors
Correct idea, not quite the correct approach. Try this: t= 0:.01:1; AA = cos(t); BB= sin(t); Lv = AA > BB; ...

6 years ago | 2

| accepted

Answered
How to change axis label position on a figure in MATLAB?
It is not possible to re-position them, so use text objects to create the axis labels in the appropriate positions. Try somet...

6 years ago | 0

Answered
ode solver returns too many results
The problem is that ‘y’ is a (3x1) vector, and ‘mo’ is evaluating each value for all values of ‘y’. Perhaps you intend: fun...

6 years ago | 2

| accepted

Answered
Displaying percentage signs in a table
Unfortunately, not in R2018b. (Thank you for providing that information.) From the documentation: ‘Starting in R2019b, you c...

6 years ago | 2

| accepted

Answered
Solving a third a cubic polynom for a certain for a fixed Y value
Solve for the roots, regardless: syms x y = 9e-11*x.^3 - 2e-07*x.^2 - 5e-05*x + 1.0009; ys = solve(y == 0.7) ys = vpa(ys) ...

6 years ago | 0

Load more