フィルターのクリア

Response data change in Html

4 ビュー (過去 30 日間)
Kin
Kin 2022 年 7 月 28 日
回答済み: Suraj 2023 年 9 月 20 日
I'm using UIHTML component in Matlab app designer, the html is built by REACT. The document showed the setup() function to response htmlcomponent object, but there is no setup function in React. Are there any way to receive the data from Matlab in React?

回答 (1 件)

Suraj
Suraj 2023 年 9 月 20 日
Hi Kin,
I understand that you would like to create a “setup()” function in your React app that will allow MATLAB and JavaScript to talk to each other.
You can achieve this by defining a “setup()” function just like how its described in the documentation for “uihtml” component in MATLAB. In order for MATLAB to discover your “setup()” function, you need to expose it at the window level. This can be done by adding the below line in your JavaScript file.
window.setup = setup;
This line creates the "setup()" method at the window level as well, and then “uihtml” can pass data and send/receive events with the embedded React webpage.
Documentation for "uihtml" component: https://www.mathworks.com/help/matlab/ref/uihtml.html
Best regards,
Suraj.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by