Matlab Function ブロックにオブジェクトを渡したい
Show older comments
Matlab Function ブロックにベースワークスペースにあるserialオブジェクトを渡したいのですがどうすればよいでしょうか?
Answers (1)
Atsushi Matsumoto
on 16 Apr 2018
Edited: Atsushi Matsumoto
on 17 Apr 2018
MATLAB Functionブロックのパラメータ引数は数値データしか対応していないので、オブジェクトを受け渡すことができません。 ワークスペース間でデータを共有する関数assigninを使ってはどうでしょうか?
function y = fcn(u)
coder.extrinsic('assignin')
obj_mlf = [];
assignin('base', 'obj', obj_mlf)
y = u;
※objはMATLABワークスペースにあるSerialオブジェクト変数です。
 
うまく行かなかったらその旨教えて下さい。
Categories
Find more on 変数 in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!