Using Workspace data in Matlab function block - SIMULINK

8 ビュー (過去 30 日間)
Dhiraj
Dhiraj 2012 年 6 月 8 日
コメント済み: waqas ur rehman 2021 年 11 月 1 日
I have got a DATA.mat which contains a structure with many different 2d maps. I have loaded the mat file into the workspace. I have a SIMULINK model with a matlab function block and I intend to make use of the maps in the function block. How can I do it ?

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2012 年 6 月 11 日
If the maps are very large, you can use them as global data inside MATLAB Function blocks via Data Store Memory blocks.
Besides TAB's solution, you can also import the variables in a MATLAB Function block by creating parameter data on the block with the same name as the workspace variable. (On the editor, select Tools>Edit Data/Ports)
  2 件のコメント
Gayan Lankeshwara
Gayan Lankeshwara 2020 年 3 月 4 日
Hi Kaustubha,
I would kindly like to know how I can import variables from the workspace for Interpreted MATLAB functions in Simulink, because Edit Ports/ Data facility is not over there.
The reason why I am using an Interpreted MATLAB function block is because I believe that I can compute the optimisation algorithm that I developed with YALMIP toolbox over there.
Thank you.
waqas ur rehman
waqas ur rehman 2021 年 11 月 1 日
Hi Gayan @Gayan Lankeshwara , did you get a solution to this problem? I'm facing the same issue and couldn't find a solution yet. I'd really appreciate your support.
Best,

サインインしてコメントする。


TAB
TAB 2012 年 6 月 11 日
Read the loaded workspace variables in Constant blocks and pass theses blocks as input to the matlab function block.

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by