Sharing data from a function to a workspace.

Is it possible to share data from a specific function defined under Matlab S-Function block to a base worksapce.
I tried these two evalin('base','name of variable u want to access'); assignin('base','name of variable u want to save','value of variable'); but i found that bot failed.
Example:
% Inside Matlab S-Funtion
function Outputs(block)
X=eye(4); Y=[1;1;1;1];
Z=X*Y;
How to get variable 'Z' to base worksapce. I need to use it in another statespace block in simulink on simulation. Please Help me

1 件のコメント

Jan
Jan 2015 年 5 月 19 日
Please do not paraphrase what you have tried but post the code.

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

回答 (1 件)

Jan
Jan 2015 年 5 月 19 日

0 投票

assignin('base', 'Z', Z);

カテゴリ

ヘルプ センター および File ExchangeLanguage Support についてさらに検索

質問済み:

2015 年 5 月 19 日

回答済み:

Jan
2015 年 5 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by