Plot data from txt file
显示 更早的评论
Hello.
I plotted a set of data (860000 samples) getting the followed plots:
Plot 1: Emitted Signal from NAA Station (Phase)
Plot 2: Emitted Signal from NAA Station (Amplitude)
The data were taking as 10 samples per second (see attached file named Figure 1), i.e., in second 0 the are 10 numbers, in second 1 another 10 numbers, and so on.
However, when I analyze the plots, is possible to see that there are more than 10 data (>>10 numbers) in 0s, the same for second 1 and so on.
I will appreciated your help.
Regards.
unzip('Data 2.zip'),movefile('Data 2.txt','10_03_2012_Modificado.txt')
clear;
data = readmatrix('10_03_2012_Modificado.txt');
T = data(:,1);
T = seconds(data(:,1));
T.Format = 'hh:mm';
T2 = data(:,2);
figure;
plot (T,T2,'x');
title 'Emitted Signal from NAA Station';
ylabel ('Phase');
xlabel ('Samples');
T = data(:,1);
T = seconds(data(:,1));
T.Format = 'hh:mm';
T3 = data(:,3);
figure;
plot (T,T3,'x');
title 'Emitted Signal from NAA Station';
ylabel ('Apmlitude');
xlabel ('Samples');
2 个评论
I am not certain what you want to do.
The time vector appears to be consistent. The only detail that I can add is to combine the amplitude and phase data to create a complex signal and then plot the magnitude of the result —
Uzp = unzip('Data 2.zip');
A1 = readmatrix(Uzp{1})
t = seconds(A1(:,1));
figure
yyaxis left
plot(t, A1(:,2))
ylabel('Phase (°)')
grid
yyaxis right
plot(t, A1(:,3))
ylabel('Amplitude')
xlabel('Time')
xlim([t(1) t(end)])
cs = A1(:,3) .* exp(1j*deg2rad(A1(:,2))); % Complex Signal
figure
plot(t, abs(cs))
grid
xlabel('Time')
ylabel('Magnitude')
xlim([t(1) t(end)])
I do not know what the result is supposed to look like, or what the data actaully represent.
.
Angel Lozada
2023-6-10
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




