如何在 matlab 中求解线性符号方程



我正在尝试在 Matlab 中求解以下线性符号系统(20 个方程(,我将解决方案中的所有值都设置为零,我的实现中有什么错误吗? 代码中使用的数据在这里 数据

%---------------------
% clear and close all
%---------------------
clearvars
close all
clc
%---------------------
% Data type long
%---------------------
format long g
%---------------------
% Read data
%---------------------
load('data.mat')
%---------------------------
% Symbolic variables
syms X11 X12 X13 X14 X21 X22 X23 X24 X31 X32 X33 X34 X41 X42 X43 X44;
%========================
% Quadric 4 x 4 matrix
Q = [X11, X12, X13, X14;
X21, X22, X23, X24;
X31, X32, X33, X34;
X41, X42, X43, X44];
% loop all projections
for i=1:10
% for wach projection matrix
P = PPM(:, :, i);
% Autocalibration equation
DIAC(3*(i-1)+1:3*i,:) = P * Q * P';
L(2*(i-1)+1:2*i,1) = DIAC(3*(i-1)+1:3*i-1,3)==0 ;
end
[A,B] = equationsToMatrix(L,[X11, X12, X13, X14,...
X21, X22, X23, X24, X31, X32, X33, X34,X41, X42, X43, X44]);
Sol = linsolve(A,B)

按照我得到的解释,在这个网站上解释了解决方案:

[Mat,B] = equationsToMatrix(L,[X11, X12, X13, X14,...
X21, X22, X23, X24, X31, X32, X33, X34,X41, X42, X43, X44]);
% Solution is here
Sol = linsolve(Mat,B);

最新更新