How to pass an array in Matlab Production Server
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ismael Raqi Picardo
el 15 de Abr. de 2023
Comentada: Kojiro Saito
el 19 de Abr. de 2023
Im using Production Server Compiler to build an endpoint where a Java client can make petitions to, but when I'm trying to pass the parameters to my function, It only accepts simple numbers or strings, like [1, 30.2, 200, "example"] and I need to pass a 3D array (if it works for a 2D array I can make it work).
{ "nargout":1, "rhs": [10] } This works, because It pass the number 10 to my function parameter, but if I need an array of 5 numbers, for example, this doesn't work
{ "nargout":2, "rhs": [10, 20, 30, 40, 50] }
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1357313/image.png)
My test function:
function out = sumar(array)
array(1, :)
out = array;
end
Thanks!
0 comentarios
Respuesta aceptada
Kojiro Saito
el 19 de Abr. de 2023
You need to include "[" and "]" for passing arrays to MATLAB Production Server.
{"nargout":1, "rhs": [[10, 20, 30, 40, 50]]}
2 comentarios
Kojiro Saito
el 19 de Abr. de 2023
Thank you for your comment. Sure, above is JSON large notation wtih mwsize described in this document.
Más respuestas (0)
Ver también
Categorías
Más información sobre Installation en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!