P = rand(4,5);
plPOLS(P,10,12);  % what is the order of colors:  blue, green, red ....
    
T = testmat(5)
T =
     1     6    11    16    21
     2     7    12    17    22
     3     8    13    18    23
     4     9    14    19    24
     5    10    15    20    25
plot(T);
shg
xx =  [1,2,5,7];
V = vander(xx)
V =
     1     1     1     1
     8     4     2     1
   125    25     5     1
   343    49     7     1
home
V
V =
     1     1     1     1
     8     4     2     1
   125    25     5     1
   343    49     7     1
cond(V)
ans =
  2.0873e+003
cond(vander(-1:4))
ans =
  3.6850e+003
cond(vander(-1:2))
ans =
   17.3178
IV = inv(V)
IV =
   -0.0417    0.0667   -0.0417    0.0167
    0.5833   -0.8667    0.4167   -0.1333
   -2.4583    3.1333   -0.9583    0.2833
    2.9167   -2.3333    0.5833   -0.1667
plPOLS(IV,0,8);
shg

hold on; plot([1,2,5,7], zeros(1,4),'r*'); grid; 
shg

c1 =  [1,-1]; c2 = [1,-2]; c3 = [1,-7];
aa = [1,1];  bb = aa;
for jj = 1 : 8;  bb = conv(bb,aa), pause(2); end; 
bb =
     1     2     1
bb =
     1     3     3     1
bb =
     1     4     6     4     1
bb =
     1     5    10    10     5     1
bb =
     1     6    15    20    15     6     1
bb =
     1     7    21    35    35    21     7     1
bb =
     1     8    28    56    70    56    28     8     1
bb =
     1     9    36    84   126   126    84    36     9     1
home
cc =  conv(c1,c2)
cc =
     1    -3     2
cc =  conv(cc,c3);
cc
cc =
     1   -10    23   -14
figure;
plPOLS(cc,0,8);
shg
plPOLS(cc',0,8);
shg
hold;
Current plot held
plot(0:8, zeros(1,9),'k');
sg
v5 = polyval(cc,5)
v5 =
   -24
ccn =  cc/v5
ccn =
   -0.0417    0.4167   -0.9583    0.5833
home
ccn =  cc/v5
ccn =
   -0.0417    0.4167   -0.9583    0.5833
IV
IV =
   -0.0417    0.0667   -0.0417    0.0167
    0.5833   -0.8667    0.4167   -0.1333
   -2.4583    3.1333   -0.9583    0.2833
    2.9167   -2.3333    0.5833   -0.1667
AA = rand(4)
AA =
    0.6557    0.6787    0.6555    0.2769
    0.0357    0.7577    0.1712    0.0462
    0.8491    0.7431    0.7060    0.0971
    0.9340    0.3922    0.0318    0.8235
IAA = inv(AA)
IAA =
   -2.7122   -0.4442    2.5972    0.6306
   -0.9312    1.6091    0.4668    0.1679
    3.7778   -1.1294   -1.7721   -0.9981
    3.3737   -0.2190   -3.0996    0.4577
home
IAA * AA 
ans =
    1.0000    0.0000   -0.0000    0.0000
    0.0000    1.0000    0.0000    0.0000
   -0.0000         0    1.0000    0.0000
   -0.0000   -0.0000    0.0000    1.0000

ia3 = IAA(3,:)
ia3 =
    3.7778   -1.1294   -1.7721   -0.9981
AA3=  AA;
AA3=  AA(:,[2,1,4,3]);
help grams

grams.m not found.

Use the Help browser Search tab to <a href="matlab:docsearch grams">search the documentation</a>, or
type "<a href="matlab:help help">help help</a>" for help command options, such as help for methods.

OAA3 =  gramsfei(AA3);
v3 =  OAA3(:,4)
v3 =
    0.8515
   -0.2546
   -0.3994
   -0.2250
ia3 = ia3(:);
ia3./v3
ans =
    4.4366
    4.4366
    4.4366
    4.4366
diary off;
