use the nested loop to calculate the kronecker product for different size
    조회 수: 6 (최근 30일)
  
       이전 댓글 표시
    
A = round((rand(2)*11-5.5)) B = round((rand(3,4)*21-10.5)) calculate the kronecker product of AB
댓글 수: 0
채택된 답변
  Sagar Damle
      
 2014년 4월 26일
        A = round((rand(2)*11-5.5))
B = round((rand(3,4)*21-10.5))
[rA,cA] = size(A);
[rB,cB] = size(B);
finalanswer = [];
for i = 1:rA
    answer =[];
    for j = 1:cA
        temp = A(i,j) * B;
        answer = [answer,temp];
    end
 finalanswer = [finalanswer;answer]; 
end
finalanswer
z = kron(A,B)
isequal(z,finalanswer)
추가 답변 (1개)
  Sagar Damle
      
 2014년 4월 26일
        I think you have not taken much efforts for your problem.'Google' can give you the information which you want.
You have to use the function "kron(A,B)".
참고 항목
카테고리
				Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

