MATLAB commands not executing on Jenkins agent machine
2 views (last 30 days)
Show older comments
Hello,
I am trying out Jenkins Master-Agent configuration. I want to trigger a MATLAB script that reads a text from .txt file and writes it to a excel file. Below is the MATLAB script written in Testmat.m:
addpath('C:\Slave_Node')
fileID = fopen('Test1.txt','r');
formatSpec='%s';
A = fscanf(fileID,formatSpec);
fclose(fileID);
xlswrite('testdata.xls',A);
The batch script in Jenkins Pipeline to trigger the above Testmast.m file is:
bat label: '', script: '''"C:\\Program Files\\MATLAB\\R2015b\\bin\\matlab.exe" -wait -sd "C:\\Test_Excel_Sharan" -r "restoredefaultpath;addpath(genpath(\'C:\\Test_Excel_Sharan\')); "run('C:\\Test_Excel_Sharan\\Testmat.m');quit force,end" -logfile "log_new.txt"'''
Both scripts work as expected on master machine, but when i run the above scripts on agent machine, Jenkins returns below error:
ERROR: script returned exit code 3
I am not if the issue from MATLAB or Jenkins.
Any help to resolve this issue would be appreciated.
Thanks,
Sharan
0 Comments
Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!