- Convert the datetime data to a string format in Spotfire using a supported format string that MATLAB can interpret, such as ISO 8601 (`'yyyy-MM-ddTHH:mm:ss'`).
- Send this string to MPS.
- In your MATLAB function that is deployed on MPS, convert the string back to a datetime using `datetime` function with the appropriate format.
Matlab production server and tibco spotfire data marshalling.
2 ビュー (過去 30 日間)
古いコメントを表示
How can I marshall date time data column from TIBCO Spotfire to Matlab production server?
When I try to send datetime from spotfire to mps I have 2 kind of errors :
- If data format is date time error on mps side.
- If data format is string, no error from mps but Spotfire :
could not execute function call 'MyFunction' (2)
Message missing required fields: lhs[0].type
0 件のコメント
回答 (1 件)
Hari
2024 年 1 月 10 日
Hi Miguel Marmori,
I understand that you are trying to order datetime data from TIBCO Spotfire to MATLAB Production Server (MPS) and are encountering errors. When sending datetime-formatted data, you receive an error on the MPS side, and when sending string-formatted data, you encounter an error in Spotfire related to missing required fields.
To resolve the marshalling of datetime data, you should ensure that the data is serialized into a format that MPS can understand. MPS expects data to be in a format that can be deserialized into MATLAB types. For datetime, this often means converting to a string representation that MATLAB can interpret and then converting back to datetime within MATLAB.
Here's a general approach:
Example MATLAB function code snippet:
function result = MyFunction(datetimeString)
% Convert string to datetime
datetimeValue = datetime(datetimeString, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss');
% Your code here to process datetimeValue
% Prepare the result
result = ...; % some result based on your processing
end
Refer to the documentation of MATLAB Production Server for more information on data marshalling and type conversion:
For details on how to work with datetime in MATLAB and perform conversions, refer the MATLAB documentation for the "datetime" function:
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Installation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!