call a matlab script in a script

后端 未结 4 1966
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 03:20

I have two matlab script files .m (not function files) and if I want to call another script in my current script, which command should I use? Thank you.

4条回答
  •  盖世英雄少女心
    2021-02-13 03:23

    In script test1.m put this: function test1 disp('test 1')

    aaa=111;
    
    test2( aaa );
    

    end

    In test2.m put this, then run test1.m: function test2(aaa) fprintf('test 2 aaa=%d !!!\n', aaa ) end

提交回复
热议问题