# How can convert vector aa size 1x262144 to matrix 256x256

6 views (last 30 days)
nora elfiky on 11 Dec 2016
Commented: honey on 16 Mar 2020
hi every one i'm new her i need help
size of aa 1x262144 i want convert to matrix 256x256
Walter Roberson on 6 Jan 2020
In your posted code, fs would be the sampling frequency. The sampled values would be in y. You would proceed to fft(y) and then analyze the results along the lines I mentioned.
Note: your y might have multiple channels, which will show up as separate columns. Be careful, as in theory the different channels can have different peak frequencies.

Edited: Isabella Osetinsky-Tzidaki on 11 Dec 2016
% you will not convert (262144 is 4 times 256*256 and not equal to it)
% but complete 4 matrices out of your "aa" vector
% and you will get a "M" array:
L=256*256;
M=nan(256,256,4); % pre-allocate
for i=1:4
v=aa(L*(i-1)+1:L*i);
M(:,:,i)=reshape(v,256,256);
end
honey on 16 Mar 2020
thank you

the cyclist on 11 Dec 2016
Use the reshape command.