MATLAB Production Server Examples
Connection Status
Tests connection to the MATLAB Production Server and lists all available archives using the discovery API.
const client = new MWProdServerClient('https://production-server-demo.mathworks-workshop.com');
const discovery = await client.discover();
console.log('Available archives:', Object.keys(discovery.archives));
Add Matrix Example
Demonstrates adding two matrices using the addmatrix function. This example shows how to pass array inputs
and receive numerical results.
const matrix1 = [1, 2, 3];
const matrix2 = [4, 5, 6];
const result = await client.addmatrix_addmatrix(matrix1, matrix2);
Load Forecaster Example
Gets day-ahead energy load forecasts for New York City. This example shows how to handle multiple return values
and work with time series data.
const [timestamp, energyload] = await client.LoadForecaster_getDayAheadForecast('N_Y_C_');
// timestamp contains time points
// energyload contains corresponding load values