GUI Examples #21:Explore multiple-figure data-passing 2
function [] = GUI_21() % Demonstrate how to get data from one GUI to another (data passing). % Creates a GUI with an editbox and a pushbutton. When the user presses % the pushbutton, another GUI pops up with an editbox. Whatever is in the % editbox of the second GUI when the user hits return will be put into the % edit box of the first GUI. % % Suggested exercise: Alter the code to have the new GUI display whatever % text is in the editbox from the first GUI when the new GUI is created. % Even more advanced: Alter the code so that two new GUIs cannot be % launched simultaneously by pressing the pushbutton repeatedly. % % % Author: Matt Fig % Date: 7/15/2009 S.fh = figure('units','pixels',... 'position',[500 500 200 130],... 'menubar','none',... 'numbertitle','off',... 'name','GUI_21',... 'resize','off'); S.ed = uicontrol('style','edit',... 'units','pix',... 'position',[10 60 180 60],... 'string','Data'); S.pb = uicontrol('style','pushbutton',... 'units','pix',... 'position',[10 20 180 30],... 'string','Push to Get Data',... 'callback',{@pb_call,S}); function [] = pb_call(varargin) % Callback for GUI_21 pushbutton. S = varargin{3}; % Get the structure. f = figure('units','pixels',... 'menubar','none',... 'position',[750 510 200 100]); % Create a new GUI. E = uicontrol('style','edit',... 'units','pixels',... 'position',[10 20 180 60],... 'string','Type something, press return.',... 'callback',{@E_call,varargin{3}}); uicontrol(E); % Allow user to simply hit return without typing anything. % If user closes GUI_21, close new one as well because it will error when % it tries to execute the callback otherwise. set(S.fh,'deletefcn',{@fig_delet,f}) function [] = E_call(varargin) % Callback for secondary GUI editbox. S = varargin{3}; % Get the structure. set(S.ed,'string',get(gcbo,'string')) % Set GUI_21 editbox string. close(gcbf) % Close secondary GUI. function [] = fig_delet(varargin) % Executes when user closes GUI_21. try delete(varargin{3}) catch % Do nothing. end
Popularity: 3% [?]
Geometric Primitives and Geomtric Operations with Matlab
Matlab does not come by default with a geometric primitives library. About for some simple function like the “sphere” command, using some geometric entities may be an issue. Fortunately on Matlab file exchange are available these two packages, from David Legland ,that help us to develop geometric projects.
- Geom2D Download Now
- Geom3D Download Now
The packages include functions for computations on planar and spatial geometrical shapes (points, lines, circles, polygons…)
The goal is to provide a low-level library for manipulating geometrical primitives, making easier the development of more complex geometric algorithms.
The library proposes functions to:
- create various shapes (points, circles, lines, ellipses, polylines, polygons) using an intuitive syntax. Ex: createCircle(p1, p2, p3) to create a circle through 3 points.
- derive new shapes: intersection between 2 lines, between a line and a circle, parallel and perpendicular lines
Functions to compute intersections - work on polylines and polygons: compute centroid and area, expand, clip with half-plane…
- measure distances (between points, a point and a line, a point and a group of points), angle (of a line, between 3 points), or test geometry (point on a line, on a circle).
- manipulate planar transformation. Ex: P2 = transformPoint(P1, createRotation(CENTER, THETA));
- draw shapes easily. Ex: drawCircle([50 50], 25), drawLine([X0 Y0 DX DY]). Some clipping is performed for infinite shapes such as lines or rays.
- functions for 3D polygons and polyhedra. Polyhedra use classical vertex-faces arrays (face array contain indices of vertices), and support faces with any number of vertices. Some basic models are provided (createOctaedron, createCubeoctaedron…), as well as some computation (like faceNormal or centroid)
- direct drawing of shapes with specialized functions. Clipping is performed automatically for unbounded shapes such as lines or rays. Ex:
drawPoint3d([50 50 25; 20 70 10], ‘ro’); % draw some points
drawLine3d([X0 Y0 Z0 DX DY DZ]); % clip and draw straight line
Popularity: 3% [?]
The Advanced Matlab Code Page got 500 members!
A good news, the Advanced Matlab code facebook page reached 500 members, and it is not over yet!
Keep subscribing:
Follow Us On:
Facebook
Popularity: 3% [?]
Poker Predictor: a Free Texas Hold’em Odds and Probability Computer
Contents
The finest poker brains on your side!
In real life poker games many factors affects the game. A good poker player has to study facial expression, breath frequency, hands movements etc. In online games you have no opponent to look in the eyes, the math behind poker takes a leading role to gain an edge against others players. To become a good online poker player you have to know at least some basic poker theory.
First of all I want to say something about the relationship between math and poker. Poker is a cards game, this means luck counts, you wont win all the matches if you know all the odds and if you are a great bluffer. To win, you also have to be a little luck and, fortunately, poker is still an human game, experience and skills are important too.
But what is important is to acquire a good gaming style that allows you to play correctly every time. It does not mind if you play correctly and you still loose. You may loose this game but you’ll see that on a large numbers of matches the edge you have against your opponent will turn into money.
Now how to acquire a mathematically correct good gaming style?
There are two options:
- You can study all the odds, read a thousand of poker game theory, make some quite complex calculations in your head each time a card falls on the table.
- You can Download Poker Predictor

What can Poker Predictor Do
Texas holdem poker is about:
- 2+5 cards each player
- 52 total number of cards
- 1326 starting hand configurations
- 207025 distinct head-to-head match ups
- 1712304 possible boards
- 690900 hands configurations with a single opponent
- over 6.22 e26 with 9 opponents
- ……………..
All of them are in Poker Predictor
Poker Predictor is a tool to calculate poker games probabilities from whatever cards configuration. Probability are computed with random cards permutation, they are not the exact ones but the high simulations numbers ensure the error to be less than 1%.
Thanks to his strong computational engine, It can simulate 100′000 10 players Texas hold’em games in a matters of 0.3 seconds, so it is actually a real time tool, very useful for on line games, especially with high level players. It is possible to choose both players and opponents cards.
Although a little rough in the graphics (I am not a software developer, neither a programmer, just an engineer with poker passion) Poker predictor is a powerful tool, I am myself using it.
Parameters computed by poker predictor
OnLine Help for Poker Predictor
Downloads
Release History:
| Poker Predictor v1.0
(24/02/2010) Download for Win 32 |
![]() |
| Poker Predictor v1.1
(09/03/2010) Download for Windows
|
![]() |
This version is completely free. You can remove the ads on them with a 5 euros contribution to the project:
donations will be used to enlarge this utility
Poker Predictor was developed for Matlab at the beginning here you can find the matlab version: Matlab version of Poker Predictor
Poker predictor is always under development. Any question/suggestion? giaccariluigi@msn.com
Popularity: 4% [?]
Poker Predictor: How to Use it
Contents
This page is some kind of poker predictor online help. Here you can find discussions about its game parameters. Suggestions are greatly appreciated, Poker Predictor is always under development.
Please go to Poker Predictor: How to Use it to view the survey
Profit
Each poker hand is just like an investment: you can loose the money you invest or you can make more money out of them. We need a parameter to know whether our cards are supposed to be a good investments or not.
Profit express the gain of money, or chips, you are expecting from the game. Basically are worth playing pre -flop cards with positive profit. This in the hypothesis you go to river all the hands. Obviously this is untrue. So you have to act like a “smart” player: if the game is very hard, full of rising players, you can play all hands with 10% (as example) profit, so you have more chance to “resist” to your opponents shoots. On the others side, if you meet soft players that always fold, even with low raises, you can play cards with negative profit (for example-10%)
Profit also take into account number of players,folds, Odds. For example folds decrease profit, since there will be less money on the pot. This may seems strange but it is true, folds increase your winning chance but actually decrease your capability to earn money.
Consider Profit is an instantaneous parameter which depends on the current cards configuration. There is also the profit of the entire game considering previous moves, but calculating this requires the history of the game and it is not supported.
Player and opponent higher rank
I suppose this need no explanation.
Winning chance
Probability to win after river. Notice that the probability suppose you go on until river card falls.
Tie chance
probability to tie after river.
Odds
the odds bookmakers would give to your game. When is odds useful? First of all, odds take into account both winning and tie chance. Ties are considered only partially because in that case the pot is divided among all the winners.
If the game is completely random, odds equal the number of players, this means every players has the same winning chance. So if odds overcomes players number this means your cards are worse than usual. On the other side if your odds is lower than the number of players your cards are good.
Odds are generally more useful than the winning chance. Let’s make an example: you have 30% of winning. Is that good?
The right answer id I don’t know, it depends on the number of players. If there are only two players 30% is bad winning chance but if we are 12 players of course is good. How do I find the limit? what is the number of players for which 30% winning is a good chance?
Well, you don’t have to get tired everytime on this computation, you can bypass them just by looking the odds number: is lower than the player number than is good, is higher than is bad. Odds and winning chance are just two different ways to estimate how strong are your cards.
If you have zero winning chance your odds equals infinity, bookmakers will pay a lot of money in case you win, but this just because you can not win. If odd equals one you are sure to win. The lower is the Odds the higher are you’re winning chance.
MaxBet/Pot
This is the answer to question call/fold when an opponent make raise. This is max bet, compared with the pot, you can do remaining in the mathematical correctness of the game. This means that if you can afford to bet the 30% of the pot you can call any raise which respect this condition. If this parameter overlaps 100% you can bet all the pot, you have more than 50% of winning and you are (theoretically) allowed to go all in, it is you or your opponent. Generally listening to this data carefully lead to run too much risk, the all in in poker may be without return !
What I suggest is to find to find a good feeling with the values of this parameter that fits your gaming style.
Consider that the pot you see when you call may increase during the game, this can not be calculated by the program, expert players must also consider this factor.
Any questions, suggestions?
Popularity: 3% [?]





















































