Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


SkipMatlabHelp.m

Go to the documentation of this file.
00001 function [CnoHelp] = SkipMatlabHelp (C)
00002 %
00003 %   [CnoHelp] = SkipMatlabHelp (C)
00004 %
00005 %Purpose:
00006 %   removes the first set of comments from a character array
00007 %   that would normally consiture matlab's help text (see example)
00008 %   
00009 %   
00010 %Input Parameters:
00011 %   C : a character array
00012 %   
00013 %   
00014 %Output Parameters:
00015 %   CnoHelp : C without the help comments
00016 %   
00017 %   
00018 %      
00019 %More Info :
00020 %   C = sprintf ('%%Hello Baby\n%%Couci Couci Cooo\nAbc = 100\n%%Waldo\njon=6')
00021 %   [CnoHelp] = SkipMatlabHelp (C)
00022 %   
00023 %  PurgeComments
00024 %       NextString
00025 %       FindChar
00026 %
00027 %     Author : Ziad Saad
00028 %     Date : Sat Mar 27 14:27:36 CST 1999 
00029 
00030 
00031 %Define the function name for easy referencing
00032 FuncName = 'SkipMatlabHelp';
00033 
00034 %Debug Flag
00035 DBG = 1;
00036 
00037 %initailize return variables
00038 err = 1;
00039 CnoHelp = [];
00040 
00041 
00042 if (C(1) == '%'),
00043         cpos = 1;
00044         Loc = 1;
00045         while (~isempty(Loc) & Loc(1) == 1 & ~isempty(C)),
00046                 %get the 1st line
00047                         [err, Cnext, cend] = NextString (C, 'NewLine', 1);
00048                 %get ridd of 1st line
00049                         nC = length(C);
00050                         C = C(cend+1:nC);
00051                 %search for first %
00052                         [err, Loc] = FindChar (C, '%');
00053         end
00054         CnoHelp = C;
00055 else
00056         CnoHelp = C;
00057 end
00058 
00059 err = 0;
00060 return;
00061 
 

Powered by Plone

This site conforms to the following standards: