Switch Value not changing in matlab app designer function

조회 수: 5 (최근 30일)
UMAIR RASOOL
UMAIR RASOOL 2021년 5월 2일
Hi i would like to have suggestions about how can i monitor the value of a switch in Matlab app desinger..i have a while loop to count the frames of video and want to break the loop when the switch value is paused. here is my code. the problem is that the switch value is not changing as the loop runs but it should.
function Camera_number(app,Cam_no)
Mode=app.Switch.Value;
if(strcmp(Mode,'Play'))
Option=0;
else
Option=1
end
switch Option
case 0
if strcmp(Cam_no,'Cam1')
temp=zeros(1,5);
j=1;
Frnu=app.FamraNumer;
while (Frnu<99)
sw=app.Switch.Value
if(strcmp(sw,'pause'))
break;
else
image(app.UIAxes2,app.Frames(:,:,:,Frnu));
k=j;
while j<k+4
temp=[temp,app.Data(j,:)];
j=j+1;
plot(app.UIAxes,temp,'ko')
end
Frnu=Frnu+1
pause(.1);
end
plot(app.UIAxes,temp)
end
end
end
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by