<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-pnb.eri.ucsb.edu/index.php?action=history&amp;feed=atom&amp;title=Hs6_split.m</id>
	<title>Hs6 split.m - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-pnb.eri.ucsb.edu/index.php?action=history&amp;feed=atom&amp;title=Hs6_split.m"/>
	<link rel="alternate" type="text/html" href="https://wiki-pnb.eri.ucsb.edu/index.php?title=Hs6_split.m&amp;action=history"/>
	<updated>2026-05-24T12:20:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki-pnb.eri.ucsb.edu/index.php?title=Hs6_split.m&amp;diff=185&amp;oldid=prev</id>
		<title>128.111.101.185: Created page with '&lt;pre&gt; function hs6_split() %Created by Erik Stassinos 5/26/2010 %This function takes the input single lcd and then slits it into up and %downcast matricies   line =0; h1=0; id = …'</title>
		<link rel="alternate" type="text/html" href="https://wiki-pnb.eri.ucsb.edu/index.php?title=Hs6_split.m&amp;diff=185&amp;oldid=prev"/>
		<updated>2010-08-03T00:01:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;lt;pre&amp;gt; function hs6_split() %Created by Erik Stassinos 5/26/2010 %This function takes the input single lcd and then slits it into up and %downcast matricies   line =0; h1=0; id = …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
function hs6_split()&lt;br /&gt;
%Created by Erik Stassinos 5/26/2010&lt;br /&gt;
%This function takes the input single lcd and then slits it into up and&lt;br /&gt;
%downcast matricies&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
line =0;&lt;br /&gt;
h1=0;&lt;br /&gt;
id = fopen('list_hs6')&lt;br /&gt;
    if id == -1&lt;br /&gt;
        disp('cannot find hs6 list file')&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
while feof(id) ~=1&lt;br /&gt;
     tu = fgets(id);&lt;br /&gt;
    h1 = h1+1;&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
frewind(id)&lt;br /&gt;
  for i = 1:h1%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br /&gt;
    %clear h1;&lt;br /&gt;
    line =0;&lt;br /&gt;
      r = fgets(id);&lt;br /&gt;
            length(r);&lt;br /&gt;
            t = textscan(r,'%s');&lt;br /&gt;
            p = char(t{1,:})&lt;br /&gt;
          [in,mer,dep] =  index1(p); &lt;br /&gt;
          in{1};&lt;br /&gt;
          in{2};&lt;br /&gt;
          in{3};&lt;br /&gt;
          in{4};&lt;br /&gt;
          &lt;br /&gt;
          m = strrep(p,'.lcd','.datmat');&lt;br /&gt;
          mat = load(m,'.ASC');&lt;br /&gt;
          width = length(mat(1,:));&lt;br /&gt;
         &lt;br /&gt;
          %format long&lt;br /&gt;
     clear ij&lt;br /&gt;
     clear downcastmatrix&lt;br /&gt;
     clear upcastmatrix&lt;br /&gt;
&lt;br /&gt;
             for ij = in{1}:1:in{2};&lt;br /&gt;
             downcastmatrix(ij-(in{1}-1),:) = mat(ij,1:width); %starts from 1 and goes to in2&lt;br /&gt;
             end&lt;br /&gt;
             for r = in{3}:in{4};&lt;br /&gt;
             upcastmatrix(r-(in{3}-1),:) = mat(r,1:width);&lt;br /&gt;
             end&lt;br /&gt;
             dlmwrite(strcat(m,'.1'),downcastmatrix,'delimiter',' ','precision',6);&lt;br /&gt;
             dlmwrite(strcat(m,'.2'),upcastmatrix,'delimiter',' ','precision',6);&lt;br /&gt;
             &lt;br /&gt;
             &lt;br /&gt;
             name1 = strrep(p,'.lcd','.lcd.1')&lt;br /&gt;
             name2 = strrep(p,'.lcd','.lcd.2')&lt;br /&gt;
             nfile1 = fopen(strrep(p,'.lcd','.lcd.1'),'w+');&lt;br /&gt;
             nfile2 =  fopen(strrep(p,'.lcd','.lcd.2'),'w+');&lt;br /&gt;
             oglcd = fopen(p)&lt;br /&gt;
             &lt;br /&gt;
             while strncmp(line,'&amp;lt;data&amp;gt;',6) ~= 1&lt;br /&gt;
                 if strncmp(line,'&amp;lt;data&amp;gt;',6) == 1&lt;br /&gt;
                       break&lt;br /&gt;
                 end&lt;br /&gt;
               &lt;br /&gt;
                 line = fgets(oglcd)&lt;br /&gt;
                 fprintf(nfile1,'%s',line);&lt;br /&gt;
                 fprintf(nfile2,'%s',line);     &lt;br /&gt;
             end&lt;br /&gt;
             dn = fopen(strcat(m,'.1'),'r');&lt;br /&gt;
             up = fopen(strcat(m,'.2'),'r');&lt;br /&gt;
             &lt;br /&gt;
             for dc = 1:length(downcastmatrix(:,1))&lt;br /&gt;
                 down = fgets(dn);&lt;br /&gt;
                 fprintf(nfile1,'%s',down);&lt;br /&gt;
             end&lt;br /&gt;
             for uc = 1:length(upcastmatrix(:,1))&lt;br /&gt;
                 upc = fgets(up);&lt;br /&gt;
                fprintf(nfile2,'%s',upc);&lt;br /&gt;
             end&lt;br /&gt;
             fprintf(nfile1,'%s\n','&amp;lt;filters_used&amp;gt;')&lt;br /&gt;
             fprintf(nfile2,'%s\n','&amp;lt;filters_used&amp;gt;')&lt;br /&gt;
             &lt;br /&gt;
%=====update list_hs6======&lt;br /&gt;
&lt;br /&gt;
h = i*2&lt;br /&gt;
r = h-1&lt;br /&gt;
   newl(r,:) = name1;&lt;br /&gt;
   newl(h,:) = name2&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
 dlmwrite('list_hs6_s',newl,'');&lt;br /&gt;
  &lt;br /&gt;
  fclose all&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;[[hs6_split]]&amp;lt;big&amp;gt;&lt;/div&gt;</summary>
		<author><name>128.111.101.185</name></author>
		
	</entry>
</feed>