Replace values in collumns
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone. I am having an issue while processing some acceleration data. I retrieve in my file 8 collumns as you can see in picture a, which are:
collumn 1 - datetime,
collumns 2,3,4 - acceleration x,y,z from one sensor,
collumns 5,6,7 - acceleration x,y,z from a second sensor and finally
collumn 8 - values from a rain sensor (0 or 1, in this case only 0).
The problem is that as you can see in picture b, from a random time point and then, values from y2 go to the last collumn. Any ideas how to fix this in order to finally plot each colllumn seperate?
Thanks in advance!
댓글 수: 0
답변 (1개)
Bob Thompson
2019년 11월 4일
You can just index your matrix to reorder it, assuming all of the columns are the same type of data (i.e. all of column 6 is z2, and all of column 7 is rain).
data = [data(:,1:5),data(:,8),data(:,6:7)];
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!