Extracting data from array

1 visualización (últimos 30 días)
Vinay Srinivasan
Vinay Srinivasan el 3 de En. de 2020
Comentada: Vinay Srinivasan el 3 de En. de 2020
Hello all,
I have a matlab data file called 'Event '. It is a collection of 100 events .In each event there are multiple event(lets assume 10 sub events). I want to extract 5th event from all the 100 events . How can I write the code ?
  2 comentarios
David Hill
David Hill el 3 de En. de 2020
Need to provide an example of the data if you want help.
Vinay Srinivasan
Vinay Srinivasan el 3 de En. de 2020
Ok 100 events which I mentioned are the events of 100 cars which is driving on a road. Each car event has many data like car type,number of passenger,etc. I want to extract number of passengers from each car .

Iniciar sesión para comentar.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 3 de En. de 2020
Editada: KALYAN ACHARJYA el 3 de En. de 2020
If the event data is an array, then
Event=[100 data number];
%I want to extract 5th event
data=Event(5)
If the event data each element itself as an array, then use cell array
Event={...100 data number};
%I want to extract 5th event
data=Event{5}
Each car event has many data like car type,number of passenger,etc
Preferbly cell array, which can hold any types of data, if its only series of numeric then just array.

Más respuestas (0)

Categorías

Más información sobre External Language Interfaces en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by