Reshape array with respect to other array

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 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 7 日
You want to convert mx1 in to mxnxy?
Where will the nxy elements come from?
Turbulence Analysis
Turbulence Analysis 2023 年 10 月 7 日
Hi,
Actually I have four arrays A - time stamp; B-x psotion; C- y position; D- image intensity data
Dyuman Joshi
Dyuman Joshi 2023 年 10 月 7 日
And what is it that you want to do with these arrays?
Turbulence Analysis
Turbulence Analysis 2023 年 10 月 7 日
The whole idea is to extract image from the array D corresponds to the time stamps stored in A. Please see the attached data
Star Strider
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
dpb 2023 年 10 月 7 日
編集済み: dpb 2023 年 10 月 7 日
load matlab
whos
Name Size Bytes Class Attributes ans 1x35 70 char cd_data 1x1 19985888 struct cmdout 1x33 66 char
clear ans cmdout
cd_data
cd_data = struct with fields:
A: [624538×1 double] B: [624538×1 double] C: [624538×1 double] D: [624538×1 double]
N=1280*720
N = 921600
numel(cd_data.A)/N
ans = 0.6777
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))
ans = 17.6269
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 件)

質問済み:

2023 年 10 月 7 日

編集済み:

dpb
2023 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by