outputting simulink variable to matlab
i am tryingt o output a number for 1-255 from simulink into matlab and use it imediatly. using the to file and to workspace only updates the data when the stop button is pressed and i am trying to use it in real time, is there some setting that i can not find. i have read multiple how to' s about this but they are not any help.
0
Comments
I don't have any experience with simulink, but it would seem that you could do whatever you wanted to inside of simulink...
i am using the variables in an output command. i have attempted to use the built in rs232 connections but it will not output the correct commands. becasue the system i am using requires letters and numbers, while simulink will only allow me to input numbers into the constants.
-drasnor
%port is the variable given to the SV203 connection
%servo is the servo number you would like to move
%value is the value you would like the servo to move to
function servoVal(port,servo,value)
servo = num2str (servo);
value = num2str (value);
transmit = strcat('SV',servo,'M',value);
fprintf(port, transmit);
this is code i have received form someone else who is using the sv203 on a different platform.
where port =
sv = serial('com7', 'BaudRate', 9600, 'terminator', 'CR/LF');
i am able to call this in matlab and it works fine but i am trying to call it using values in simulink. by sending to matlab or using the matlab fcn command which does not work for me, or s-functions.
SV3M85
is the command that is sent directly to the serial.