필터 지우기
필터 지우기

For all content of myData structure, for channels (speed, drs, time, Gap) interpolate all in distance and return the same structure

조회 수: 2 (최근 30일)
I have a data structure called myData, I want to interrogate the structure to find any of the following:
myData.Data.Team.data{1, 1}.speed % can also be 1,2 and 1,3 etc
myData.Data.Team.data{1, 1}.DRS % can also be 1,2 and 1,3 etc
myData.Data.Team.data{1, 1}.time % can also be 1,2 and 1,3 etc
myData.Data.Team.data{1, 1}.GAP % can also be 1,2 and 1,3 etc
myData.Data.RefDriver.data{1, 1}.speed % can also be 1,2 and 1,3 etc
myData.Data.RefDriver.data{1, 1}.DRS % can also be 1,2 and 1,3 etc
myData.Data.RefDriver.data{1, 1}.time % can also be 1,2 and 1,3 etc
myData.Data.RefDriver.data{1, 1}.GAP % can also be 1,2 and 1,3 etc
myData.Data.Fia.data{1, 1}.speed % can also be 1,2 and 1,3 etc
myData.Data.Fia.data{1, 1}.DRS % can also be 1,2 and 1,3 etc
myData.Data.Fia.data{1, 1}.time % can also be 1,2 and 1,3 etc
myData.Data.Fia.data{1, 1}.GAP % can also be 1,2 and 1,3 etc
myData.Data.AllComp.data{1, 1}.speed % can also be 1,2 and 1,3 etc
myData.Data.AllComp.data{1, 1}.DRS % can also be 1,2 and 1,3 etc
myData.Data.AllComp.data{1, 1}.time % can also be 1,2 and 1,3 etc
myData.Data.AllComp.data{1, 1}.GAP % can also be 1,2 and 1,3 etc
After identify the above, I would like to apply to each of channel the following:
Speed = interp(Distance, Speed, option.s,'linear','extrap');
DRS = interp(Distance, DRS, option.s,'linear','extrap');
time = interp(Distance, time, option.s,'linear','extrap');
GAP = interp(Distance, GAP, option.s,'linear','extrap');
To finally return a structure which contain all the processed interpolated channels. I have tried to create a loop but is failing and I need to have a dinamic way of interrogating the structure.
  댓글 수: 1
Siddharth Bhutiya
Siddharth Bhutiya 2022년 10월 10일
Can you share what your code looks like and what is the exact error you are getting? Also have you tried using tables instead of a struct here ?

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

답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by