Generate image in matlab function and return stream as a result to C# library

4 ビュー (過去 30 日間)
Ramiz
Ramiz 2024 年 1 月 25 日
編集済み: Harsha Vardhan 2024 年 2 月 16 日
Hi,
Is it possible to generate image in matlab function and return stream as a result to C# library?
I have images in file system in the matlab format, like <some image>.mat, the image has a pretty big size. I want to write a function to load the image, decode it to png format and return as a memory stream to load in C# to display it in UI.

回答 (1 件)

Harsha Vardhan
Harsha Vardhan 2024 年 2 月 16 日
編集済み: Harsha Vardhan 2024 年 2 月 16 日
Hi,
I see that you are seeking advice on returning data from a user defined function in MATLAB to C#.
This can be done 3 ways.
  1. Use the MATLAB Compiler SDK product to convert a user-defined MATLAB function to a method of a .NET class and wrap the class in a .NET assembly. Then, access the component in a C# application. You may refer to its documentation here: https://www.mathworks.com/help/compiler_sdk/dotnet/integrate-simple-matlab-function.html
  2. Call a user-defined MATLAB function from a C# application using MATLAB as a COM Automation server. Please refer to its documentation here: https://www.mathworks.com/help/matlab/matlab_external/call-matlab-function-from-c-client.html
  3. Use MATLAB Coder to deploy MATLAB applications in a .NET environment without installing the MATLAB Runtime. You can check its documentation here: https://www.mathworks.com/company/technical-articles/generating-c-code-from-matlab-for-use-with-java-and-net-applications.html
I hope my response has been helpful to you!

カテゴリ

Help Center および File ExchangeMATLAB Compiler SDK についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by