matrix manipulation and arrays manipulation

Dear Matlab community, I apologize in advance if I may have asked too many questions as suggested by some users on here. I usually get all kind of help from bright and fantastic individuals through MathWorks. I am having some trouble getting a result that I need using two matrices with different dimensions. I attached a code with an extracted portion of these matrices to better elaborate what I am doing and hoping to achieve, I will also pasted it on here just in case:
%%%%%%Extracted 10 rows and 3 columsn from A(73400 by 30)(noting that nbr
%%%%%%or rows in A is = (14680 of (5*1) stacked) so that's why I need to
%%%%%%do the sump of the product in 5 rows at the time from A
%%%Matrix B(14680*5)
%%Objective Matrix is C(14680*30) with each element in C(i,j)= sumProduct(transpose(A(5*1).*B(i,:))
%%Example:
A1=[-20.6860046107437,-20.8259490953586,-20.5295141167041;-4.68083651024847,-4.38170600425412,-4.04039850536564;-5.32219353656980,-4.99820840303045,-4.62367652177701;0,0,0;0,0,0;-13.3475398510192,-10.9590900264805,-8.87951051472035;-0.0119489044851285,-0.00952917816601411,-0.00754907814411214;0,0,0;0,0,0;0,0,0];
B11=[2.48618841134752e-06,1.78727800000000e-06,0,0,0;2.56419915269461e-06,1.78727800000000e-06,0,0,0];
C(1,1)=sum(A1(1:5,1)'.*B11(1,:)) % 1st element in C(14680*30)
C(2,1)=sum(A1(6:10,1)'.*B11(2,:))% 2nd element in C(14680*30)
....
%%until all the 14680 of (5*1) are reached so C(14680*1)
%%now same thing needs to be done but moving in the 2nd Column of A(:,2)
C(1,2)=sum(A1(1:5,2)'.*B11(1,:)) % Still 1st row of B
C(2,2)=sum(A1(6:10,2)'.*B11(2,:))% Still 2nd row of B
%%continue until all 14680 rows and 14680 of (5*1) are used, then move to
%%next column nbr 3 from A(:,3)
C(1,3)=sum(A1(1:5,3)'.*B11(1,:)) % Still 1st row of B
C(2,3)=sum(A1(6:10,3)'.*B11(2,:))% Still 2nd row of B
%%%the final dimension of C is then (14680 by 30)

8 Comments

In the future, please format your code using the "{}Code" button above. I did it for you this time.
Also, what is your actual question here?
More importantly, stop asking the same question over and over. Continuee the conversation in the original question.
@ The cyclist, thanks for editing the portion of the code. I am not quite familiar about the proper rules & guidelines for posting on here. My question is given a matrix A(73400*30) and Matrix B(14680*5), and the objective is to get a final Matrix C(14680 by 30) where each row element in a given column is equal to the sumproduct of each (5*1)' arrays from A and each row from B. (noting that each column in A (:,1:30) has also (5*1) arrays stacked up. I tired for loop to get through all the columns but it did not work. The example in the code is an illustration of part of the final matrix that should be (14680*30)
Amine, as said, add the extra information to the original question rather than starting new ones.
It's much easier for us to answer if we can follow the conversation that has gone on before.
@ Guillaume, Sorry, I did not know I can edit the original question. I made an update now and attached a small portion of code as an example of what I am trying to do with the matrices.
Duplicate:
https://www.mathworks.com/matlabcentral/answers/316715-matrix-manipulation-and-changing-matrix-dimension-using-reshape-squeeze
@ Stephen, it is not really a duplicate. That question was somehow closed and I was told to make an example of what the operation I needed and here I attached a portion of m. script as an illustration to what I need help with. Thanks
It is really a duplicate. If you had new information you should have updated the previous question.

Answers (0)

This question is closed.

Asked:

on 13 Dec 2016

Commented:

on 4 Jan 2017

Community Treasure Hunt

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

Start Hunting!