سلام من می خوام یک موتور پله ای رو با استفاده از gui متلب کنترل کنم .اما مشکل اینه که موتور با اولین رشته ارسالی از متلب می چرخه اما اگر برای بار دوم روی دکمه ارسال کلیک کنم دیگه موتور کار نمیکنه یعنی باید پنجره اجرا بسته بشه و فایل دوباره اجرا بشه تا موتور با مقدار جدید بچرخه.من نمیدونم کجا و چطوری توی حلقه بگدارمش کسی می تونه کمک کنه؟ این کدی هست که برای دکمه ارسال نوشتم .
spee=get(handles.s1,'String'
;
stardeg=get(handles.sd1,'String'
;
stopdeg=get(handles.sd2,'String'
;
rotd=get(handles.rd,'Value'
;
y4=num2str(rotd);
s=strcat('$',spee,',',stardeg, ',',stopdeg,',',y4,'# 9
fopen(m);
fprintf(m,'%s',s);
fclose(m);
spee=get(handles.s1,'String'

stardeg=get(handles.sd1,'String'

stopdeg=get(handles.sd2,'String'

rotd=get(handles.rd,'Value'

y4=num2str(rotd);
s=strcat('$',spee,',',stardeg, ',',stopdeg,',',y4,'# 9

fopen(m);
fprintf(m,'%s',s);
fclose(m);