フィルターのクリア

HTML Markup - how to use Variables from Workspace

5 ビュー (過去 30 日間)
Pascal Vaupel
Pascal Vaupel 2023 年 7 月 27 日
回答済み: Harald 2023 年 7 月 27 日
I want to generate text via Markup using HTML. I want some placeholders in the text were the content of a workspacevariable is placed. Is that possible?
Thats my code for example:
%%
%
% <html>
% <body>
% The volume of a box is [content of my string test1].
% </body>
% </html>
%
In my workspace:
test1 = "5.3"

回答 (1 件)

Harald
Harald 2023 年 7 月 27 日
Hi Pascal,
is my understanding correct that the HTML code is stored in a file and that it includes placeholders, and that you are asking how to populate the place holder?
If so, I would use fileread to read the entire file and replace to replace the placeholder with the content of the variable. If you have multiple placeholders, I recommend using structs to store the multiple variables and not overcrowd the workspace.
Best wishes,
Harald

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by