Engineer - mechanices /ekectronics / signal processing

Average matlab user for 20 years now.

Professional Interests: signal processing, adaptive control, noise and vibration processing

Answered

while loop in a for loop

hello again official answer below : code fixed !! the output of the function was incorrect (wrong index and not at the right...

while loop in a for loop

hello again official answer below : code fixed !! the output of the function was incorrect (wrong index and not at the right...

alrededor de 6 horas ago | 0

Answered

Zeros between Sign Change of Values in column

hello this is my suggestion below + see attachements data = importdata('data.txt'); x = data(:,1); y = data(:,2); thr...

Zeros between Sign Change of Values in column

hello this is my suggestion below + see attachements data = importdata('data.txt'); x = data(:,1); y = data(:,2); thr...

5 días ago | 0

Answered

I want to do loop operation of these files but fail to get the desired result. Can anyone help me to figure out the problem?

hello I tweaked a bit your code , if fact it was simpler in my opinion to do the full 4 x 4 loops instead of doing the specifi...

I want to do loop operation of these files but fail to get the desired result. Can anyone help me to figure out the problem?

hello I tweaked a bit your code , if fact it was simpler in my opinion to do the full 4 x 4 loops instead of doing the specifi...

5 días ago | 0

| accepted

Answered

Assign same linewidth to a grouped barplot

hello v1=rand(10,1); v2=rand(10,1); x=[1:10]; combined=[v1,v2]; barplot=bar(x,combined,'grouped'); barplot(1).BarWidth = ...

Assign same linewidth to a grouped barplot

hello v1=rand(10,1); v2=rand(10,1); x=[1:10]; combined=[v1,v2]; barplot=bar(x,combined,'grouped'); barplot(1).BarWidth = ...

5 días ago | 1

| accepted

Answered

Generate Frequency domain with FFT function of 3-axis accelerometer data

hello see this example - you can adapt it to your own needs all the best %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load s...

Generate Frequency domain with FFT function of 3-axis accelerometer data

hello see this example - you can adapt it to your own needs all the best %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load s...

5 días ago | 0

Answered

Remove rows from table identified in a second string array

hello Christopher thi would be my suggestion notice I changed the last 3 names in Post_Inflate_names to get a matching case ...

Remove rows from table identified in a second string array

hello Christopher thi would be my suggestion notice I changed the last 3 names in Post_Inflate_names to get a matching case ...

6 días ago | 0

Answered

Fit an exponential function to time-series data

hello this is the poor man solution without any toolbox data was stored in txt file your B = -1/b_sol from my code below ...

Fit an exponential function to time-series data

hello this is the poor man solution without any toolbox data was stored in txt file your B = -1/b_sol from my code below ...

6 días ago | 1

Answered

How to identify datasegments that correlate to a given frequency

hello Katy I built this on your code, so first option is to see if the time interval between consecutive peaks are similar or n...

How to identify datasegments that correlate to a given frequency

hello Katy I built this on your code, so first option is to see if the time interval between consecutive peaks are similar or n...

6 días ago | 0

Answered

Rename dynamically columns name of a vector inside of a for loop

hello Sara if you stick to the eval method , this is how you should code it : eval(['d_' num2str(kk) ' = d;'])

Rename dynamically columns name of a vector inside of a for loop

hello Sara if you stick to the eval method , this is how you should code it : eval(['d_' num2str(kk) ' = d;'])

6 días ago | 0

| accepted

Answered

How can I change the color of the face of a cube created using the slice command?

hello use handles to modify face colors here I changes all external faces to black [X,Y,Z] = meshgrid(0:3); V = X.*exp(-X....

How can I change the color of the face of a cube created using the slice command?

hello use handles to modify face colors here I changes all external faces to black [X,Y,Z] = meshgrid(0:3); V = X.*exp(-X....

6 días ago | 0

Answered

How do I add noise to a sine wave signal to get the output below

hello simply the time vector was not correct , just define it once for all plots (and with max value = 10 s and not 1 s) als...

How do I add noise to a sine wave signal to get the output below

hello simply the time vector was not correct , just define it once for all plots (and with max value = 10 s and not 1 s) als...

6 días ago | 1

| accepted

Answered

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

10 días ago | 0

| accepted

Answered

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

10 días ago | 1

| accepted

Answered

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

11 días ago | 0

| accepted

Answered

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

12 días ago | 0

| accepted

Answered

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

12 días ago | 0

Answered

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

13 días ago | 0

Answered

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

13 días ago | 0

Answered

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

13 días ago | 0

Answered

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

13 días ago | 0

| accepted

Answered

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

13 días ago | 0

Answered

How do I solve two different differential equations at the same time?

hello to do simple integration, you could start with cumtrapz to get the velocity data (from the force inputs) the time vecto...

How do I solve two different differential equations at the same time?

hello to do simple integration, you could start with cumtrapz to get the velocity data (from the force inputs) the time vecto...

13 días ago | 1

Answered

How to use output numbers as a vector.

hello see bleow : clear variable clc a=input('Please input a vector of integers : '); c=length(a); for d = unique(a(:)) ...

How to use output numbers as a vector.

hello see bleow : clear variable clc a=input('Please input a vector of integers : '); c=length(a); for d = unique(a(:)) ...

13 días ago | 0

Answered

How do I fix my x-axis ?

hello here you are : x = 0:1e-3:2; y1=8*cos(2*pi*x); y2=8*cos(19*pi*x).*exp(-x); figure(1),plot(x,y1,x,y2)

How do I fix my x-axis ?

hello here you are : x = 0:1e-3:2; y1=8*cos(2*pi*x); y2=8*cos(19*pi*x).*exp(-x); figure(1),plot(x,y1,x,y2)

17 días ago | 1

| accepted

Answered

Write legend on for loop plot

hello try this : X = [1.182, 1.6, 1.7, 1.8, 1.9, 2] NumberOfScenarios = [1, 2, 3] Scenarios = string(NumberOfScenarios); ...

Write legend on for loop plot

hello try this : X = [1.182, 1.6, 1.7, 1.8, 1.9, 2] NumberOfScenarios = [1, 2, 3] Scenarios = string(NumberOfScenarios); ...

20 días ago | 1

| accepted

Answered

Find the value at exact location in a text file

hello hope this helps I used the attached function to load the data (FYI) % demo clc clearvars; % load data [outdat...

Find the value at exact location in a text file

hello hope this helps I used the attached function to load the data (FYI) % demo clc clearvars; % load data [outdat...

20 días ago | 0

Answered

ECG signal filtering problem

hello a little tool to do the fft anamysis (and notch filter demo included) clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...

ECG signal filtering problem

hello a little tool to do the fft anamysis (and notch filter demo included) clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...

21 días ago | 0

Answered

How analyze PMU data in the form of sinusoidal waveform?

hello I am not sure what your data represents, but FYI, this is a code to do spectral analysis (averaged fft and spectrogram) ...

How analyze PMU data in the form of sinusoidal waveform?

hello I am not sure what your data represents, but FYI, this is a code to do spectral analysis (averaged fft and spectrogram) ...

21 días ago | 1

| accepted

Answered

How to smooth a curve

hello your post is a bit rude, please take 10 seconds to say hello and introduce your topic; that would be a little more respe...

How to smooth a curve

hello your post is a bit rude, please take 10 seconds to say hello and introduce your topic; that would be a little more respe...

21 días ago | 0

Answered

How to resample frequency domain signal?

hello first code below : this is a script showing true averaging (even on complex Y data) over N samples your ac...

How to resample frequency domain signal?

hello first code below : this is a script showing true averaging (even on complex Y data) over N samples your ac...

21 días ago | 0

| accepted