필터 지우기
필터 지우기

How do I compare data sets of different lengths?

조회 수: 28 (최근 30일)
Jonathan Copley
Jonathan Copley 2018년 11월 18일
편집: Jonathan Copley 2018년 11월 19일
We have a total of 4 columns of data 2 columns are for one program and the other 2 columns are for another program. We are trying to correlate the data and find the slope of the line between the all 4 columns of data. The issue is that the data sets are of unequal length because the frequency of data collection we are using on two pieces of equipment are different and cannot be changed. So, for example, one piece of equipment is taking data at a speed of 100 data points per second where the other piece of equipment is taking one data point per second. This causes the data sets to be completely different in length. I am compiling all 4 columns into one spreadsheet.
As of now, the first two columns start in A and B are begin at row 35 and end at 195. The other two columns are C and D and begin at row 35 and end at 4554. We are trying to plot the data on one line and compare the 4 columns of data onto one plot. A previous code was written and is provided below.
%%Axial Reducer Data Analysis
clc;
clear;
%Call all the data, has to be manually changed
count = xlsread('AR3 Formatted',1, 'A35:A195');
ForceLV = xlsread('AR3 Formatted',1, 'B35:B195');
count2 = xlsread('AR3 Formatted',1, 'C35:C4554');
ForceMM = xlsread('AR3 Formatted',1, 'D35:D4554');
%find the normal factor
num=ceil(size(count2)/size(count))
%setup the averaged array
blockSize= [num, 1];
meanFilterFunction = @(theBlockStructure) mean2(theBlockStructure.data(:));
% Now do the actual averaging (block average down to smaller size array).
ForceMM = blockproc(ForceMM, blockSize, meanFilterFunction);
%will still be a little off, just subtract the first few numbers till the
%length is the same.
ForceLV=ForceLV(6:end);
plot(ForceLV, ForceMM);
%factor=Strainave\force
title('Axial Reducer Calibration')
xlabel('Force Read by Labview (N)')
ylabel('Force Read by MM (N)')
  댓글 수: 6
Star Strider
Star Strider 2018년 11월 18일
I have no idea.
I don’t know the units for either one. That makes any reliable scaling impossible.
Jonathan Copley
Jonathan Copley 2018년 11월 19일
We are converting strain into Force. the first two columns are strain and the second two are in Newtons.

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

답변 (2개)

Haritha
Haritha 2018년 11월 19일
편집: Haritha 2018년 11월 19일
Hi,
First apply padding to matrices for making all the columns as same size. Now it is possible to compare all the columns
  댓글 수: 1
Jonathan Copley
Jonathan Copley 2018년 11월 19일
편집: Jonathan Copley 2018년 11월 19일
Would you recommend filling in the smaller columns with zeros on the end? In other words, I would fill in zeros for the rest of the values for the first two columns until they match the longer array. For the code, I am still trying to compare strain to Force, so the x-axis is still very small. When I try and compare the two, I am not seeing a line just

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


Haritha
Haritha 2018년 11월 19일
yes
  댓글 수: 1
madhan ravi
madhan ravi 2018년 11월 19일
편집: madhan ravi 2018년 11월 19일
@Haritha if you put up an answer use a single answer section don‘t post multiple answers in a single thread.

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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by