I am blogging a little early this week because of the holiday. What holiday would that be? Square Root Day- 03/03/09. What makes this a particularly special event is that today’s video is number 144 (12^2) and I recorded it just minutes ago. Posted at 1:44 local time too! This kind of coincidence can not be ignored!
When I first thought of this video, I figured it would take three videos to solve the problem. When I actually sat down to read data from the web and interactively filter it, I was happy to see it could be done so quickly and easily.
Basically, the procedure is to read data from Many Eyes, then plot that Census data and filter it for city size. We will use URLREAD and TEXTSCAN to bring the data in and then interactive cell mode and plot to filter and visualize it.
URLREAD is great. It’s been a great help. I have a MATLAB interface to the UF Sparse Matrix Collection called UFget, which downloads matrices from the collection into the MATLAB workspace. I used to have a Java component to it, but now I can do it all in M, with URLREAD, and my code is now much simpler (and more robust).
You are a big nerd.
But the video was nice. Few lines of code for a large wow-factor.
Daniel,
Thanks for the kind words about the video.
Doug
PS. I prefer the term Geek! :)
URLREAD is great. It’s been a great help. I have a MATLAB interface to the UF Sparse Matrix Collection called UFget, which downloads matrices from the collection into the MATLAB workspace. I used to have a Java component to it, but now I can do it all in M, with URLREAD, and my code is now much simpler (and more robust).
Can you post the code in a text file?
Jim,
Sorry, I though I did post it. Here it is.
clear
clc
block = urlread(’http://manyeyes.alphaworks.ibm.com/manyeyes/datasets/us-zipcodes-with-city-state-fips-lat/versions/1.txt’);
%%
readData = textscan(block, ‘%n %n %s %s %n %n %n %n’, ‘delimiter’, char(9));
statenum = readData{1};
zip = readData{2};
abrev = readData{3};
city = readData{4};
lat = readData{5};
lon = readData{6};
pop = readData{7};
percent = readData{8};
clear readData
%%
load usapolygon
%%
vi = (pop > 53130.23903);
plot(uslon, uslat, -lat(vi), lon(vi), ‘.’)
%%
city{vi}
-Doug
This will be really handy as soon as Wolfram|Alpha is up and running!
@Russell,
I am not sure what you mean, how would they work together?
Doug