How can I trigger data?
I have three matrix and I want to trigger among them.
I don't known how to start. Please, help me!

댓글 수: 9

Dyuman Joshi
Dyuman Joshi 2023년 10월 3일
"How can I trigger data?
I have three matrix and I want to trigger among them."
What does trigger mean in this context?
Miriã Santos Godói
Miriã Santos Godói 2023년 10월 3일
Oh, sorry.
I have three measure of signal. But, they are displaced in x axis. So, I want to trigger them to start the signal at same point.
Dyuman Joshi
Dyuman Joshi 2023년 10월 3일
Essentially, you want to synchronize them to start at the same point?
Can you share the data you are working with?
Miriã Santos Godói
Miriã Santos Godói 2023년 10월 4일
편집: Miriã Santos Godói 2023년 10월 4일
Yes, if you take a loot at the files, you will see the signal well defined (with a increase of the tension). But, each one start at different time.
A visual aid:
files = dir('*.txt');
n_files = numel(files);
for ii = 1:n_files
files(ii).data = readmatrix(files(ii).name);
end
figure
tl = tiledlayout(n_files,1);
ax = gobjects(n_files,1);
for ii = 1:n_files
ax(ii) = nexttile(tl);
plot(files(ii).data);
title(files(ii).name,'Interpreter','none');
end
linkaxes(ax,'x')
Miriã Santos Godói
Miriã Santos Godói 2023년 10월 5일
Hey, it didn't work. My file is lvm type and I couldn't attach them here.
Voss
Voss 2023년 10월 5일
Can you zip your lvm files and then attach the zip file?
Miriã Santos Godói
Miriã Santos Godói 2023년 10월 5일
OK. These appear to be the same as the text files you already uploaded, only with a different extension.
unzip KCl_50kV_3.zip
% read the text files
txt_files = dir('*.txt');
n_files = numel(txt_files);
for ii = 1:n_files
txt_files(ii).data = readmatrix(txt_files(ii).name);
end
% read the lvm files
lvm_files = dir('*.lvm');
n_files = numel(lvm_files);
for ii = 1:n_files
lvm_files(ii).data = readmatrix(lvm_files(ii).name,'FileType','text');
end
% compare each one
isequaln(txt_files(1).data,lvm_files(1).data)
ans = logical
1
isequaln(txt_files(2).data,lvm_files(2).data)
ans = logical
1
isequaln(txt_files(3).data,lvm_files(3).data)
ans = logical
1
Anyway, what do you want to do? Do you want to shift the data from file 1 and file 3 such that the big dips in the plots I created above are lined up with the big dip in the plot for file 2?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Biotech and Pharmaceutical에 대해 자세히 알아보기

질문:

2023년 10월 3일

댓글:

2023년 10월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by