0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 function set_figsize(width,height)
0015
0016
0017
0018
0019 rqre_nargin( 2, nargin );
0020
0021
0022
0023
0024 h = gcf;
0025
0026 unit1 = get( h, 'Unit' );
0027 unit2 = get( h, 'PaperUnit' );
0028
0029
0030
0031
0032 set( h, 'Unit', 'ce' );
0033 set( h, 'PaperUnit', 'ce' );
0034
0035
0036
0037
0038 width = width / 10;
0039 height = height / 10;
0040
0041
0042
0043
0044 pos1 = get( h, 'Position' );
0045 pos2 = get( h, 'PaperPosition' );
0046
0047
0048
0049
0050 set( h, 'Position', ...
0051 [pos1(1)+pos1(3)/2-width/2 pos1(2)+pos1(4)/2-height/2 width height] );
0052 set( h, 'PaperPosition', ...
0053 [pos2(1)+pos2(3)/2-width/2 pos2(2)+pos2(4)/2-height/2 width height] );
0054
0055
0056
0057 set( h, 'Unit', unit1 );
0058 set( h, 'PaperUnit', unit2 );