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')
Rewrote help section
14-Jan-2011 Replace html codes with proper symbols, fixed wrapstring2
Modified: 10-Jan-2011 Improved function to wrap string and minor edits
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.