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 ExchangeApp 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