Unsure how to handle .mat data from keysight 34465A

조회 수: 7 (최근 30일)
May Li
May Li 2024년 2월 23일
댓글: Alexander 2024년 2월 23일
I have exported a .mat file from a Keysight 34465A multimeter and would like to plot this data. I have successfully been able to generate a plot, image attached.
The issue I am running into is with the X-axis. I had assumed that this axis would be time starting from 0 seconds, but I am seeing values that do not make sense to me in the Time_s data column of the .mat file. I need help understanding how to convert the values in the Time_s column to actual time in seconds.
Below is the code I'm using to plot the data. Please note that you will need to specify the Data Folder where the .mat file is saved on your machine.
%% Specify folder where files are located
dataFolder = 'enter your own data folder here';
filePattern = fullfile(dataFolder, '*.mat');
Files = dir(filePattern);
%% parsing data and plotting
for k = 1 : length (Files)
baseFileName = Files(k).name;
fullFileName = fullfile(Files(k).folder,baseFileName);
fprintf(1, 'Now reading %s \n', baseFileName);
dmm_data(k,:) = load(fullFileName).'; %.' is non-hermitian transpose
X = dmm_data(k).Time_s;
Y = dmm_data(k).Channel1_Ohm;
xlabel('Time [s]')
ylabel('Resistance [Ohms]')
title('Raw Time vs Raw Resistance')
legend show
grid on
hold on

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 2월 23일
It is easy to make it start from zero by off-setting the first value
X = dmm_data(k).Time_s-dmm_data(k).Time_s(1);
But what do you know about the unit of the data?
After off-setting, the first value is 0, the second value is 3454320
If the unit is second, it is about 40 days.
  댓글 수: 1
Alexander 2024년 2월 23일
And the time is not linear, see plot(diff(Time_s)).

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


Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by