Effacer les filtres
Effacer les filtres

How to give input from matlab (mfile) to simulink model

2 vues (au cours des 30 derniers jours)
azan
azan le 4 Déc 2012
Hi everyone! I am using simulink model in mfile. The model requires an input, I know about the commands sim and simset. Can anyone guide me the syntax to give input. The piece of code which I am using is:
clc
clear all
close all
Kp=18; %system parameters
Ki=12; %system parameters
Kd=54; %system parameters
Tstop=1;
myinput=10 %input to my model
sim('pidtry',Tstop)
figure
plot(simout2)

Réponse acceptée

Muruganandham Subramanian
Muruganandham Subramanian le 4 Déc 2012
you can do this by creating variable 'myinput' as constant block in simulink model
  1 commentaire
TAB
TAB le 4 Déc 2012
Take a Constant block in model and put myinput in Value field. Constant block will read the variable myinput from base workspace.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by