Answered
How to find phase difference between two monthly time series ?
This would indicate to me that they are completely out of phase: [r,lags] = xcorr(T1(:,2), T2(:,2)); figure plot(lags, r)...

6 years ago | 0

Answered
Wavenumbers to time(s)
It depends what the units are. The Wikipedia article on Wavenumber includes a diagram on converting to frequency, and from ther...

6 years ago | 1

Answered
Linear segmentation of noisy data
This would be easier with your data. Lacking them, I created my own. Try this: x = 0:32; y = [-0.5*(0:11)+10+randi([-1 1]...

6 years ago | 0

| accepted

Answered
How can I obtain the frequency response and the cutoff frequency from sensor data text file?
I am not certain what you want to do. Try this: data = load('Suctiontest_4.txt'); AA = data(:, 1); % AA = A'; t = 0:0.01...

6 years ago | 0

| accepted

Answered
How can I find time in decimal?
Since it is not certain if ‘time’ is a row or column vector, the most robust option would be: c{1} = calcStart; c{2} = calcEn...

6 years ago | 1

Answered
Help, How do I stop my iteration from going when it gets the answer?
Put in a condition that compares subsequent results with ‘tol’. Change the loop to something like this: yprev = Inf; yd = In...

6 years ago | 1

Answered
Single sided spectrum of vector y obtained using fft
The way I usually calculate and plot it: t = linspace(0, 1, 1E+4); s = sum(sin([0; 100; 200; 300]*2*pi*t*10)) .* randn*10; ...

6 years ago | 0

| accepted

Answered
Plot variables with similar names.
I would do something like this: var = cat(2,var_1(:),var_2(:),var_3(:), ,var_30(:)); % Converts To Column Vectors Reg...

6 years ago | 0

Answered
need help in plotting
There are several options, depending on the result you want: findpeaks, islocalmax, and envelope.

6 years ago | 0

Answered
Fill between two curves is not working
Use the patch function instead: figure patch([x; flipud(x)], [curve1; flipud(curve2)], 'r') producing: .

6 years ago | 0

| accepted

Answered
How could I load specific line to the end of text file?
Try this: fidi = fopen('MulRec_CH1-1.txt','rt'); Datac = textscan(fidi, '%f', 'HeaderLines',14); fclose(fidi); Data = cell2...

6 years ago | 0

Answered
How to measure Peaks and Valleys of wave ?
See if the Signal Processint Toolbox statelevels function will do what you want.

6 years ago | 0

Answered
Shade the encircled area
After the original code in your Question (not your subsequent Comment), add these lines: hold on Ltx = (tx >= -1) & (tx <= 0)...

6 years ago | 1

| accepted

Answered
Reading a file and want to stop when the column ends
Perhaps textscan can do what you want: fid_tr = fopen('Struct.S3E'); c = textscan(fid_tr '%f%*f%*f%*%*f') cd= cell2mat(c); ...

6 years ago | 0

| accepted

Answered
code that a user can input values
I prefer the inputdlg function for user inputs. Example — Valsc = inputdlg('Enter values separated by commas'); Vals = str...

6 years ago | 0

Answered
Finding x value for given y in a zig-zag data.
Use findpeaks (with the original and negative of your data), or islocalmax and islocalmin, to get the peaks and valleys, then f...

6 years ago | 0

| accepted

Answered
How can I add a zoom in the peak of the curve ?
Using these data with the code I provided in my Answer to your previous Question How can I insert a detail in the peak of the cu...

6 years ago | 2

| accepted

Answered
Creating a function 2020a
You are not calling it correctly. Call it (preferably from a script) as: x = 42; y = PBTask4p1_f(x) and: y = 2.46...

6 years ago | 0

Answered
FIR and IIR Comb FIlter
One example of a FIR comb filter is Vibration Analysis FFT - Cut off frequency I like IIR filters, because at least in my ...

6 years ago | 1

| accepted

Answered
i have to slove the case sensitive error.
The ‘i’ is lowercase: imageDatastore .

6 years ago | 0

Answered
Need Greek letter \epsilon_{r} in the 'prompt' argument of input function
Use the inputdlg function instead: opts.Interpreter = 'tex'; EPS_Rc = inputdlg('\epsilon_{r} of the material = ', ' ', [1 35]...

6 years ago | 1

| accepted

Answered
string join does not work for char arrays?
One approach: M = [2; 3; 5; 7; 16]; M2Str = sprintf("%d, ",M(1:end-1)) + string(M(end)) producing: M2Str = "2, 3, 5,...

6 years ago | 0

| accepted

Answered
How can I insert a detail in the peak of the curve ?
Experiment with this: f = @(w,c) 1./(w.^2 + 10*w - c+50); w = linspace(20,80,250); c = (0.1:0.2:0.9).'; figure ax1 = a...

6 years ago | 0

Answered
Help !! How to use Genetic Algorithm for maximisation process as it is used for minimisation process?
Negate the fitness function to select for the maximum: [x,y] = ga(@(x)-fitness(x),nvars,[],[],[],[],LB,UB) Note that this ass...

6 years ago | 1

| accepted

Answered
Plot response graph properties
If you simply want to change the Y-axis tick labels: Ax = gca; yt = Ax.YTick; Ax.YTickLabel = fix(linspace(-25, 25, numel(yt...

6 years ago | 0

Answered
difference between polar and nyquist
Your polar call is only plotting half of the evaluated transfer fuctiion. Try this: num = [10]; den = [1 -2 1]; G = tf(nu...

6 years ago | 1

| accepted

Answered
How can i plot a sine wave using parameters input by user?
I prefer inputdlg, however you need to remembert that the output is a cell array or character vectors. To enter an amplitude ...

6 years ago | 0

| accepted

Answered
Plotting two variables, getting graph and x intercept
Try this: xv = linspace(-6, 4, 25); yv = [1 2 3 4]; for k = 1:numel(yv) ply = [1 6 0 4*(1-yv(k).^2)]; rts(:,k) = r...

6 years ago | 1

| accepted

Answered
Extract elements of a list using their indices
The ‘sharedvals’ result should be what you want, however it returns the identified values without repitition. If you want all o...

6 years ago | 0

| accepted

Answered
query on DFT plotting
It is plotting only the first half of the fft result ‘x_mags’ from 0 to radians. This is the usual approach, since ‘x_mags’ is...

6 years ago | 0

| accepted

Load more