makemat(n)
Publié : mar. janv. 29, 2019 10:50 pm
Hi BP, just to bring the matlab style in the makemat function, add please the following
makemat (n) returns a zeros square matrix of dimension (n * n)
makemat(0,s,s); == makemat(s);
or
hilbert_( 3 )
[[1,1/2,1/3],
[1/2,1/3,1/4],
[1/3,1/4,1/5]]
makemat (n) returns a zeros square matrix of dimension (n * n)
makemat(0,s,s); == makemat(s);
Code : Tout sélectionner
hilbert_( s ):={
local h, c, r;
h := makemat(0,s,s);
for c from 1 to s do
for r from 1 to s do
h[[r,c]] := 1/(r+c-1);
end;
end;
return h;
}
Code : Tout sélectionner
hilbert_( s ):={
local h, c, r;
h := makemat(s);
for c from 1 to s do
for r from 1 to s do
h[[r,c]] := 1/(r+c-1);
end;
end;
return h;
}
[[1,1/2,1/3],
[1/2,1/3,1/4],
[1/3,1/4,1/5]]