extract data from cell array based on matching numbers with location in array

1 visualizzazione (ultimi 30 giorni)
Hi I have a cell array MyData which has 128x1 cells with data running sequentially from A1 to A32 and again for B1-B32, C1-C32 and D1-D32. Can anyone advise how I extract data from this array based on whether the location in this array matches that of a number? For example, if I have A how do I get the desired output B?
MyData = [sprintfc('A%i',1:32) sprintfc('B%i',1:32) sprintfc('C%i',1:32) sprintfc('D%i',1:32)]'
A = [1 34 68 92 118]'
B =[A1 B2 C4 C28 D22]

Risposta accettata

Stephen23
Stephen23 il 24 Ago 2020
Modificato: Stephen23 il 24 Ago 2020

Più risposte (0)

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by