How to create eight (3 by 3) matrices from three (8 by 3) in Matlab?

I have 3 (8 by 3) matrices. Trying to create eight 3 by 3 matrices with the rows from each of the 8 by 3. using (:,:) not working

Best Answer

A=ones(8,3)
B=2*ones(8,3)
C=5*ones(8,3)

for i=1:8
D(i,:)=[A(i,:), B(i,:),C(i,:)];
end

reshape(D,3,3,8)

%note: be careful about the reshape that you place the elements you are looking for in the right places
%note: if you were disturbingly ambitious you could build a different symbol and thus a unique variable name for each iteration instead of using matrix referencing. That is more challenging in terms of the code.

PS: did you create the username just to ask this question, or are you going to stick around and answer a few as well?

30 Related Question Answers Found Date
Microsoft word? 2022-01-19 06:09
Help with html form redirect function - how do you redirect to external site after form submitted? 2022-01-19 06:09
How do i create a Java Library Maintenance System. Any recommended website for me to refer? 2022-01-19 06:04
How do i change the background of my picture using Adobe photoshop? 2022-01-19 06:04
what is RSS( technology) , advantage and disadvantage, funtion or system of RSS? 2022-01-19 05:57
is java programmer is also called java developer?please explain if there is a difference? 2022-01-19 05:38
How do you create a lead capture page by yourself? 2022-01-19 05:33
Can anyone tell me, concisely, the differences between vb, vb6, vbscript, vbnet? 2022-01-19 05:13
What does the suffix .INI in BOOT.INI mean? 2022-01-19 05:12
Is there a free software to to send direct html e-mail? 2022-01-19 04:57
write a program to add two numbers without using arithmetic opereations ( +,-,*,/,%)? 2022-01-19 04:57
Trigger Delete in SQL? 2022-01-19 04:40
???.net it's urgent !? 2022-01-19 04:18
hi frnds, which book is the best for pl sql "brush up" learning with "interview" point of view? 2022-01-19 04:13
can you plz explain me with this? 2022-01-19 04:00
How in C programming,we can assign a float value to a char value? 2022-01-19 03:54
How do I change my windows title bar using dreamweaver? 2022-01-19 03:44
What is the function of 'post slug' when writing a post in WordPress? 2022-01-19 03:43
Question about visual c++? 2022-01-19 03:42
Visual Basic 6 ADO problem? 2022-01-19 03:37
Why do a lot of ERP implementaions fail?javascript:void(0);? 2022-01-19 03:25
hello , plz where i could find a free library"" psd files ""specially landscape images? 2022-01-19 03:24
Where do I get a good tutorial for SAP & ABAP programming online for free? 2022-01-19 03:13
How can I access samba shared folder in the shell(linux)? 2022-01-19 03:13
Any GOOD web page designers you can trust on line? 2022-01-19 03:03
How can I animate my picture? 2022-01-19 02:54
my C programs are compiling with no error in turbo c++ 3.0..bt i am not able to see the output???plz help..? 2022-01-19 02:46
phpbb upgrade within php-nuke? 2022-01-19 02:31
how do i get? 2022-01-19 02:23
who composed the theme music you hear when you open windows xp? 2022-01-19 02:21