matrix row, column change

5 views (last 30 days)
형준 이
형준 이 on 23 Dec 2021
Commented: 형준 이 on 24 Dec 2021
i'm not good at matlab...
question : if E1 = 800 X 1 matrix, and i want E_VV = 20 X 40 matrix
what is the simple code to change E1 to E_VV ??
my code : E_VV = [E1(1:20,1),E1(21:40,1),E1(41:60,1),E1(61:80,1),E1(81:100,1),E1(101:120,1),E1(121:140,1),E1(141:160,1),E1(161:180,1),E1(181:200,1),E1(201:220,1),E1(221:240,1),E1(241:260,1),E1(261:280,1),E1(281:300,1),E1(301:320,1),E1(321:340,1),E1(341:360,1),E1(361:380,1),E1(381:400,1),E1(401:420,1),E1(421:440,1),E1(441:460,1),E1(461:480,1),E1(481:500,1),E1(501:520,1),E1(521:540,1),E1(541:560,1),E1(561:580,1),E1(581:600,1),E1(601:620,1),E1(621:640,1),E1(641:660,1),E1(661:680,1),E1(681:700,1),E1(701:720,1),E1(721:740,1),E1(741:760,1),E1(761:780,1),E1(781:800,1)];
i think this code is very long and not simple

Accepted Answer

KSSV
KSSV on 23 Dec 2021
E = rand(800,1) ;
iwant = reshape(E,20,40) ;

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!