File Exchange

image thumbnail

Read Wikipedia articles

version 1.3 (3.53 KB) by

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

1 Download

Updated

View License

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

Comments and Ratings (3)

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

Joachim

Shahab

Shahab (view profile)

helpful

Updates

1.3

Rewrote help section

1.2

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

1.1

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

MATLAB Release
MATLAB 7.9 (R2009b)

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

» Watch video