필터 지우기
필터 지우기

How to generate visual graph for classified behaviour?

조회 수: 1 (최근 30일)
Katrina Anderson
Katrina Anderson 2018년 11월 8일
답변: Katrina Anderson 2018년 11월 9일
I have a 285768x1 cell which has word outputs such as 'standing''step' etc which are linked to time. Each row is equal to 0.02s of time. The labels are for IMU data (which is graphed by MATLAB with waveforms). My question is how do i visualise the data?
- create a graph with time and behaviour, to label the waveforms - maybe use one axis of the accelerometer and label it with colour (red when stepping or blue when standing etc). -create a percentage of behaviour recorded? so I can detect activity budgets.
At the moment there are no plots I can perform. Any help regarding how to do this would be much appreciated.
Thankyou!!

채택된 답변

KSSV
KSSV 2018년 11월 8일
Let str be your cell of size 285768x1 having strings. And let A be the corresponding 285768xn data matrix. To visualize the data having a string 'standing' do this:
idx = strfind(str,'standing') ; % get indices of string standing
A_standing = A(idx,:) ; % this gives you whole data with string standing
pcolor(A_standing) ; % surf plot
shading interp
colorbar
  댓글 수: 4
Katrina Anderson
Katrina Anderson 2018년 11월 8일
The time frame is a double, and the orignal data with the 'standing''stepping'is a cell. Then the waveforms are also all double.
Sorry, Im still learning a lot haha
KSSV
KSSV 2018년 11월 8일
Can you attach your data..with the code you tried.

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

추가 답변 (4개)

Katrina Anderson
Katrina Anderson 2018년 11월 9일
Thankyou!! i will attach a few files as the entire workspace is too large.
This is the time data.

Katrina Anderson
Katrina Anderson 2018년 11월 9일

Katrina Anderson
Katrina Anderson 2018년 11월 9일
Behaviours

Katrina Anderson
Katrina Anderson 2018년 11월 9일
And this is an example of what my data looks like from the sensor. This is just one acc axis but it might give you a better idea of what im trying to do.
So i used the code you gave me, and i was able to successfully apply the strfind, which gave me a number 1 for each 'standing'. But the A_standing was the error.
>> A_standing = acctime(idx,:) ; Function 'subsindex' is not defined for values of class 'cell'.
is that how im supposed to code it?
Thankyou!!

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by