Created
September 28, 2023 06:31
-
-
Save rikka0w0/2dd4b63f49f0ed021e736b35b8e164ce to your computer and use it in GitHub Desktop.
Plot TI's memory dump in matlab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Specify the file path | |
file = 'D:\1.txt'; | |
count = 4; | |
length = 256; | |
% Open the file for reading | |
fid = fopen(file, 'r'); | |
% Read all lines from the file | |
data = textscan(fid, '%f', 'HeaderLines', 1); | |
% Close the file | |
fclose(fid); | |
% Extract the array from the cell array | |
recorded = data{1}'; | |
clear data fid | |
data = zeros(count, length); | |
for i = 1:count | |
start_i = (i-1)*length+1; | |
end_i = i*length; | |
data(i, :) = recorded(start_i:end_i); | |
end | |
% Time vector | |
sampling_frequency = 4000; | |
time = (0:length-1) / sampling_frequency; | |
% Display the imported array | |
figure | |
%plot(time, data) | |
subplot 211 | |
plot(time, data(2,:)); | |
subplot 212 | |
hold on | |
plot(time, data(1,:)); | |
plot(time, data(3:end,:)); | |
hold off | |
legend 'ia' 'id' 'iq' | |
figure | |
hold on | |
plot(time, data(1,:)*10); | |
plot(time, data(2,:)); | |
legend 'iax10' 'valpha' | |
hold off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment