Solving homogeneous systems of linear equations

Hello everybody,
I was trying to solve a homogeneous system of linear equations by using the null() function, which is recommended by https://de.mathworks.com/help/matlab/math/systems-of-linear-equations.html. But I'm kind of stuck because the function always returns the Error "Empty sym: 1-by-0".
I already tried a more simple example, where the solution is already known.
Example =
[ 5529.6571965113201121628855218102, -3000]
[ -3000, 1627.5873313951778400904919565612]
>> null(Example)
ans =
Empty sym: 1-by-0
It should return the vector x = [0.477; 0.879]. Or am I missing something?

Réponses (1)

Torsten
Torsten le 20 Juin 2018
Modifié(e) : Torsten le 20 Juin 2018
If I execute
A=[ 5529.6571965113201121628855218102,-3000
-3000, 1627.5873313951778400904919565612];
null(A)
I get the correct result.
Best wishes
Torsten.

1 commentaire

Henan Fang
Henan Fang le 31 Août 2018
Modifié(e) : Henan Fang le 31 Août 2018
Dear Torsten, can you tell me why my generated matrix like the example above (every line has a square bracket)? My codes are as follows.
clear all;
syms kz x y
x=0.5;
y=0;
m = 2;
vh = 4;
mu = 11;
delta = 8;
HBAR = 1.05457266e-34;
ME = 9.1093897e-31;
ELEC = 1.60217733e-19;
Kh = 2.106;
vKh = [0,0,0;Kh,0,0;-Kh,0,0;0,Kh,0;0,-Kh,0];
kc = sqrt(2*ME*ELEC/HBAR^2)*1e-10;
ku = kc*sqrt(mu+delta);
kd = kc*sqrt(mu-delta);
a3 = [pi/Kh,pi/Kh,sqrt(2)*pi/Kh];
kuu =@(x,y) [-ku*sin(x)*cos(y), -ku*sin(x)*sin(y), kz];
n=0:m;
for p=1:5;
for q=1:5;
tuu(p,q)=(sum((kuu(x,y) + vKh(p,:)).^2)-ku^2)*(p==q)+ kc^2*vh*sum(exp(i*n*sum((vKh(q,:)-vKh(p,:)).*a3)))*(p~=q);
end
end
tuu

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Produits

Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by