Matlab Function ブロックにオブジェクトを渡したい
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Matlab Function ブロックにベースワークスペースにあるserialオブジェクトを渡したいのですがどうすればよいでしょうか?
0 commentaires
Réponses (1)
Atsushi Matsumoto
le 16 Avr 2018
Modifié(e) : Atsushi Matsumoto
le 17 Avr 2018
MATLAB Functionブロックのパラメータ引数は数値データしか対応していないので、オブジェクトを受け渡すことができません。 ワークスペース間でデータを共有する関数assigninを使ってはどうでしょうか?
function y = fcn(u)
coder.extrinsic('assignin')
obj_mlf = [];
assignin('base', 'obj', obj_mlf)
y = u;
※objはMATLABワークスペースにあるSerialオブジェクト変数です。
 
うまく行かなかったらその旨教えて下さい。
0 commentaires
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!