Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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 commentaire
Siddharth Bhutiya
Siddharth Bhutiya le 10 Oct 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 ?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by