Overview
Comment:Cosmetic improvements
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: ced82047125887cba5fe2d5595786b9f640cf7e49a24296f9327661c91b4fe57
User & Date: gawthrop@users.sourceforge.net on 2001-05-10 19:08:35
Other Links: branch diff | manifest | tags
Context
2001-05-24
07:42:12
Included and updated the missing tf_r2m check-in: c13b3e7399 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-05-10
19:08:35
Cosmetic improvements check-in: ced8204712 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:44:40
Useful conversion functions check-in: ccc5e5d04f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/figfig.m from [e7a6c91fd1] to [36dabb6f5b].

9
10
11
12
13
14
15



16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37







+
+
+











-
+







  ## Boxed=1 gives a box aroundd the figure

  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.4  2001/05/08 15:18:12  gawthrop
  ## Added trig and hyperbolic functions to argument exclusion list
  ##
  ## Revision 1.3  2001/04/10 12:54:50  gawthrop
  ## Minor fixes for sensitivity versions
  ##
  ## Revision 1.2  2000/12/27 16:06:02  peterg
  ## *** empty log message ***
  ##
  ## Revision 1.1  2000/11/03 10:43:10  peterg
  ## Initial revision
  ###############################################################

  if nargin<3
    boxed=1
    boxed=1;
  endif
  
  figfilename = sprintf("%s.fig",filename);
  
  eval(sprintf("gset output \"%s\" ",figfilename));

  gset term fig color portrait fontsize 16 size 20 10 metric

Modified mttroot/mtt/bin/trans/m/pol2root2tex.m from [101be5a504] to [58e91efaa9].

1

2
3

4
5
6
7
8
9



10
11
12
13
14







15
16
17
18
19
20
21
22
23
24



25



26











27
28
29
30
31



32
33


34
35
36
37
38
39
40

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55


56
57
58
59

60
61
62
63
64
65
66
67
68
-
+

-
+






+
+
+





+
+
+
+
+
+
+










+
+
+
-
+
+
+

+
+
+
+
+
+
+
+
+
+
+



-
-
+
+
+

-
+
+







function tex = pol2root2tex(pol)
function tex = pol2root2tex(pol,name,f)
  ## pol2tex: converts polynomial into LaTeX form as (s-z_1)..(s-z_n)
  ## tex = pol2root2tex(pol)
  ## tex = pol2root2tex(pol,[name,f])
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.1  2001/05/10 11:44:40  gawthrop
  ## Useful conversion functions
  ##
  ## Revision 1.1  1999/05/24 22:05:53  peterg
  ## Initial revision
  ##
  ###############################################################

  if nargin<2
    name = "s"
  endif
  
  if nargin<3
    f = "%2.2f";
  endif

  n = length(pol)-1;

  if n>0
    r = sort(roots(pol));
  endif
  
  gain = pol(1);

  complex=0;
  if ((gain==1)&&(n>0))
    tex="";
  else
  tex = sprintf("%g", gain);
    tex = sprintf("%g", gain);
  endif
  
  for i=1:n
    if real(r(i))<0
      r_plusminus = '+';
    else
      r_plusminus = '-';
    endif
    if imag(r(i))<0
      i_plusminus = '+';
    else
      i_plusminus = '-';
    endif

    if complex
      complex=0
    else
      if imag(r(i))<eps
	tex = sprintf("%s (s + %g)", tex, -r(i));
      if abs(imag(r(i)))<1e-5
	ff = sprintf("%%s (%s %%s %s)",name, f);
	tex = sprintf(ff, tex, r_plusminus, abs(r(i)));
      else
	tex = sprintf("%s (s + %g \\pm %g)", tex, -real(r(i)), imag(r(i)));
	ff = sprintf("%%s (%s %%s %s \\pm j %s)", name, f, f)
	tex = sprintf(ff, tex, r_plusminus, abs(real(r(i))), imag(r(i)));
	complex=1;
      endif
    endif
  endfor
  
endfunction

Modified mttroot/mtt/bin/trans/m/pol2tex.m from [b5ee4e9a89] to [ea33ca5e52].

1

2
3

4



5
6
7
8
9
10



11
12
13
14
15








16
17
18
19
20
21
22
23
24

25

26
27
28
29

30
31

32
33
34
35
36
37
38
39
40
41

42

43
44

45
46

47
48
49
50
51
52
53

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

40
41
42
43

44
45

46
47
48
49
50
51
52
53
54
55
56
57

58
59

60
61

62
63
64
65
66
67
68
69
-
+

-
+

+
+
+






+
+
+





+
+
+
+
+
+
+
+









+
-
+



-
+

-
+










+
-
+

-
+

-
+







function tex = pol2tex(pol)
function tex = pol2tex(pol,name,f)
  ## pol2tex: converts polynomial into LaTeX form.
  ## tex = pol2tex(pol)
  ## tex = pol2tex(pol,[name,f])
  
  ## pol  polynomial (row vector)
  ## name name of the variable (eg s or z)
  ## f    format of the coefficients (eg %2.4f)

  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.1  2001/05/10 11:44:40  gawthrop
  ## Useful conversion functions
  ##
  ## Revision 1.1  1999/03/25 01:33:51  peterg
  ## Initial revision
  ##
  ###############################################################

  if nargin<2
    name = "s"
  endif
  
  if nargin<3
    f = "%2.2f";
  endif
  
  n = length(pol);
  
  if pol(1) == 1
    if n>1
      tex = '';
    else
      tex = '1';
    endif
  else
    ff = sprintf(" %s",f);
    tex = sprintf(" %1.2f", pol(1));
    tex = sprintf(ff, pol(1));
  endif
  
  if n>2
    tex = sprintf("%ss^%1.f", tex, n-1);
    tex = sprintf("%s{%s}^%i", tex, name, n-1);
  elseif n==2
    tex = sprintf("%ss", tex);
    tex = sprintf("%s{%s}", tex, name);
  else
    tex = sprintf("%s", tex);
  endif

  for i=2:n
    if pol(i)<0
      plusminus = '-';
    else
      plusminus = '+';
    endif
    ff = sprintf("%%s %%s %s",f);
    tex = sprintf("%s %s %1.2f", tex, plusminus, abs(pol(i)));
    tex = sprintf(ff, tex, plusminus, abs(pol(i)));
    if i<n-1
      tex = sprintf("%ss^%1.0f", tex, n-i);
      tex = sprintf("%s{%s}^%i", tex, name, n-i);
    elseif i==n-1
      tex = sprintf("%ss", tex); 
      tex = sprintf("%s{%s}", tex, name); 
    else
      tex = sprintf("%s", tex);
    endif
  endfor
endfunction



MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]