M-file's initial parameters in Simulink

Status
Not open for further replies.

HAIDE

Junior Member level 3
Joined
Feb 9, 2012
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
GERMANY
Activity points
1,525

Dear all,
I used m-file on Simulink by Matlab Function as shown in attached pic, In m-fie I write a code with parameters that need to have initialize value , for example the code is:

HTML:
function out=control(in)
rin=in(1);
       for j=1:1:6
          h(j)=exp(-norm(x-ci(:,j))^2/(2*bi(j)*bi(j)));
       end
x(1)=h;
x(2)=rin;
 
 it is needed to set initial value fr x as [0 , 0], but how is possible in Simulink?
 

i would suggest you to move on to level-2 m-file function blocks in simulink to have better control over these kind of stuffs.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…