-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmps_example.m
More file actions
22 lines (22 loc) · 896 Bytes
/
mps_example.m
File metadata and controls
22 lines (22 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%% Create service object
addr = 'http://<address>:<port>'; % enter your MATLAB Production Server address
app = '...'; % enter your deployed application name
mps = WEB.MPS(addr, app);
%% Get server health
mps.health()
%% Services discovery
[res, err] = mps.discovery()
%% Execute deployed function
mps.setOutputFormat('mode', 'large'); % set output format (optional)
fcnname = '...'; % deployed function name
argsin = {'...'}; % input arguments
nargsout = 1; % number of output arguments
[res, err] = mps.exec(fcnname, argsin, nargsout)
%% Asynchronous execution
fcnname = '...'; % deployed function name
argsin = {'...'}; % input arguments
nargsout = 1; % number of output arguments
[res, err] = mps.async(fcnname, argsin, nargsout) % create async request
res = mps.information() % get response information and state
res = mps.result() % get response result
mps.delete() % delete request from MPS