Creating a AxBxCxD out of AxB matrix.. Using reshape, code included..little help needed

조회 수: 5 (최근 30일)
Hi
I have 137241 data in 1 column. the data is voltage of 5 households (3-phase). I want a matrix out of it showing me: 10 x 24 x days x 15
my code is:
ncust = size(x,2);
% pad data with one extra row
x = [x;zeros(1,ncust)];
% reshape data into hour/day/customer
x = reshape(x,24,[],ncust);
i tried using: reshape(x,10,24,[],ncust) but didnt work.
and the data is attached :)
i hope a kind soul will help me :)
thanks alot
  댓글 수: 6
Star Strider
Star Strider 2014년 5월 4일
The (137241x1) vector isn’t of much use unless we know how you reshaped it from what was obviously a 3D matrix of (minutes x days x customers).
We have many areas of brilliance between us here at MATLAB Answers, but mindreading has proven to be our collective area of absolute ineptitude.
Image Analyst
Image Analyst 2014년 5월 4일
Well not totally. I've seen Sean and Walter figure out what the poster was asking from total gobbledegook and sheer gibberish. It's my thinking that Sean has been assigned to the Mind Reading Toolbox development in the Mathworks Black Ops Skunkworks, and that perhaps Walter is a beta tester for it. Not totally out of the realm of possibility if you saw UC Berkeley Prof. Jack Gallant's plenary talk at the Electronic Imaging Symposium.

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

답변 (2개)

Mehdi
Mehdi 2014년 5월 3일
In x = [x;zeros(1,ncust)]; ncust should be an integer. ncust = size(x,2); doesn't generate an integer. Besides, I'm not sure if your code is the way to go. In reshape you have to determine what arrays of your 137241 x 1 matrix should be located in the output row and which ones should be located in the columns. Just my two cents.

Travis Damian Houle Crouser
Travis Damian Houle Crouser 2018년 2월 8일
0

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by