如何从向量推导左侧矩阵?

问题描述 投票:0回答:1

假设我有以下脚本,该脚本构造符号数组A_known和符号向量x,并执行矩阵乘法。

clc; clearvars
try
    pkg load symbolic
catch
    error('Symbolic package not available!');
end

syms V_l k s0 s_mean
N = 3;

% Generate left-hand-side square matrix
A_known = sym(zeros(N));
for hI = 1:N
    A_known(hI, 1:hI) = exp(-(hI:-1:1)*k);
end
A_known = A_known./V_l;

% Generate x vector
x = sym('x', [N 1]);
x(1) = x(1) + s0*V_l;
% Matrix multiplication to give b vector
b = A_known*x

假设A_known实际上是未知。有没有一种方法可以从bx中推导出来?如果是这样,如何?

直到现在,我只有x未知的情况,通常是can be solvedx = b \ A

octave matrix-multiplication symbolic-math
1个回答
1
投票

从数学上讲,有可能获得一个解决方案,但实际上它具有无限解

示例

A = magic(5);
x = (1:5)';
b = A*x;
A_sol = b*pinv(x);

具有

>> A
A =

   17   24    1    8   15
   23    5    7   14   16
    4    6   13   20   22
   10   12   19   21    3
   11   18   25    2    9

但是像A一样解决A_sol

>> A_sol
A_sol =

    3.1818    6.3636    9.5455   12.7273   15.9091
    3.4545    6.9091   10.3636   13.8182   17.2727
    4.4545    8.9091   13.3636   17.8182   22.2727
    3.4545    6.9091   10.3636   13.8182   17.2727
    3.1818    6.3636    9.5455   12.7273   15.9091
© www.soinside.com 2019 - 2024. All rights reserved.