Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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 comentario
Siddharth Bhutiya
Siddharth Bhutiya el 10 de Oct. de 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 ?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by