Skip to content
Snippets Groups Projects
Select Git revision
  • 6a2d7a88e36e40a273dce316c5942cb9d6f47900
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

bmplib.cpp

Blame
  • FT_example4.m 1.17 KiB
    
    clear all;
    
    % name of kat file which contains 'blocks'
    inname='testblock.kat';
    % name of file that we will create now from this script
    katname='mytest.kat';
    
    % read in block from testblock.kat
    block=FT_read_blocks_from_file(inname);
    
    % now selectively copy some blocks from the list 'block' over
    % into the list 'outbl'.
    outbl(1)=FT_copy_block(block,'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 command
    outbl(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 them
    outbl(2)=FT_remove_lines_from_block(outbl(2),xxx);
    
    % the following is the same as in FT_example1.m
    % initialise Finesse
    FT=FT_create_new_FT();
    FT=FT_check_for_kat_binary(FT);
    
    % run Finese and read data
    Run1=FT_create_new_kat_run();
    Run1.filename=katname;
    Run1=FT_run_kat_simulation(FT,Run1);
    
    % plot data
    plot(Run1.x,Run1.y)