Overview
Comment:Don't use strrep to remove[]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 93aa990c97ded5bbae41c1c00868b29b64e40ed14bb0757c1fd7110dd762843b
User & Date: gawthrop@users.sourceforge.net on 1998-08-26 11:59:20
Other Links: branch diff | manifest | tags
Context
1998-08-26
12:26:17
Replaced if N>0 by if (N>0)&&(M>0) # Flipped ports exist check-in: bb06871be9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:59:20
Don't use strrep to remove[] check-in: 93aa990c97 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1998-08-25
20:06:56
New data structure for abg.m and cbg.m check-in: 3416b8080a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/write_abg.m from [8109016093] to [b7c5c6ac25].

1
2
3
4
5
6
7



8
9
10
11
12
13
14
function write_abg(system_name,bonds,connections);

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



###############################################################


  fid=fopen([system_name,"_abg.m"], "w");
  [N,M]=size(connections);
  Sformat = "  %s.subsystems.%s.%s = \"%s\";\n";
  PSformat = "  %s.ports.%s.%s = \"%s\";\n";







>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function write_abg(system_name,bonds,connections);

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  1998/08/25 06:22:02  peterg
## Initial revision
##
###############################################################


  fid=fopen([system_name,"_abg.m"], "w");
  [N,M]=size(connections);
  Sformat = "  %s.subsystems.%s.%s = \"%s\";\n";
  PSformat = "  %s.ports.%s.%s = \"%s\";\n";
42
43
44
45
46
47
48
49
50
51


52

53
54
55
56
57
58
59

      fprintf(fid,Cformat,system_name,name);
      for j=1:m
      	fprintf(fid,"%i ", c(j));
      endfor;
      fprintf(fid,"];\n");
    else
      name = strrep(strrep(name,"[",""), "]", "");
      fprintf(fid,"\n# Port %s\n", name); 
      fprintf(fid,PIformat,system_name,name,"index",++i_port);


      fprintf(fid,PSformat,system_name,name,"arg",arg);


      c = nozeros(connections(i,:));# Connections to this component
      m = length(c);		# Number of connections

      fprintf(fid,PCformat,system_name,name);
      for j=1:m
      	fprintf(fid,"%i ", c(j));







|


>
>

>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

      fprintf(fid,Cformat,system_name,name);
      for j=1:m
      	fprintf(fid,"%i ", c(j));
      endfor;
      fprintf(fid,"];\n");
    else
      name=name(2:length(name)-1); # Strip []
      fprintf(fid,"\n# Port %s\n", name); 
      fprintf(fid,PIformat,system_name,name,"index",++i_port);
      fprintf(fid,PSformat,system_name,name,"type",comp_type);
      fprintf(fid,PSformat,system_name,name,"cr",cr);
      fprintf(fid,PSformat,system_name,name,"arg",arg);
      fprintf(fid,PIformat,system_name,name,"repetitions",repetitions);

      c = nozeros(connections(i,:));# Connections to this component
      m = length(c);		# Number of connections

      fprintf(fid,PCformat,system_name,name);
      for j=1:m
      	fprintf(fid,"%i ", c(j));


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