필터 지우기
필터 지우기

Extracting data from array

조회 수: 1 (최근 30일)
Vinay Srinivasan
Vinay Srinivasan 2020년 1월 3일
댓글: Vinay Srinivasan 2020년 1월 3일
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
David Hill
David Hill 2020년 1월 3일
Need to provide an example of the data if you want help.
Vinay Srinivasan
Vinay Srinivasan 2020년 1월 3일
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 .

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 3일
편집: KALYAN ACHARJYA 2020년 1월 3일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by