📄 ft_example2.m
字号:
clear all;% name of kat file which contains 'blocks'inname='testblock.kat';% name of file that we will create now from this scriptkatname='mytest.kat';% read in block from testblock.katblock=FT_read_blocks_from_file(inname);% now selectively copy some blocks from the list 'block' over% into the list 'outbl'.% we can access the block usually by name or by index:outbl(1)=FT_copy_block(block,2); %second block is the 'laser'outbl(2)=FT_copy_block(block,'cavity');outbl(3)=FT_copy_block(block,'detection');% create a new block by hand, containing just an xaxis commandoutbl(4)=FT_create_new_block('command1');outbl(4)=FT_add_line_to_block(outbl(4),'xaxis m1 phi lin 0 10 100');% write all blocks from list 'outbl' to file 'mytest.kat'FT_write_blocks_into_file(outbl,katname);% BTW we can also delete from the block% e.g. this finds all lines containing an 'm'xxx=FT_find_text_in_block(outbl(2),'m');% and now we delete themoutbl(2)=FT_remove_lines_from_block(outbl(2),xxx);% the following is the same as in FT_example1.m% initialise FinesseFT=FT_create_new_FT();FT=FT_check_for_kat_binary(FT);% run Finese and read dataRun1=FT_create_new_kat_run();Run1.filename=katname;Run1=FT_run_kat_simulation(FT,Run1);% plot dataplot(Run1.x,Run1.y)% clean directory again%FT_kat_clean(Run1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -