Skip to content
Snippets Groups Projects
Select Git revision
  • d45dcdf5eada43b91a71bbfd08d81f18b0ce6232
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

config

Blame
  • FT_comment_lines_in_block.m 1.14 KiB
    %---------------------------------------------------------------------  
    % function [block] = FT_comment_lines_in_block(block,line_numbers)
    % 
    % Add comment char in front of lines given by line number.
    %
    % block: block structure
    % line_numbers: vector of integers, specifying lines to be commented
    %
    % Part of the SimTools package
    % Andreas Freise 22.05.08 afreise@googlemail.com
    %---------------------------------------------------------------------  
    
    function [block] = FT_comment_lines_in_block(block,line_numbers)
    
      baseid='FT_comment_lines_in_block';
        
      if (~isstruct(block))
        msgid=[baseid,':checkinarg'];
        result='first input argument must be a block structure';
        error(msgid,result);
      end
      
      if (~isnumeric(line_numbers))
        msgid=[baseid,':checkinarg'];
        result='second input argument must be numeric';
        error(msgid,result);
      end
      
      if (line_numbers>block.n_lines)
        msgid=[baseid,':checkinarg'];
        result='line numbers given larger than block length';
        error(msgid,result);    
      end
    
      for i=line_numbers
        block.txt_lines(i)={FT_add_comment_char_to_line(cell2mat(block.txt_lines(i)))};
      end
      block.edited = 1;