ft_find_text_in_block.m
来自「用matlab做的Frequency domain INterferomEter」· M 代码 · 共 41 行
M
41 行
%--------------------------------------------------------------------- % function [line_numbers] = FT_find_text_in_block(block,searchtext)% % Finds a search string in a block and returns the line numbers% where it was found.%% block: block structure% searchtext: string, text to search for% line_numbers, vector of integers, giving the lines in which % searchtext was found%% Part of the SimTools package% Andreas Freise 22.05.08 afreise@googlemail.com%--------------------------------------------------------------------- function [line_numbers] = FT_find_text_in_block(block,searchtext) baseid='FT_find_text_in_block'; if (~isstruct(block)) msgid=[baseid,':checkinarg']; result='first input argument must be a block structure'; error(msgid,result); end if (~isstr(searchtext)) msgid=[baseid,':checkinarg']; result='second input argument must be a string'; error(msgid,result); end line_numbers=[]; for i=1:block.n_lines found=strfind(block.txt_lines{i},searchtext); if (found) line_numbers = [line_numbers, i]; end end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?