18-5 ��������������������?

MATLAB ]iHŪWɮסAq`ڭ̬Oĥ URL]Universal Resource Locator^覡ӫwoǺWɮסAҦpG

bUCdҤAڭ̨ϥ urlread OŪ̦bMؤjǸTtAñNGwrܼ contentsApUG

Example 1: 18-ɮŪg/urlread01.mcontents = urlread('http://www.cs.nthu.edu.tw/~jang'); disp(contents);<HTML> <HEAD> <META http-equiv="Refresh" content="0; URL=http://neural.cs.nthu.edu.tw/jang"> </HEAD> <BODY> The link you just clicked is obsolete.<br> You are being transported automatically to Roger Jang's current homepage at <a href="http://neural.cs.nthu.edu.tw/jang"> http://neural.cs.nthu.edu.tw/jang</a>. </BODY> </HTML>

ڭ̤]iHbŪANxs쥻wФAoɥi urlwrite OAdҦpUGҦpG

Example 2: 18-ɮŪg/urlread02.mtempFile = [tempname, '.html']; % wȦsɮ urlwrite('http://www.google.com.tw', tempFile); % Negɮ dos(['start ', tempFile]); % }Ҧɮ

bWzdҤAڭ̱N www.google.com.tw eg@ӼȦsɮסAMAϥs}ҦɮסC

t@өM\hOHoqllAi sendmail OӹFAMoӥ\MɮŪgSYA]OOb

{matlabڥؿ}\toolbox\matlab\iofun\

ҥHڭ̤]bo̤@ֻCSendmail OΪkpUG

sendmail(TO, SUBJECT, MESSAGE, ATTACHMENTS)

HUoӽdҨϥ sendmail ӱHoqllܨ챵bG

Example 3: 18-ɮŪg/sendmail01.mto = {'email1@aaa.bbb.ccc', 'email2@aaa.bbb.ccc'}; to = {'jang@cs.nthu.edu.tw'}; subject = 'Test email from a MATLAB program'; message = ['This is a test email sent via', 10, ' sendmail.']; attachment = {'c:\windows\matlab.ini'}; sendmail(to, subject, message, attachment);Error in running sendmail01! (Logged to error.log)

bWzdҤeAаȥN to eאּAۤvqllA_hANLk즹lA]NLkT{{XTʤFC

Hint
Ynbl󤺮e[JCAiHϥ ASCII Xu10vAҦpGmessage=[Sir:, 10, This is a test]C


MATLAB{]pGJg