Effacer les filtres
Effacer les filtres

Lookup values in ranges of a table and copy a corresponding output value in another table

1 vue (au cours des 30 derniers jours)
Hi,
I'm trying find 'Val' value from table A given by Lap number in table B from minimum of first 3 rows coresponding to each lap in table A (with no sorting).
The answer would be in Table B:
Lap Val
1 1
2 0
5 0
Thanks.

Réponse acceptée

Voss
Voss le 22 Août 2022
A = load('A')
A = struct with fields:
Events: [104×2 table]
B = load('B')
B = struct with fields:
Events: [3×1 table]
[~,idx] = ismember(B.Events.Lap,A.Events.Lap);
result = A.Events(idx,:)
result = 3×2 table
Lap Var ___ ___ 1 1 2 0 5 0
  11 commentaires
Gabi
Gabi le 29 Août 2022
Thanks for your help, this is all clear now.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by