Simulinkでのforループについて
55 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Simulink内でforループを作成したいのですがs-functionブロックを使わずにif,else文が含まれたロジックを組むことは可能でしょうか。 cソースコードだと (例) for(i = 0; i <= a; i++){ 文1;
for(j = 0; j <= b; j++){
文2;
if (uu[1] == 1 && p[i][j] < L){
文3;
}else{
文4;
}
}
J[i] = 文5;
if(i != 0){
if(条件){
bunn6
}
}
}
0 commentaires
Réponses (2)
Naoya
le 9 Oct 2018
MATLAB Functionブロックは、 MATLAB 言語ベースでSimulinkのブロックを実現することができます。頂いたコードフローを直観的にMATLAB 言語ベースで実現できます。
0 commentaires
Shoumei
le 19 Oct 2018
ForループやIf/Elseの中にどんな処理が入っているかにもよりますが、ブロックで書きたければSimulink/Ports & Subsystem/For Iterator SubsystemブロックやFor Each Subsystemブロックと分岐処理にSwitchブロックの組み合わせでもできそうです。
Voir également
Catégories
En savoir plus sur Prepare Model Inputs and Outputs 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!