Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Check internet connection status using Matlab
Date: Mon, 20 Oct 2008 21:56:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gdiupj$l2q$1@fred.mathworks.com>
References: <cd7fd4a0-a476-4290-a70d-696a8800d7bf@v72g2000hsv.googlegroups.com> <c562fa59-86ba-4fc0-98d3-dad9b19b5051@a70g2000hsh.googlegroups.com> <gdaqd3$lt0$1@fred.mathworks.com> <gdb6kt$3jo$1@fred.mathworks.com> <gdijfm$jk9$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224539763 21594 172.30.248.37 (20 Oct 2008 21:56:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 20 Oct 2008 21:56:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869596
Xref: news.mathworks.com comp.soft-sys.matlab:496392


"Matthew Simoneau" <matthew@mathworks.com> wrote in message <gdijfm$jk9$1@fred.mathworks.com>...
> Scott, I think we can simplify your code by using URLREAD:
> 
> 
> function flag = isnet()
> % This function returns a 1 if basic internet connectivity
> % is present and returns a zero if no internet connectivity
> % is detected.
> 
> % define the URL for US Naval Observatory Time page
> url = 'http://tycho.usno.navy.mil/cgi-bin/timer.pl';
> 
> % Try to connect to it.
> [unused,flag] = urlread(url);

Nice. Man that is compact. 

Scott