I have a 3x540 matrix (mt) and want to process each column through the following for loop to calculate 540 3 x1 arrays (x)
for i=0:539
A = [T-n, -n.*P, mt(:,1+i).*P];
b = [mt(:,1+i)-n];
x = inv(A)*b
end
How do I concatenate the 540 'x' arrays into a single 3x540 matrix?

 채택된 답변

KSSV
KSSV 2020년 7월 15일

0 개 추천

x = zeros(3,540) ;
for i=0:539
A = [T-n, -n.*P, mt(:,1+i).*P];
b = [mt(:,1+i)-n];
x(:,i+1) = inv(A)*b ;
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2020년 7월 15일

댓글:

2020년 7월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by