////////////////////////////////////////////////// // Let's imagine a complex script // ////////////////////////////////////////////////// function out = myFunc1(x, y) a = grand(1, 1, 'unf', 0, 10); B = eye(3,3); C = [1 2 3 ; ... 3 2 -1 ; ... 1 -6 -6]; d = %t; for i=1:size(x, 'c') tmp = C\B; end ///////////////// // pause ///////////////// if a >= 5 then disp('Team Captain'); else disp('Team Ironman'); end out = [a d]; endfunction function out = myFunc2(x, y) myOut = myFunc1(x,y); e = myOut(2) & y; ///////////////// // pause ///////////////// while e tmp = myOut(1) + 1; end out = 'I am Groot'; endfunction ////////////////////////////////////////////////// // Let's run into an infinite loop // ////////////////////////////////////////////////// x = (1:10); y = %t; disp(myFunc2(x,y)) ////////////////////////////////////////////////// // Let's try a complete sequence // ////////////////////////////////////////////////// //x = (1:10); //y = %f; // //disp(myFunc2(x,y))