function [QQ,RR]=QRfun(Q,R,N)

% Matrices without 0 element
QQ = cell(N,N);
RR = cell(N,N);

%% Matrix QQ, RR
% zeros in QQ
for k=1:N
    for j=1:N
        QQ{k,j}=zeros(size(Q));
    end
end

% zeros in RR
for k=1:N
    for j=1:N
        RR{k,j}=zeros(size(R));
    end
end

for i = 1:N
    QQ{i,i} = Q;
end

% P
QQ{N,N} = 0*Q;

for i = 1:N
    RR{i,i} = R;
end

% conversion
QQ = cell2mat(QQ);
RR = cell2mat(RR);


