How to multiply elements of a cell array with each other?
Show older comments
Hi,
I have a 1xN cell array with each cell containing 2x2 matrix. I want to now multiply the individual cell arrays to get a single matrix. I used the following code but it is just multiplies the last two:
prompt = 'enter number of transformations'
N = input(prompt); %to enter number of matrixes user wants to multiply
A = cell(1,N);
%storing matrices in a 1xN cell array
for i = 1:1:N
prompt = 'enter transformation matrix'
A{1,i} = input(prompt);
end
%want to get a single multiplication matrix of all N cells
for i = 1:1:N
T = A{1,i}*A{1,:i+1};
end
1 Comment
Jos (10584)
on 14 May 2016
almost there ..
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!