How to Get a Stock Quote Using Matlab

Note: Please read the disclaimer. The author is not providing professional investing advice.

While a previous article covered how to use Matlab to retrieve certain stock statistics from Yahoo! Finance, I thought I should post a separate script that just retrieves the price at which the stock last traded.

Why go through the trouble to do this from inside Matlab when you can just get the quote yourself right from Yahoo with a browser?

Well as (1) an engineer, I like to use Matlab to automate my stock screening process. And as (2) a value investor, I need Matlab to be able to compare what I believe a stock should be trading at, versus it’s current actual price per share.

That’s an easy way to let the computer find potential bargains. 😉

Here’s a link to the script with the function:


And here’s an example use of it to retrieve the last trade price for Apple Inc. (ticker AAPL):

last_trade = get_last_trade(‘AAPL’);