4.5

4.5 | 2 ratings Rate this file 3 Downloads (last 30 days) File Size: 3.53 KB File ID: #29985
image thumbnail

Read Wikipedia articles

by

 

09 Jan 2011 (Updated )

S=wiki(str) returns the Wikipedia article for string 'str'

| Watch this File

File Information
Description

S=wiki(str) returns the Wikipedia article for string 'str'
 
S=wiki returns a random Wikipedia article
 
For most articles the parsing is done almost correctly, however there may be minor parsing errors that may occur in the output. Suggestions to improve the code and/or parsing are welcome, with contact information in comments.
 
The input can be any alpha-numeric character, or symbol, including spaces. Entire input is converted to hexadecimal for Wikipedia to read and interpret. This helps with articles that contain special characters. If a redirect exists the redirected article will be returned.
 
If no article is found an error will be given. An article may still exist just the input may be in the wrong format or misspelled. No automatic corrections are attempted.
 
The output is formatted to the size of the Command Window such that the article wraps around to the next line, with no word being cut-off.
 
For long articles using 'wiki' along with 'more' helps in reading
 
EXAMPLES:
S=wiki('Mathworks')
more on; S=wiki('Boston'), more off
S=wiki('¿')
S=wiki('Partial differential equation')
S=wiki

MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
13 May 2011 Joachim  
18 Jan 2011 Shahab

helpful

Updates
10 Jan 2011

Modified: 10-Jan-2011 Improved function to wrap string and minor edits

14 Jan 2011

14-Jan-2011 Replace html codes with proper symbols, fixed wrapstring2

04 Apr 2012

Rewrote help section

Contact us