File Exchange Pick of the Week

Our best user submissions

Star Wars API Reader

Sean‘s pick this week is Star Wars API Reader by Heather Gorr.

What is the average height of an Ewok?

allspecies = swapiread('species');
allspecies(allspecies.name == "Ewok", 'average_height')
ans =
  table
    average_height
    ______________
         100      

Apparently, they also speak Ewokese!

Do they have names?

allbeings = swapiread('people');
allbeings.name(allbeings.species == "Ewok")
ans = 
    "Wicket Systri Warrick"

Apparently, there’s only one listed. That’s sad.

Heather’s Star Wars API reader makes it easy to answer questions like these and many others immediately available from the
MATLAB command line. Now you don’t even need to look up or feign interest in order to answer that question your Star Wars
crazed colleague couldn’t figure out about whatever the third film was.

films = swapiread('films');
films(films.episode_id==3, 'title')
films{films.episode_id==3, 'opening_crawl'}
ans =
  table
            title        
    _____________________
    "Revenge of the Sith"
ans = 
    "War! The Republic is crumbling
     under attacks by the ruthless
     Sith Lord, Count Dooku.
     There are heroes on both sides.
     Evil is everywhere.
     
     In a stunning move, the
     fiendish droid leader, General
     Grievous, has swept into the
     Republic capital and kidnapped
     Chancellor Palpatine, leader of
     the Galactic Senate.
     
     As the Separatist Droid Army
     attempts to flee the besieged
     capital with their valuable
     hostage, two Jedi Knights lead a
     desperate mission to rescue the
     captive Chancellor...."

Comments

Give it a try and let us know what you think here or leave a comment for Heather.

Published with MATLAB® R2018a

|

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.