Hi everyone,
Found a great new function today.
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=6243
I was looking for something that could quickly make an outline from a mess of points, specifically a quick way to create a polygon shape to use with fill function to show the outline of a radial site's coverage area. Passing the complete array of locations results in a funky 80's Escher-like motif that's not at all pretty.
Anyway, as it turns out, the built-in "convhul" function does this, but it's goal is to minimize the circumference of the polygon whereas "hullfit" minimizes the polygon's area.
Why is this so noteworthy? Well, meshgrid and pcolor (among other functions) use convhul, and as we know they do a lousy job of showing data in areas that don't really exist. (That bend in NJ around Tuckerton is especially annoying, as is Sandy Hook since both tend to result in Codar data appearing on land.)
Well, the comments in "hullfit" showcases its true usefulness. I repeat some snippets from the simple example here...
xi=linspace(min(x),max(x),100);
yi=linspace(min(y),max(y),100);
zi=griddata(x,y,z,xi,yi');
k=hullfit(x,y,0.1);
[xx,yy]=meshgrid(xi,yi);
in=inpolygon(xx,yy,x(k),y(k));
zi(~in)=NaN;
pcolor(xi,yi,zi),shading interp
This far surpasses the alternative way I had developed a few months ago using the mapping toolbox's distance function and an arbitrary distance threshold between points.
And, better yet, I also (re)discovered another cool function called "inpolygon" which is sure to be of future use.
The year is already starting well. Enjoy!
Tuesday, January 02, 2007
Thursday, August 31, 2006
Using Data
In my real life, I spend a lot of time trying to figure out how people (particularly students) can use and understand, so called, "real-time data." Data analysis in any form is a vital skill. It's how people learn about the world. Whether studying the environment, business or social interactions, observations are reduced to data and then visualized and explained in such a way that attempts to make sense of underlying processes driving the world around us.
While this skill is essential, it's not well appreciated. Countless studies point to the need to improve students' graph reading capabilities. But reading a graph is only one part of understanding data, though it might be the easiest part to test. Only by understanding where data comes from, how graphs are made, and how one might assimilate multiple datasets together to find relationships, can a greater understanding prevail.
So how can we increase the data analysis capabilities of students, such that they understand its usefulness in their lives?
Of course there is no easy answer, but by using compelling datasets that 1) portray a fun and engaging story and 2) are relevant to students' lives and experiences, we can ensure they keep their interest in the data, and subsequently how one goes about visualizing data and understanding its underlying processes.
In oceanography, we use real-time data to entice students into learning about the ocean and issues that affect them.
But there are lots of other fun ways of presenting data, and this recent post from David Pogue on the changing patterns of Baby Names shows that even seemingly obscure topics are ripe for data analysis by students.
Have you seen a dataset or graph lately that has compelled you to think differently about a subject than you had before?
While this skill is essential, it's not well appreciated. Countless studies point to the need to improve students' graph reading capabilities. But reading a graph is only one part of understanding data, though it might be the easiest part to test. Only by understanding where data comes from, how graphs are made, and how one might assimilate multiple datasets together to find relationships, can a greater understanding prevail.
So how can we increase the data analysis capabilities of students, such that they understand its usefulness in their lives?
Of course there is no easy answer, but by using compelling datasets that 1) portray a fun and engaging story and 2) are relevant to students' lives and experiences, we can ensure they keep their interest in the data, and subsequently how one goes about visualizing data and understanding its underlying processes.
In oceanography, we use real-time data to entice students into learning about the ocean and issues that affect them.
But there are lots of other fun ways of presenting data, and this recent post from David Pogue on the changing patterns of Baby Names shows that even seemingly obscure topics are ripe for data analysis by students.
Have you seen a dataset or graph lately that has compelled you to think differently about a subject than you had before?
Friday, June 09, 2006
Matlab and Intel Macs
I just learned some great news. Apparently, those of us who have Intel Macs can in fact run Matlab on them.
The work-around goes like this.
1) Open X11 (you need it to display graphics)
2) Open Terminal (supposedly Matlab runs faster in Terminal, plus you have access to the scrollbars and the clipboard, which X11 doesn't play nice with).
3a) If you use bash, set your display by entering
3b) If you use tcsh, set your display by entering
4) Start Matlab without the Java-based GUI
Of course, this means you won't have access to the fancy GUI, which I've grown accustomed to over the years, but there are some suggestions in the post above on how to configure a code editor (i.e. Textedit or emacs) to allow you to quickly open files from within Matlab. And if you want a full-fledged file manager, well there's always Finder which is easy to use.
Additionally, the forum post has some suggestions on how to place step 3 in your login file, and some neat commentary on running Matlab with Bootcamp or Parallels, not to mention the bleak outlook on when full Intel Mac support will be available.
Unfortunately, none of this helps me run Matlab at home, since I use a license manager at work that is blocked to the outside world. So now I have to decide if I want to spend $500 for a stand-alone license, or deal with a sluggish network connection, something I've avoided to date.
This reminds me of another tidbit. If you would like to automatically set your display when using ssh (you need to have X11 open first), simply use the -X flag as follows.
So, if you open X11 first, and then use Terminal to ssh and run Matlab on a a remote server, you'll have all the bells and whistles of graphics display and access to your local clipboard without much fuss. This is a heck of a lot easier than using setenv DISPLAY and trying to figure out your DHCP IP.
Your only worry now is to pray your bandwidth can keep up with the gigabytes of data you're try to process.
The work-around goes like this.
1) Open X11 (you need it to display graphics)
2) Open Terminal (supposedly Matlab runs faster in Terminal, plus you have access to the scrollbars and the clipboard, which X11 doesn't play nice with).
3a) If you use bash, set your display by entering
export DISPLAY=:0.0
3b) If you use tcsh, set your display by entering
setenv DISPLAY :0.0
4) Start Matlab without the Java-based GUI
./Applications/MATLAB704/bin/matlab -nojvm
Of course, this means you won't have access to the fancy GUI, which I've grown accustomed to over the years, but there are some suggestions in the post above on how to configure a code editor (i.e. Textedit or emacs) to allow you to quickly open files from within Matlab. And if you want a full-fledged file manager, well there's always Finder which is easy to use.
Additionally, the forum post has some suggestions on how to place step 3 in your login file, and some neat commentary on running Matlab with Bootcamp or Parallels, not to mention the bleak outlook on when full Intel Mac support will be available.
Unfortunately, none of this helps me run Matlab at home, since I use a license manager at work that is blocked to the outside world. So now I have to decide if I want to spend $500 for a stand-alone license, or deal with a sluggish network connection, something I've avoided to date.
This reminds me of another tidbit. If you would like to automatically set your display when using ssh (you need to have X11 open first), simply use the -X flag as follows.
ssh -X user@myserver.edu
So, if you open X11 first, and then use Terminal to ssh and run Matlab on a a remote server, you'll have all the bells and whistles of graphics display and access to your local clipboard without much fuss. This is a heck of a lot easier than using setenv DISPLAY and trying to figure out your DHCP IP.
Your only worry now is to pray your bandwidth can keep up with the gigabytes of data you're try to process.
Thursday, May 25, 2006
Virtual Worlds
Recently, during a discussion on how technology is changing education, I was reminded of the virtual worlds people are setting up. In general, younger generations are growing up accustomed to the benefits of technology, and expect their entertainment to be equally exciting and innovative. Video games just don't cut it anymore. They have to be more interactive, more immersive and more communal. The internet provides a ripe infrastructure for these kinds of developments, taking games from single PC's to networks of users.
As testament to this trend, look no further than the recent release of Disney's Virtual Magic Kingdom (see this review at O'Reilly). It takes the virtual world game to the next level, and it's graphics are far superior too.
In fact, even ocean educators are already going this route. Woods Hole, among others, has partnered with the Whyville site to provide educational content amongst the games and interaction provided by the site.
To my mind, the jury is still out on the effectiveness of these sites. Supposedly, there's lots of evidence that students really get engaged in the community atmosphere of such sites. However, I really question how much they actually learn.
It's clear that students like to use (read: play on) them, spending much of their time designing their avatars and chatting with other users. And despite the best attempts of educators to spread educational content throughout the sites, often within the games that reward students with "money" to use to improve their avatars, I would wager they spend more time on the frills and less on the skills.
Of course, when Disney builds a free virtual environment, it's not about educational value, but marketing and branding.
But when educators start thinking about using new technologies to teach and excite the next generation, I feel we still have a long way to go before we find the right recipe.
As testament to this trend, look no further than the recent release of Disney's Virtual Magic Kingdom (see this review at O'Reilly). It takes the virtual world game to the next level, and it's graphics are far superior too.
In fact, even ocean educators are already going this route. Woods Hole, among others, has partnered with the Whyville site to provide educational content amongst the games and interaction provided by the site.
To my mind, the jury is still out on the effectiveness of these sites. Supposedly, there's lots of evidence that students really get engaged in the community atmosphere of such sites. However, I really question how much they actually learn.
It's clear that students like to use (read: play on) them, spending much of their time designing their avatars and chatting with other users. And despite the best attempts of educators to spread educational content throughout the sites, often within the games that reward students with "money" to use to improve their avatars, I would wager they spend more time on the frills and less on the skills.
Of course, when Disney builds a free virtual environment, it's not about educational value, but marketing and branding.
But when educators start thinking about using new technologies to teach and excite the next generation, I feel we still have a long way to go before we find the right recipe.
Wednesday, May 10, 2006
Château de Pierrefonds
Last night, I went on an "information adventure." One that wasn't really possible just a few short years ago.
I happened to be playing with Google Earth, which is a data visualizers dream come true. Though, as great as it is, I'm anxiously waiting several features like time navigation and 3D image fills, so that it can actually be used in oceanographic research. But I digress....
At one point I found myself looking at some fancy 3D rendering of an iron crystal looking structure in Belgium.
From there I found myself browsing south to Colemar and Strasbourg, two towns I visited with my family about a dozen years ago. You can even see the Strasbourg cathedral in GE quite clearly. I recall climbing up to the top of it's main spiral and waving to my grandmother below as she sat in a cafe. The cathedral also contains a very cool, very complex and quite famous Astronomical clock, an amazing feat of technological accomplishment in the pre-digital days of 1842.
Unfortunately, much of the rest of France is still mostly in low resolution in Google Earth. Not the best for castle hopping the cheap way. Or in my case, reminiscing about former castle visits.
It was at this point I recalled that I never really figured out a random castle I once visited on a French exchange trip during my high school days. I was actually taken to the castle by by exchange family on one of our days off, so no one else on the trip went or knew of the castle (including my mother). All I remember is that we visited it on a day-trip from Paris, and that the town had something to do with Jeanne d'Arc, or more specifically, the end of her days.
So I looked her up on Wikipedia.
She was burned at the stake in Rouen.
According to Google Earth that's northwest of Paris, not the direction I remember.
But she was captured in Compiègne. That's to the northeast, about an hour out.
Now we're getting somewhere. The picture of Hôtel de ville de Compiègne on Wikipedia is distinctly familiar, particularly the statue of Jeanne d'Arc in front. I actually recall walking around the building, though I can't remember why my exchange family thought it was particularly interesting. Perhaps we visited a museum there? Either way, it's not the castle I remember.
So I started checking out the links. There's one for "Le musée du château" but that's for the Château de Compiègne, and it looks nothing like the one I'm looking for.
Then I tried the city council's web site. Mustering up as much of my french reading comprehension as I could recall, I looked through the site. Doucovrir - the page for visitors. Histoire - the page of interesting places to visit.

Whammo! Château de Pierrefonds. That's it!
As I read the story (in french) of the castle, a flood of memories all click back into place. For reassurance, now that I know what I'm looking for, I Google some additional references, and see more pictures I recall. The the large entry gate, the medieval knight on horseback in the courtyard, the grand staircase, and the fancy ornate woodwork in the main hall.
Even the story makes sense. It was build by Louis d'Orléans in the 14th century. Then destroyed by Louis XIII. Finally, Napoleon III ordered it to be rebuilt, so the castle has the distinct concoction of a combination of 14th and 19th century architecture. It also has a lot of animal sculptures for some reason.
Throughout this whole process, I learned some interesting tidbits about Compiègne, it's role in the end of WW1 and the start of WWII (which both involve the same railroad car). I even spent a little time learning about the french governing structure, since Compiègne is the sous-préfecture of the Oise département of France (say that fast). Why, there's even a town in Canada named Pierrefonds. Apparently someone there built a bad copy of the original castle (before he had even seen it) and the name of the town stuck.
The things you can find out today. And it's all thanks to the confluence of technology and information that make it possible.
Or at the very least, it certainly helps piece together old memories, assuming you don't get more confused by learning too many new things in the process.
Then again, technology won't help me recall perhaps the best part of the day. Pulling off the A1, sitting down on a log at the edge of a forrest and having the typical french picnic: ham and butter on a baguette.
Castles and French picnics.
I'm easily won over.
I happened to be playing with Google Earth, which is a data visualizers dream come true. Though, as great as it is, I'm anxiously waiting several features like time navigation and 3D image fills, so that it can actually be used in oceanographic research. But I digress....
At one point I found myself looking at some fancy 3D rendering of an iron crystal looking structure in Belgium.
From there I found myself browsing south to Colemar and Strasbourg, two towns I visited with my family about a dozen years ago. You can even see the Strasbourg cathedral in GE quite clearly. I recall climbing up to the top of it's main spiral and waving to my grandmother below as she sat in a cafe. The cathedral also contains a very cool, very complex and quite famous Astronomical clock, an amazing feat of technological accomplishment in the pre-digital days of 1842.
Unfortunately, much of the rest of France is still mostly in low resolution in Google Earth. Not the best for castle hopping the cheap way. Or in my case, reminiscing about former castle visits.
It was at this point I recalled that I never really figured out a random castle I once visited on a French exchange trip during my high school days. I was actually taken to the castle by by exchange family on one of our days off, so no one else on the trip went or knew of the castle (including my mother). All I remember is that we visited it on a day-trip from Paris, and that the town had something to do with Jeanne d'Arc, or more specifically, the end of her days.
So I looked her up on Wikipedia.
She was burned at the stake in Rouen.
According to Google Earth that's northwest of Paris, not the direction I remember.
But she was captured in Compiègne. That's to the northeast, about an hour out.
Now we're getting somewhere. The picture of Hôtel de ville de Compiègne on Wikipedia is distinctly familiar, particularly the statue of Jeanne d'Arc in front. I actually recall walking around the building, though I can't remember why my exchange family thought it was particularly interesting. Perhaps we visited a museum there? Either way, it's not the castle I remember.
So I started checking out the links. There's one for "Le musée du château" but that's for the Château de Compiègne, and it looks nothing like the one I'm looking for.
Then I tried the city council's web site. Mustering up as much of my french reading comprehension as I could recall, I looked through the site. Doucovrir - the page for visitors. Histoire - the page of interesting places to visit.
Whammo! Château de Pierrefonds. That's it!
As I read the story (in french) of the castle, a flood of memories all click back into place. For reassurance, now that I know what I'm looking for, I Google some additional references, and see more pictures I recall. The the large entry gate, the medieval knight on horseback in the courtyard, the grand staircase, and the fancy ornate woodwork in the main hall.
Even the story makes sense. It was build by Louis d'Orléans in the 14th century. Then destroyed by Louis XIII. Finally, Napoleon III ordered it to be rebuilt, so the castle has the distinct concoction of a combination of 14th and 19th century architecture. It also has a lot of animal sculptures for some reason.
Throughout this whole process, I learned some interesting tidbits about Compiègne, it's role in the end of WW1 and the start of WWII (which both involve the same railroad car). I even spent a little time learning about the french governing structure, since Compiègne is the sous-préfecture of the Oise département of France (say that fast). Why, there's even a town in Canada named Pierrefonds. Apparently someone there built a bad copy of the original castle (before he had even seen it) and the name of the town stuck.
The things you can find out today. And it's all thanks to the confluence of technology and information that make it possible.
Or at the very least, it certainly helps piece together old memories, assuming you don't get more confused by learning too many new things in the process.
Then again, technology won't help me recall perhaps the best part of the day. Pulling off the A1, sitting down on a log at the edge of a forrest and having the typical french picnic: ham and butter on a baguette.
Castles and French picnics.
I'm easily won over.
Subscribe to:
Posts (Atom)