No BSD License  

3.0

3.0 | 8 ratings Rate this file 22 Downloads (last 30 days) File Size: 5.44 KB File ID: #3477
image thumbnail

graph_and_table

by

 

22 May 2003 (Updated )

Creates a graph and a data table below it. The table is put in an activex control using the column.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

Creates a graph and a data table below it.
  the table is put in an activex control using
  the column labels colhead
 
  This function is meant to be an example for CSSM and not
  to be used as is.
 
  It is meant to demonstrate ActiveX grid usage and works with
  MSFLEXGRID (which comes with Windows and doesn't allow editing)
  and SIMPLE GRID (which is available for free at
  http://adfsoft.hypermart.net/sgrid/ ).
 
  Use 'SGRID' for the whichgrid parameter to use
  simple grid, but you must first you must download it from the above
  website and register it. To register, find sgrid.ocx by clicking on
  the windows start button and selecting "find". Change your directory
  to its directory and type "regsvr32 sgrid.ocx"
    ___________________ ____________________
  | /\ | | /\ | X Y ##
  | /\ / \/\ /| | || || 1 1.0 ##
  | / \/ \_/\/ | ||\ ||/\|| 2 1.5 ##
  |_/_________________| || | | ||| 3 2.0 ##
  | X Y || || |/ | 4 1.6 ##
  | 1 1.0 || || | 5 2.0 ||
  | 2 1.5 ## | | 6 2.5 ||
  |__3__2.0__________|| |_________|__7__2.3_||
 
     horizontal split vertical split
 
  INPUTS DESCRIPTION DEFAULT VALUE
  x x data [1:10]
  y y data rand(size(x));
  colhead table header {'X','Y'};
  vertorhoriz vert or horiz split 0 %(vertical)
  figuretitle figure title 'graph_and_table'
  whichgrid MSFlexGrid or Simple Grid 'MSFlexGrid'
 
  OUTPUTS:
  h.fig handle to figure
  h.graph handle to graph
  h.line handle to data line
  h.grid handle to grid object
 
  USAGE:
  x=1:10;
  y=rand(size(x));
  colhead={'X','Y'};
  vertorhoriz=0; % vertical
  figuretitle='graph_and_table';
  h=graph_and_table(x,y,colhead,vertorhoriz,figuretitle);
  vertorhoriz=1; % horizontal
  h=graph_and_table(x,y,colhead,vertorhoriz,figuretitle);
  h=graph_and_table(x,y,colhead,vertorhoriz,figuretitle,'SGRID');
 
  IT'S NOT FANCY, BUT IT WORKS

Acknowledgements

This file inspired Keydown And Keypressed Events Demo.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
12 Aug 2010 Jeff

Is this control still available for free download? If so can you tell me where I might find it? I found a download at www.octatec.com for around $93.00. Or is there a better method now, 7 years later? Thanks.

09 Feb 2009 Yingyong Chen

I have tried using the matlab uitable object to house the data, it prints, but it will always go out of position when being printed since the table is hard anchored on the figure and moves to unintended location when it prints due to resizing issue.

09 Feb 2009 Yingyong Chen

Good work, however the same problem as Eric was pointing out that the grid does NOT print out, which makes it not quite as useful as it could be, as I have been looking hard for a solution in matlab to display tabulated data.

15 Dec 2007 Teguh Purnama Sidiq

very usefull, but unfortunately this error occur when i tried to run the program:

??? Error using ==> actxcontrol
Control creation failed. Invalid ProgID 'MSFlexGridLib.MSFlexGrid.1'

Error in ==> graph_and_table at 148
h.grid = actxcontrol(...

:(

25 Feb 2007 WALID ALI  
09 Feb 2007 said lahyani

hi i want to learn about matlab

08 Jun 2006 zara laoure

Error in ==> two_axes_export>gui_mainfcn at 477
gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt);

Error in ==> two_axes_export at 41
gui_mainfcn(gui_State, varargin{:});

??? Undefined command/function 'actxcontrol'.

Error in ==> graph_and_table at 148
h.grid = actxcontrol(...

08 Feb 2006 HABIB REZA  
12 Aug 2005 trash zone

i need command to build graph using mfc.

15 Apr 2005 Eric Shain

I can get it to work with MSFlexGrid, but when I print the figure, only the graph prints. The table doesn't print nor is it visible with a print preview. If I can't print the figure, it definitely makes it less useful.

11 Feb 2005 Raúl Herrrera Avelar

Dear Michael Robbins,
I need help to made selection in control MS FlexGrid to save this how new variable. If you can say me where check properties, methods and actions of control.

Thank you

25 Oct 2004 Xenya Petrova

hi!
1. got a question: how to you make msflexgrid run on the machine where you've got no vb or ms vc? it looks like simply registering an ocx is not enough.
2. why do you think that flexgrid allows no editing? you just write down a keydown and keypressed events and to it yourself.
3. thanks! was a real pleasure to play with your proggy

30 Dec 2003 John Robinson

Slick. One bug - the sgrid "font" property wants to be a handle, not a string. Not sure how to get around this now, so just commented that line (line 175) out of the sample. Also , formulas do not us the "=" token as in excel - e.g. a formula like "=A1+1" in excel would be written as "A1+1" in sgrid. Otherwise pretty cool.

Contact us