Mercurial > hg > ltpda
view m-toolbox/test/test_ao_mrdivide.m @ 34:03d92954b939 database-connection-manager
Improve look of LTPDAPreferences diaolog
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
mc %% Some AOs c1 = ao(1); c1.setName; c2 = ao(2); c2.setName; c3 = ao(3); c3.setName; c4 = ao(randn(3,3)); c4.setName; c5 = ao(randn(3,3)); c5.setName; c6 = ao(randn(3,1)); c6.setName; c7 = ao(randn(1,3)); c7.setName; t1 = ao(plist('tsfcn', 't', 'fs', 10, 'nsecs', 10)); t1.'; t1.setName; t2 = ao(plist('tsfcn', 'sqrt(t)', 'fs', 10, 'nsecs', 10)); t2.setName; t3 = ao(plist('tsfcn', 't.^2', 'fs', 10, 'nsecs', 10)); t3.setName; t4 = ao(plist('tsfcn', 't', 'fs', 10, 'nsecs', 10)); t4.'; t4.setName; t5 = ao(plist('tsfcn', 't', 'fs', 10, 'nsecs', 10)); t5.'; t5.setName; f1 = ao(plist('fsfcn', 'f', 'f', 'logspace(-4,1,100)')); f1.setName; f2 = ao(plist('fsfcn', '1./f', 'f', 'logspace(-4,1,100)')); f2.'; f2.setName; f3 = ao(plist('fsfcn', 'sqrt(f)', 'f', 'logspace(-4,1,100)')); f3.setName; x1 = ao(plist('xyfcn', 'x', 'x', '1:100')); x1.setName; x2 = ao(plist('xyfcn', '1./x', 'x', '1:100')); x2.'; x2.setName; x3 = ao(plist('xyfcn', 'sqrt(x)', 'x', '1:100')); x3.setName; %% Rule 1: [1x1] * [1x1] %---------- CDATA % cdata / cdata r1 = mrdivide(c1,c3) % cdata / tsdata r2 = mrdivide(c2,t2) % cdata / fsdata r3 = mrdivide(c1,f2) % cdata / xydata r4 = mrdivide(c1,x2) % tsdata / cdata r8 = mrdivide(t1, c2) %---------- FSDATA % fsdata / tsdata try r9 = mrdivide(f1, t2) error('Data types should be incompatible: booo!'); catch lasterr warning('Data types not compatible: fsdata+tsdata: hoorah!'); end % fsdata / cdata r12 = mrdivide(f1, c2) % xydata / cdata r16 = mrdivide(x1, c2) %% Rule 2: [1xN] / a or [Nx1] / a v1 = [t1 t3]; v2 = [t1; t3]; r1 = mrdivide(v1,c1) r2 = mrdivide(v2,c1) %% Rule 3: [1xN] / [Nx1] v1 = [t1 t1]; v2 = [t3; t2]; try r1 = mrdivide(v1,v2) error('Matrix sizes should be incompatible: booo!'); catch lasterr warning('Data sizes not compatible: hoorah!'); end %% Rule 4: [1xN] / [1xN] v1 = [t1 t1]; try r1 = mrdivide(v1,v1) error('Sizes should be incompatible: booo!'); catch lasterr warning('Sizes not compatible: hoorah!'); end %% Rule 5: [Nx1] / [1xM] v1 = [t1;t4;t5]; r = mrdivide(v1,v1) %% Rule 6: [Nx1] / [Nx1] v1 = [t1;t4;t5]; r1 = mrdivide(v1,v1) %% Rule 7: [NxP] / [Nx1] m = [t1 t1;t4 t4;t5 t5]; v = [t1;t2;t3] r1 = mrdivide(m,v) %% Rule 8: [NxP] / [1xP] m = [t1 t1;t4 t4;t5 t5]; v = [t2 t2] r1 = mrdivide(m,v) %% Rule 9: [NxP] / [NxP] m = [t1 t1;t4 t4;t5 t5]; r1 = mrdivide(m,m) %% Rule 10: [NxP] / [P*Q] m1 = [t1 t1;t4 t4;t5 t5]; m2 = [c1 c2 c3; c3 c2 c3]; r1 = mrdivide(m1,m1)