Doug’s MATLAB Video Tutorials
November 6th, 2009
Basics: Volume visualization: 3/9 Display of scatter3 and slice plots
This short video is the third of a series of nine that talks about volume visualization. Patrick gave this talk internally to help technical support engineers understand capabilities of MATLAB for volume visualization.
I like his slow, clear, methodical presentation with great visualizations. It is the first time I have deeply understood some of the volume visualization techniques we have.
15:05 UTC |
Posted in Format: Video, Level: Basic |
Permalink |
1 Comment »
November 4th, 2009
Contest: Flooding
The 20th MATLAB programming contest just went live!
Get all the information here.
Our more faithful blog readers might have a head start on this puzzle…
Finding four connected regions.
A puzzler about the game that inspired this contest.
Winning entries to the above puzzler.
17:05 UTC |
Posted in Topic: Puzzler |
Permalink |
No Comments »
November 3rd, 2009
Puzzler: Ultimate Frisbee- call it! Wrap up
I do not know why I am still always amazed at the many different ways that simple problems are solved by different people. To end the suspense for everyone playing along at home,
“For two coins (i.e. Frisbees®) that have the same probability of being heads or tails (but not necessarily fair coins) you are at worst going to win 50% of the time when you choose ’same’.”
(Here is the original post)
My argument on the Ultimate Frisbee field was
“Imagine the two Frisbee come up heads 99% of the time, what do you choose?”
“Same!”
“What about 98%?”
“Same”
“This logic holds all the way through, even to 50.00001. At 50% it just does not matter, so always choose same.”
The more rigorous and MATLAB proofs were more along these lines:
This was a GUI that you watched as it went through a Monte Carlo simulation. Thanks Richard
Arman did a more traditional proof, citing Wikipedia
Let p be the probability of having tails.
The probability of having "different" is p(1-p)+(1-p)p.
The probability of having "same" is p^2+(1-p)^2.
From the arithmetic mean geometric mean inequality, we know that
p^2+(1-p)^2 >= 2*p(1-p) and equality holds if p=1-p which means p=1/2.
Therefore “same” is better choice for any p value.
There were many variations on this plot:
I liked Zane’s here because it shows how much better off you are with ’same’ for each value of unfairness in the coin.
Christopher won the challenge by going to the next level, pointing out that you could make these unfair Frisbees almost fair by flipping three and calling for an odd number (1 or 3) vs even number (0 or 2) of heads.
Thank you everyone for playing, and finally putting this question to rest! Now the ethical question, knowing the coin flip is unfair, is it in the Spirit of The Game to let the other guy choose? Should we move to Christopher’s method of flipping three Frisbees?
Frisbee® is a Registered Trademark of © 2004 Wham-o Inc. All Rights Reserved.
14:49 UTC |
Posted in Level: Basic, Topic: Puzzler |
Permalink |
2 Comments »
October 30th, 2009
Basics: Volume visualization: 2/9 Examples of scalar and vector fields
This short video is the second of a series of nine that talks about volume visualization. Patrick gave this talk internally to help technical support engineers understand capabilities of MATLAB for volume visualization.
I like his slow, clear, methodical presentation with great visualizations. It is the first time I have deeply understood some of the volume visualization techniques we have.
20:44 UTC |
Posted in Format: Video, Level: Basic |
Permalink |
2 Comments »
October 27th, 2009
Puzzler: Ultimate Frisbee- call it!
I play a fair amount of Ultimate Frisbee® between lunch across the street at Cognex and playing with Boston Ultimate Disk Alliance. Games of Ultimate start with the two teams flipping two Frisbees in the air and calling
“Same or different” My team was trying to figure out which is the most likely outcome.
I made a convincing argument, but I am curious what kind of persuasive MATLAB-based ‘proofs’ can be made. I am offering a MATLAB t-shirt to the most persuasive entry. Use published MATLAB files, GUI’s, MATLAB script or function, whatever you think will be most convincing. Contest ends this time next week.
Assumptions: The Frisbees (or coins) are either ‘heads’ or ‘tails’. The coins may or may not be ‘fair’ (i.e. they might be heads 80% of the time!), however the odds of heads versus tails for the two coins is the same for both coins. Send entries to hull@MathWorks.com (no .rar files please!)
(Here is the result of this now closed contest)
Frisbee® is a Registered Trademark of © 2004 Wham-o Inc. All Rights Reserved.
19:31 UTC |
Posted in Level: Basic, Topic: Puzzler |
Permalink |
3 Comments »
October 23rd, 2009
Basics: Volume visualization: 1/9 Defining scalar and vector fields
This short video is the first of a series of nine that talks about volume visualization. Patrick gave this talk internally to help technical support engineers understand capabilities of MATLAB for volume visualization.
I like his slow, clear, methodical presentation with great visualizations. It is the first time I have deeply understood some of the volume visualization techniques we have. Sorry, Dr. H, but I really did not understand Div, Grad, Curl and all of that until Patrick explained it later in this series!
1 of 9 Definitions for scalar and vector fields.
15:26 UTC |
Posted in Level: Basic |
Permalink |
5 Comments »
October 14th, 2009
MATLAB Virtual confrence
We are holding a virtual conference right now.
Come hear Keynote speakers starting at 7:45 EST.
See the rest of the schedule
I have four new puzzler listed, when you arrive come stop by the booth, grab a copy and try to solve them to get some MATLAB gifts.
11:16 UTC |
Posted in Topic: Puzzler |
Permalink |
No Comments »
October 9th, 2009
Finding the area inside a convex hull
This quick video answers a question about finding the area of the smallest polygon that covers a set of points. It is a chance to use a few commands in MATLAB to simplify a script.
Here is the code that will be discussed.
x1 = rand(1,10);
y1 = rand(1,10);
vi = convhull(x1,y1);
polyarea(x1(vi),y1(vi))
plot(x1,y1,'.')
axis equal
hold on
fill ( x1(vi), y1(vi), 'r','facealpha', 0.5 );
hold off
13:30 UTC |
Posted in Format: Video, Level: Basic |
Permalink |
No Comments »
October 2nd, 2009
Basics: Using ACCUMARRAY
ACCUMARRAY is one of my favorite functions that I never seem to need outside of MATLAB golf problems. I present this to you with the hopes that knowing it exists allows you to use it at just the right time.
The video discusses the following code:
sales.rep = [1 2 1 3 4 6 2 3 1 1];
sales.amount = [1 1 3 1 5 2 2 4 1 5];
numReps = max(sales.rep);
sales.total = zeros(1,numReps);
for i = 1 : numel(sales.rep)
sales.total(sales.rep(i)) = sales.total(sales.rep(i)) ...
+ sales.amount(i);
end
sales.accum = accumarray(sales.rep', sales.amount)'
14:37 UTC |
Posted in Level: Basic |
Permalink |
No Comments »
September 25th, 2009
MATLAB virtual conference in October 2009
The MathWorks holds free seminars around the country, but not everyone can afford the time and travel cost of attending one of these. For this reason, we are holding a virtual conference in October. Cleve, “The first MATLAB programmer” will be giving the keynote speech. Many of your favorite bloggers will be holding discussion about MATLAB in the side events.
I have been asked to write a few Puzzlers to be posed at my booth. There are a couple of good ones written already, with more to come. It is a lot of fun to think that when I was a kid I read Games magazine and thought how cool it would be to make puzzles for a job… Now it is one of the duties that I take on here at The MathWorks from time to time!
Please sign up for the virtual conference and stop in to say hello.
20:42 UTC |
Posted in Topic: Puzzler |
Permalink |
No Comments »
|
Recent Comments