linearly independent or linearly dependent.

211 次查看(过去 30 天)
how can i determine if vector v is a linear combination of the members of the S by using matlab ?
S = {(1,2,-1),(2,-1,0),(-1,8,-3)}
v = (0,5,-2)

回答(2 个)

Matt J
Matt J 2021-5-9
编辑:Matt J 2021-5-9
If [S,v] and S have the same rank, then the column vector v must be a linear combination of the columns of the matrix S.Testing this in your example,
S = [1,2,-1 ; 2,-1,0 ; -1,8,-3].' ;
v = [0,5,-2].';
isDependent = rank([S,v])==rank(S)
isDependent = logical
1

Jonas
Jonas 2021-5-8
编辑:Jonas 2021-5-8
you could use something like
syms a b c; [sola,solb,solc]=solve(S{1}*a+S{2}*b+S{3}*c==v,a,b,c)

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by