I want to solve the following for X2: A = B(X1+X2) where B is a matrix, and A, X1, and X2 are vectors. I can't divide by a matrix. So I believe I take the inverse. Is that right? What is the best way of doing this with very large matrices?

댓글 수: 1

Matt J
Matt J 2023년 5월 16일
We would have to know what "very large" means to you.

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2023년 5월 16일
편집: Matt J 2023년 5월 16일

0 개 추천

%Fake input data
B=rand(100); X1=rand(100,1); X2=rand(100,1);
A=B*(X1+X2);
%Now invert
X2_recovered=B\(A-B*X1);
norm(X2-X2_recovered) %Check discrepancy - should be small
ans = 4.4786e-13

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2023년 5월 16일

편집:

2023년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by