<< quit | Core | sha256 >> |
run(script_file) |
run(script_file, 'nocatch') |
bsuccess = run(script_file, 'errcatch') |
a string: path of a script
a string: default option (no error catch)
a string: error catched
a logical: true if no error detected during script execution
run(script_file) executes a Nelson's script file (.m file extension).
Creates two .m in temp directory to use as example:
fd = fopen([tempdir(), 'example_run_ok.m'], 'wt');
fprintf(fd, ['A = 1;', char(10)]);
fprintf(fd, ['B = 2;', char(10)]);
fprintf(fd, ['C = A + B', char(10)]);
fclose(fd);
fd = fopen([tempdir(), 'example_run_not_ok.m'], 'wt');
fprintf(fd, ['AA = 1;', char(10)]);
fprintf(fd, ['CC = AA + BB', char(10)]);
fclose(fd);
run a script without error.
run([tempdir(), 'example_run_ok.m']);
run a script and catch error (no error).
bsuccess = run([tempdir(), 'example_run_ok.m'], 'errcatch')
run a script and catch error (with error).
bsuccess = run([tempdir(), 'example_run_not_ok.m'], 'errcatch')
run a script and no catch error.
run([tempdir(), 'example_run_not_ok.m'], 'nocatch');
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET