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
|
function tex = pol2tex(pol,name,f)
## pol2tex: converts polynomial into LaTeX form.
## 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.2 2001/05/10 19:08:35 gawthrop
## Cosmetic improvements
##
## 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
|
>
>
>
>
>
>
>
|
|
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
|
function tex = pol2tex(pol,name,f)
## pol2tex: converts polynomial into LaTeX form.
## 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.3 2001/07/11 03:58:41 gawthrop
## removed {}
##
## Revision 1.2 2001/05/10 19:08:35 gawthrop
## Cosmetic improvements
##
## 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 n<1
tex = "--";
return
endif
if pol(1) == 1
if n>1
tex = '';
else
tex = '1';
endif
else
|