Pause execution to allow sensor connection

I am attempting to write a script that will turn connector on and after displaying the IP address and password, pause to allow the user an opportunity to connect to MATLAB. So far every attempt at pausing (by either the pause command, waitfor command, or uiwait) results in the device not connecting to MATLAB. If I stop the script altogether by using Ctrl+C, the device immediately connects. Is there a way to pause to allow time for a user to connect to MATLAB before proceeding?
MATLAB R2016a on Mac OS X 10.11.4
MATLAB Mobile 5.2.1 on iOS 9.3.1
----------------------------------
clc; % clean start, phase 1
clearvars; % clean start, phase 2
connector off; % to make sure IP is displayed to user in next stage
%this house is clean
disp(sprintf('Initializing network communications...\n'));
connector on 12345; % turn on connector
m=mobiledev; % initialize sensor
h=(msgbox(sprintf('Connect to the IP address shown.\nThe password is: 12345')));
waitfor(h);

댓글 수: 1

Geoff Hayes
Geoff Hayes 2016년 4월 2일
Joshua - please clarify what you mean by allow the user an opportunity to connect to MATLAB. What are the steps that the user is following to make the connection?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

제품

질문:

2016년 4월 2일

댓글:

2016년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by