필터 지우기
필터 지우기

Interpolating two different size of tables

조회 수: 1 (최근 30일)
rajasekar dhandapani
rajasekar dhandapani 2020년 8월 17일
댓글: rajasekar dhandapani 2020년 8월 18일
Table 1: Ts = [0.003,0.0033,0.0004,0.006.....] ; Torque =[10,20,30,40....]
Table 2 Ts1ms=[0.001,0.002,0.003,0.004,0.005......]; Torque=[????]
Expected Result
Table 3:
Ts1ms Torque
0,001 10
0,002 10
0,003 10
0.004 30
0.005 35
....
I have table 1 data. I need to find for Ts1ms data what is the torque
Based on table 2 I have to find the interpolated data from Table 1
Could someone help me with this ?
Thanks in advance
  댓글 수: 2
Matt J
Matt J 2020년 8월 17일
When you say you have your data as tables, do you really mean tables?
rajasekar dhandapani
rajasekar dhandapani 2020년 8월 17일
yes i Meant table array... It can also be a matrix.

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

채택된 답변

KSSV
KSSV 2020년 8월 17일
REad about interp1.
Torque1ms = interp1(Ts,Torque,Ts1ms) ;
  댓글 수: 6
rajasekar dhandapani
rajasekar dhandapani 2020년 8월 17일
편집: rajasekar dhandapani 2020년 8월 17일
Please find the code below. ALso please find the attached data 'data.mat'
fs=1000; %sampling frequency
Ts=1/fs; %sampling time 1ms
ts=0.001:Ts:65.469; %adjusting the matrix length
X=ts*1000; %s to ms
Result=ts.'; %Transpose matrix
Result1=array2table(Result); % array to table conversion
b=Result1.Result;
New=interp1(Data.ts,Data.ENG_TRQ_AFTR_REDNm,b); %interpolated data
rajasekar dhandapani
rajasekar dhandapani 2020년 8월 18일
Any further leads would be appreciated :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by