View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Read Wikipedia articles

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

Read Wikipedia articles


Mike Sheppard (view profile)


09 Jan 2011 (Updated )

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

| Watch this File

File Information

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
more on; S=wiki('Boston'), more off
S=wiki('Partial differential equation')

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 (3)
05 Nov 2015 Muthu Annamalai

Nice work! Please update http calls to https with the recent move to HTTPS by Wikipedia.

13 May 2011 Joachim

18 Jan 2011 Shahab

Shahab (view profile)


10 Jan 2011 1.1

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

14 Jan 2011 1.2

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

04 Apr 2012 1.3

Rewrote help section

Contact us