📄 demo2d.m
字号:
function demo2d(x,o,t,r,S,movieS,memory,verbose) # usage # demo2d(x,o,t)# do a demo using inputs x, etc.# special case where x is 2d. if (nargin != 6 && nargin != 7 && nargin != 8) usage ("demo2d(x,o,t,r,S,movieS[,memory[,verbose]])"); endif if (nargin != 7 && nargin != 8) memory = 0.8 ; endif if ( nargin != 8) verbose = 1 ; endifjitter = 1e-4 ;s=size(x); X=s(2);if (X!=2) print "error, size of x wrong \n"; break ;endifrestore25sq;## Make covariance matrix#CCIM ;contours;gset title "P(t1,t2)";gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 ;input("press return");# Make S samples and show themv=randn(S,X)*M ;gset title "P(t1,t2)";gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 , v u 1:2 w points 6 3;# noto , xsub , CIsub , CIsubM , postCov , mean , postcovM , pp , pvars, psds# are obtained from x,o,CI,tinfer();input("demo2d - press return");# keyboardmsd = [ mean , psds ] ;# msd = [ xsub , tmp , psds ] ; # show the data on pagedata = [ 1,-2.5 ; 1,2.5 ] ; # lineshalfdata = [ 1,-2.5 ; 1,-1 ] ;gset title "t1 = 1";gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 , v u 1:2 w points 6 3 , data u 1:2 w l 1 3 ;input("press return");gset title "P(t2|t1=1)";gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 , halfdata u 1:2 w l 1 3 , msd u 1:2:3 w error 4 1 ;input("press return");# straight away show the samples that go through the data points# --- make a load of independent samplesvv = randn(S,X) * pp ;posts = vv + ones(S,1) * mean ; gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 , halfdata u 1:2 w l 1 3 , posts u 1:2 w points 5 3 ;# gplot c1 u 1:2 w l 2 7 , c2 u 1:2 w l 3 6 , halfdata u 1:2 w l 1 3 , posts u 1:2 w points 5 3 , mean u 1:2 w p 4 1, msd u 1:2:3 w error 4 1 ;# input("press return");gset title "";############################ end ###########################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -