Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 908a9986c5401ab963eda29cc97a280a0cbe5d0a7947ece9acf472e2bf1b594d
User & Date: gawthrop@users.sourceforge.net on 1998-07-02 12:36:39
Other Links: branch diff | manifest | tags
Context
1998-07-02
13:28:31
Added defaults in new form BEFORE alias expansion check-in: d70f8561a3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:36:39
Initial revision check-in: 908a9986c5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:36:05
Removed debugging lines check-in: 3a5336b3d3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/m/replace_name.m version [d28ce054d4].



































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function string_array = replace_name(string_array, new, index); 
% Replaces a row of a string vector with a string of arbitary length.

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


  [N,M]=size(string_array);
  L = length(new);
  
  if index>N 
    error(["String array has less than ", num2str(index), " rows"]);
  end;
  
  if L<M			# Pad the new string
    new = [new, blanks(M-L)];
  elseif M<L			# Pad the array
    for i=1:L-M
      string_array=[string_array, blanks(N)'];
    end
  end

  string_array(index,:) = new;	# Replace ith row by new string

endfunction

    
    



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