Reshape array with respect to other array
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have the time stamps stored in the array named A (mx1) and image data stored in B (mx1). I need to reshape the data in the array B to 1280 by 720 based on each time stamps stored in the array A. Basically at the end the array B becomes three dimensional array mxnxy.
May I know how to do this
댓글 수: 6
Star Strider
2023년 10월 7일
There are 35431 unique time stamps in ‘A’. How are those supposed to be parsed to get a (1280 x 720) matrix?
dpb
2023년 10월 7일
편집: dpb
2023년 10월 7일
load matlab
whos
clear ans cmdout
cd_data
N=1280*720
numel(cd_data.A)/N
Not to mention that there aren't enough elements in B to create a 1280x720 array, anyways...
plot(cd_data.A)
numel(cd_data.A)/numel(unique(cd_data.A))
shows there is an average of about 18 values of A for each unique A...but the plot shows A isn't resetting to some particular value and repeating that, either; it shows an increasing slope over the entire range.
stairs(diff(cd_data.A),'-+')
xlim([0 400]), ylim([0 1.05])
There appear to be sets in the data but of differing lengths so even breaking at those can't go into commensurate sized arrays even if were to reduce the supposed array size.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!