Find x values where y values are the same from a set of data.
I have 2 datasets from a continuous signal that will display a voltage in 1 set of data (D8) and repeat that voltage in data set D2 after a randomized delay. I need to find the voltage and time these repetitions occur, but I’m unsure of how to do that.
My code finds these repetitions, removes where the 2 datasets intercept as there’s no delay going on there, and displays the time of the repetitions. I need the original voltage, the original time from D8, and the delayed time in D2 when the repeated value occurs.
data = load(‘DatasSet2_Test.txt’); %my directory is different but it includes my name so it just calls the attached file
%Characterize columns
t1 = data(:,1)/1000; %convert time from ms to s
%convert from bits to V
resolution = 2^10-1;
%Data as assigned pairs *10^8 to transfer within the MeV to GeV range
D1 = (data(:,2)*5)/resolution*10^8; D2 = (data(:,3)*5)/resolution*10^8;
D3 = (data(:,4)*5)/resolution*10^8; D4 = (data(:,5)*5)/resolution*10^8;
D5 = (data(:,6)*5)/resolution*10^8; D6 = (data(:,7)*5)/resolution*10^8;
D7 = (data(:,8)*5)/resolution*10^8; D8 = (data(:,9)*5)/resolution*10^8; %all in V
c1 = D8(:)==D2 %finds same voltage indep of time occuring
x1values1 = t1(find(c1)); %Gives time of repeated values
r1usure1 = t1(find(intersect(D8,D2))); %checks for intersections as they don’t include delay
l1 = setdiff(x1values1, r1usure1); %Gives time of repeated values excluding intersections
This is the code I have so far, but it only checks for similar values and returns repeated time values instead of including the original time, and I’ve been struggling to find the associated voltages. I have also attached the file with the signals where the first column is time, column 3 is D2 in V, and column 9 is D8 in V.
This might not be well explained so I will answer questions as quickly as possible. Thank you in advance !I have 2 datasets from a continuous signal that will display a voltage in 1 set of data (D8) and repeat that voltage in data set D2 after a randomized delay. I need to find the voltage and time these repetitions occur, but I’m unsure of how to do that.
My code finds these repetitions, removes where the 2 datasets intercept as there’s no delay going on there, and displays the time of the repetitions. I need the original voltage, the original time from D8, and the delayed time in D2 when the repeated value occurs.
data = load(‘DatasSet2_Test.txt’); %my directory is different but it includes my name so it just calls the attached file
%Characterize columns
t1 = data(:,1)/1000; %convert time from ms to s
%convert from bits to V
resolution = 2^10-1;
%Data as assigned pairs *10^8 to transfer within the MeV to GeV range
D1 = (data(:,2)*5)/resolution*10^8; D2 = (data(:,3)*5)/resolution*10^8;
D3 = (data(:,4)*5)/resolution*10^8; D4 = (data(:,5)*5)/resolution*10^8;
D5 = (data(:,6)*5)/resolution*10^8; D6 = (data(:,7)*5)/resolution*10^8;
D7 = (data(:,8)*5)/resolution*10^8; D8 = (data(:,9)*5)/resolution*10^8; %all in V
c1 = D8(:)==D2 %finds same voltage indep of time occuring
x1values1 = t1(find(c1)); %Gives time of repeated values
r1usure1 = t1(find(intersect(D8,D2))); %checks for intersections as they don’t include delay
l1 = setdiff(x1values1, r1usure1); %Gives time of repeated values excluding intersections
This is the code I have so far, but it only checks for similar values and returns repeated time values instead of including the original time, and I’ve been struggling to find the associated voltages. I have also attached the file with the signals where the first column is time, column 3 is D2 in V, and column 9 is D8 in V.
This might not be well explained so I will answer questions as quickly as possible. Thank you in advance ! I have 2 datasets from a continuous signal that will display a voltage in 1 set of data (D8) and repeat that voltage in data set D2 after a randomized delay. I need to find the voltage and time these repetitions occur, but I’m unsure of how to do that.
My code finds these repetitions, removes where the 2 datasets intercept as there’s no delay going on there, and displays the time of the repetitions. I need the original voltage, the original time from D8, and the delayed time in D2 when the repeated value occurs.
data = load(‘DatasSet2_Test.txt’); %my directory is different but it includes my name so it just calls the attached file
%Characterize columns
t1 = data(:,1)/1000; %convert time from ms to s
%convert from bits to V
resolution = 2^10-1;
%Data as assigned pairs *10^8 to transfer within the MeV to GeV range
D1 = (data(:,2)*5)/resolution*10^8; D2 = (data(:,3)*5)/resolution*10^8;
D3 = (data(:,4)*5)/resolution*10^8; D4 = (data(:,5)*5)/resolution*10^8;
D5 = (data(:,6)*5)/resolution*10^8; D6 = (data(:,7)*5)/resolution*10^8;
D7 = (data(:,8)*5)/resolution*10^8; D8 = (data(:,9)*5)/resolution*10^8; %all in V
c1 = D8(:)==D2 %finds same voltage indep of time occuring
x1values1 = t1(find(c1)); %Gives time of repeated values
r1usure1 = t1(find(intersect(D8,D2))); %checks for intersections as they don’t include delay
l1 = setdiff(x1values1, r1usure1); %Gives time of repeated values excluding intersections
This is the code I have so far, but it only checks for similar values and returns repeated time values instead of including the original time, and I’ve been struggling to find the associated voltages. I have also attached the file with the signals where the first column is time, column 3 is D2 in V, and column 9 is D8 in V.
This might not be well explained so I will answer questions as quickly as possible. Thank you in advance ! indexing, find function, repeated values MATLAB Answers — New Questions









