Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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 Kommentar
Siddharth Bhutiya
Siddharth Bhutiya am 10 Okt. 2022
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 ?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by