![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/180879/image.png)
Simulinkのモデルで配列データを読み込み、指定した要素の値を取得する方法
250 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Simulinkのモデルでモデル実行中にまず配列データ(例:a(10,10))を読み込み、あるアクションに応じて読み込んだ配列データから指定した要素の値(例:a(1,2))を取得する方法が分からないので教えて頂けないでしょうか。配列データは、時間軸のデータを含まず、データテーブルとして利用するイメージになります。
0 commentaires
Réponse acceptée
Yoko
le 4 Avr 2018
配列から特定の要素のデータを取り込むブロックとして、Selector ブロック (Simulink/Signal Routing ライブラリ)があります。2次元配列なら、入力の次元数を 2 、インデックスオプションを 'インデックス ベクトル(端子)'とすると、外部信号で取得する配列が指定できるようになり、アクションに応じて配列を変更できるかと思います。(下図は R2017b 版の図)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/180879/image.png)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Signal Routing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!