MATLAB commands not executing on Jenkins agent machine

조회 수: 3 (최근 30일)
Sharan Patil
Sharan Patil 2020년 7월 29일
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개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by