Thread Subject: How to create "tree view" in matlab?

Subject: How to create "tree view" in matlab?

From: Sogol

Date: 20 Feb, 2008 17:10:54

Message: 1 of 6

Hi,

I wanted to know if it is possible to create "tree view" in matlab. Does anyone know about this?

Thanks,
Sogol

Subject: How to create

From: Yair Altman

Date: 20 Feb, 2008 19:07:01

Message: 2 of 6

Sogol <sfmdif@yahoo.com> wrote in message
<25862924.1203527484595.JavaMail.jakarta@nitrogen.mathforum.org>...
> Hi,
>
> I wanted to know if it is possible to create "tree view"
in matlab. Does anyone know about this?
>
> Thanks,
> Sogol


You can use the unsupported and semi-documented uitree and
uitreenode functions. Or you can integrate a Java Swing
JTree within your GUI (uitree is basically a Matlab wrapper
for JTree).

Yair Altman
http://ymasoftware.com

Subject: How to create

From: Sogol

Date: 22 Feb, 2008 23:19:58

Message: 3 of 6

Hi,

Thanks for your help. You did really save my time!
Do you know how can I add checkboxes beside any node? and how can I change the icon of each node?

Thanks,
Sogol

Subject: How to create

From: Mikhail

Date: 23 Feb, 2008 10:15:56

Message: 4 of 6

>Hi,
>
>Thanks for your help. You did really save my time!
>Do you know how can I add checkboxes beside any node? and >how can I change the icon of each node?
>
>Thanks,
>Sogol

Then you have to to dip into java and swing. To change icons of each node you have to implement your own java component which derives from DefaultMutableTreeNode

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

http://www.jroller.com/santhosh/?page=1

http://www.java2s.com/Code/Java/Swing-JFC/Tree.htm

There are some facts you must be aware of when using java in Matlab:

http://mathforum.org/kb/message.jspa?messageID=5972347&tstart=0

Subject: How to create

From: Gwendolyn Fischer

Date: 26 Feb, 2008 10:14:02

Message: 5 of 6

Mikhail <razum@gmx.com> wrote in message
<24449352.1203761787051.JavaMail.jakarta@nitrogen.mathforum.
org>...
> >Hi,
> >
> >Thanks for your help. You did really save my time!
> >Do you know how can I add checkboxes beside any node?
and >how can I change the icon of each node?
> >
> >Thanks,
> >Sogol
>

Hi Sogol,

here is a scribble which may work as a starting point:

<--SNIP-->

function treeExperiment6
% function based on treeExperiment6 by John Anderson
% see
%
http://www.mathworks.com/matlabcentral/newsreader/view_threa
d/104957#269485
%
% The mousePressedCallback part is inspired by Yair Altman's
%
https://foxitsoftware.com/foxit_manage/ticketsupport/develop
er/download.php?file_name=20
% 08-02-06-2119.09.pdf
%
% derived from Brad Phelan's tree demo
% create a tree model based on UITreeNodes and insert into
uitree.
% add and remove nodes from the treeModel and update the
display
import javax.swing.*
import javax.swing.tree.*;

% figure window
f = figure('WindowStyle', 'docked', 'Units', 'normalized' );
f = gcf;

b1 = uicontrol( 'string','add Node', ...
   'units' , 'normalized', ...
   'position', [0 0.5 0.5 0.5], ...
   'callback', @b1_cb ...
   );

b2 = uicontrol( 'string','remove Node', ...
   'units' , 'normalized', ...
   'position', [0.5 0.5 0.5 0.5], ...
   'callback', @b2_cb ...
   );

%[I,map] = imread
([matlab_work_path, '/Projectmanager/checkedIcon.gif']);
[I,map] = checkedIcon;
javaImage_checked = im2java(I,map);

%[I,map] = imread
([matlab_work_path, '/Projectmanager/unCheckedIcon.gif']);
[I,map] = uncheckedIcon;
javaImage_unchecked = im2java(I,map);

% javaImage_checked and javaImage_unchecked are assumed to
be of the same
% width
iconWidth = javaImage_unchecked.getWidth;

% create top node
rootNode = UITreeNode('root', 'File List', ...
    [], 0);
% [matlab_work_path, '/Projectmanager/fileListIcon.gif'],
0);

% create two children with checkboxes
cNode = UITreeNode('unselected', 'File A', [], 0);
% as icon is embedded here we set the icon via java,
otherwise one could
% use the uitreenode syntax uitreenode(value, string, icon,
isLeaf) with
% icon being a qualified pathname to an image to be used.
cNode.setIcon(javaImage_unchecked);
rootNode.add(cNode);

cNode = UITreeNode('unselected', 'File B', [], 0);
cNode.setIcon(javaImage_unchecked);
rootNode.add(cNode);

% set treeModel
treeModel = DefaultTreeModel( rootNode );

% create the tree
tree = uitree;
tree.setModel( treeModel );
% we often rely on the underlying java tree
jtree = tree.getTree;
% some layout
set(tree, 'Units', 'normalized',...
   'position', [0 0 1 0.5]);
set( tree, 'NodeSelectedCallback', @selected_cb );

% make root the initially selected node
tree.setSelectedNode( rootNode );

% MousePressedCallback is not supported by the uitree, but
by jtree
set(jtree, 'MousePressedCallback', @mousePressedCallback);

  % Set the mouse-press callback
  function mousePressedCallback(hTree, eventData) %,
additionalVar)
  % if eventData.isMetaDown % right-click is like a Meta-
button
  % if eventData.getClickCount==2 % how to detect double
clicks

  % Get the clicked node
    clickX = eventData.getX;
    clickY = eventData.getY;
    treePath = jtree.getPathForLocation(clickX, clickY);
    % check if a node was clicked
    if ~isempty(treePath)
      % check if the checkbox was clicked
      if clickX <= (jtree.getPathBounds
(treePath).x+iconWidth)
        node = treePath.getLastPathComponent;
        nodeValue = node.getValue;
        % as the value field is the selected/unselected
flag,
        % we can also use it to only act on nodes with
these values
        switch nodeValue
          case 'selected'
            node.setValue('unselected');
            node.setIcon(javaImage_unchecked);
            jtree.treeDidChange();
          case 'unselected'
            node.setValue('selected');
            node.setIcon(javaImage_checked);
            jtree.treeDidChange();
        end
      end
    end
  end % function mousePressedCallback
  

   function selected_cb( tree, ev )
       nodes = tree.getSelectedNodes;
       node = nodes(1);
       path = node2path(node);
       %path
   end

   function path = node2path(node)
       path = node.getPath;
       for i=1:length(path);
           p{i} = char(path(i).getName);
       end
       if length(p) > 1
           path = fullfile(p{:});
       else
           path = p{1};
       end
   end

   % add node
   function b1_cb( h, env )
       nodes = tree.getSelectedNodes;
       node = nodes(1);
       parent = node;
       childNode = UITreeNode('dummy', 'Child Node', [], 0);
       treeModel.insertNodeInto
(childNode,parent,parent.getChildCount());
       % expand to show added child
       tree.setSelectedNode( childNode );
       % insure additional nodes are added to parent
       tree.setSelectedNode( parent );
   end

   % remove node
   function b2_cb( h, env )
       nodes = tree.getSelectedNodes;
       node = nodes(1);
       if ~node.isRoot
           nP = node.getPreviousSibling;
           nN = node.getNextSibling;
           if ~isempty( nN )
               tree.setSelectedNode( nN );
           elseif ~isempty( nP )
               tree.setSelectedNode( nP );
           else
               tree.setSelectedNode( node.getParent );
           end
           %node
           treeModel.removeNodeFromParent( node );
       end
    end
end % of main function treeExperiment6

  function [I,map] = checkedIcon()
    I = uint8(...
        [1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;
         2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1;
         2,2,2,2,2,2,2,2,2,2,2,2,0,2,3,1;
         2,2,1,1,1,1,1,1,1,1,1,0,2,2,3,1;
         2,2,1,1,1,1,1,1,1,1,0,1,2,2,3,1;
         2,2,1,1,1,1,1,1,1,0,1,1,2,2,3,1;
         2,2,1,1,1,1,1,1,0,0,1,1,2,2,3,1;
         2,2,1,0,0,1,1,0,0,1,1,1,2,2,3,1;
         2,2,1,1,0,0,0,0,1,1,1,1,2,2,3,1;
         2,2,1,1,0,0,0,0,1,1,1,1,2,2,3,1;
         2,2,1,1,1,0,0,1,1,1,1,1,2,2,3,1;
         2,2,1,1,1,0,1,1,1,1,1,1,2,2,3,1;
         2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
         2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
         2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
         1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1]);
     map = [0.023529,0.4902,0;
            1,1,1;
            0,0,0;
            0.50196,0.50196,0.50196;
            0.50196,0.50196,0.50196;
            0,0,0;
            0,0,0;
            0,0,0];
  end
  
  function [I,map] = uncheckedIcon()
     I = uint8(...
       [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1;
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
        1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1]);
     map = ...
      [0.023529,0.4902,0;
       1,1,1;
       0,0,0;
       0.50196,0.50196,0.50196;
       0.50196,0.50196,0.50196;
       0,0,0;
       0,0,0;
       0,0,0];
  end

<--SNAP-->

Beware of the line wraps.

Hope this helps.

Gwendolyn

Subject: How to create

From: sfmdif@gmail.com

Date: 26 Feb, 2008 21:42:29

Message: 6 of 6

On Feb 26, 1:14=A0pm, "Gwendolyn Fischer"
<gwendolyn.fisc...@nowhere.com> wrote:
> Mikhail <ra...@gmx.com> wrote in message
>
> <24449352.1203761787051.JavaMail.jaka...@nitrogen.mathforum.
> org>...> >Hi,
>
> > >Thanks for your help. You did really save my time!
> > >Do you know how can I add checkboxes beside any node?
>
> and >how can I change the icon of each node?
>
>
>
> > >Thanks,
> > >Sogol
>
> Hi Sogol,
>
> here is a scribble which may work as a starting point:
>
> <--SNIP-->
>
> function treeExperiment6
> % function based on treeExperiment6 by John Anderson
> % see
> %http://www.mathworks.com/matlabcentral/newsreader/view_threa
> d/104957#269485
> %
> % The mousePressedCallback part is inspired by Yair Altman's
> %https://foxitsoftware.com/foxit_manage/ticketsupport/develop
> er/download.php?file_name=3D20
> % 08-02-06-2119.09.pdf
> %
> % derived from Brad Phelan's tree demo
> % create a tree model based on UITreeNodes and insert into
> uitree.
> % add and remove nodes from the treeModel and update the
> display
> import javax.swing.*
> import javax.swing.tree.*;
>
> % figure window
> f =3D figure('WindowStyle', 'docked', 'Units', 'normalized' );
> f =3D gcf;
>
> b1 =3D uicontrol( 'string','add Node', ...
> =A0 =A0'units' , 'normalized', ...
> =A0 =A0'position', [0 0.5 0.5 0.5], ...
> =A0 =A0'callback', @b1_cb ...
> =A0 =A0);
>
> b2 =3D uicontrol( 'string','remove Node', ...
> =A0 =A0'units' , 'normalized', ...
> =A0 =A0'position', [0.5 0.5 0.5 0.5], ...
> =A0 =A0'callback', @b2_cb ...
> =A0 =A0);
>
> %[I,map] =3D imread
> ([matlab_work_path, '/Projectmanager/checkedIcon.gif']);
> [I,map] =3D checkedIcon;
> javaImage_checked =3D im2java(I,map);
>
> %[I,map] =3D imread
> ([matlab_work_path, '/Projectmanager/unCheckedIcon.gif']);
> [I,map] =3D uncheckedIcon;
> javaImage_unchecked =3D im2java(I,map);
>
> % javaImage_checked and javaImage_unchecked are assumed to
> be of the same
> % width
> iconWidth =3D javaImage_unchecked.getWidth;
>
> % create top node
> rootNode =3D UITreeNode('root', 'File List', ...
> =A0 =A0 [], 0);
> % =A0[matlab_work_path, '/Projectmanager/fileListIcon.gif'],
> 0);
>
> % create two children with checkboxes
> cNode =3D UITreeNode('unselected', 'File A', [], 0); =A0
> % as icon is embedded here we set the icon via java,
> otherwise one could
> % use the uitreenode syntax uitreenode(value, string, icon,
> isLeaf) with
> % icon being a qualified pathname to an image to be used.
> cNode.setIcon(javaImage_unchecked);
> rootNode.add(cNode);
>
> cNode =3D UITreeNode('unselected', 'File B', [], 0);
> cNode.setIcon(javaImage_unchecked);
> rootNode.add(cNode);
>
> % set treeModel
> treeModel =3D DefaultTreeModel( rootNode );
>
> % create the tree
> tree =3D uitree;
> tree.setModel( treeModel );
> % we often rely on the underlying java tree
> jtree =3D tree.getTree;
> % some layout
> set(tree, 'Units', 'normalized',...
> =A0 =A0'position', [0 0 1 0.5]);
> set( tree, 'NodeSelectedCallback', @selected_cb );
>
> % make root the initially selected node
> tree.setSelectedNode( rootNode );
>
> % MousePressedCallback is not supported by the uitree, but
> by jtree
> set(jtree, 'MousePressedCallback', @mousePressedCallback);
>
> =A0 % Set the mouse-press callback
> =A0 function mousePressedCallback(hTree, eventData) %,
> additionalVar)
> =A0 % if eventData.isMetaDown % right-click is like a Meta-
> button
> =A0 % if eventData.getClickCount=3D=3D2 % how to detect double
> clicks
>
> =A0 % Get the clicked node
> =A0 =A0 clickX =3D eventData.getX;
> =A0 =A0 clickY =3D eventData.getY;
> =A0 =A0 treePath =3D jtree.getPathForLocation(clickX, clickY);
> =A0 =A0 % check if a node was clicked
> =A0 =A0 if ~isempty(treePath)
> =A0 =A0 =A0 % check if the checkbox was clicked
> =A0 =A0 =A0 if clickX <=3D (jtree.getPathBounds
> (treePath).x+iconWidth)
> =A0 =A0 =A0 =A0 node =3D treePath.getLastPathComponent;
> =A0 =A0 =A0 =A0 nodeValue =3D node.getValue;
> =A0 =A0 =A0 =A0 % as the value field is the selected/unselected
> flag,
> =A0 =A0 =A0 =A0 % we can also use it to only act on nodes with
> these values
> =A0 =A0 =A0 =A0 switch nodeValue
> =A0 =A0 =A0 =A0 =A0 case 'selected'
> =A0 =A0 =A0 =A0 =A0 =A0 node.setValue('unselected');
> =A0 =A0 =A0 =A0 =A0 =A0 node.setIcon(javaImage_unchecked);
> =A0 =A0 =A0 =A0 =A0 =A0 jtree.treeDidChange();
> =A0 =A0 =A0 =A0 =A0 case 'unselected'
> =A0 =A0 =A0 =A0 =A0 =A0 node.setValue('selected');
> =A0 =A0 =A0 =A0 =A0 =A0 node.setIcon(javaImage_checked);
> =A0 =A0 =A0 =A0 =A0 =A0 jtree.treeDidChange();
> =A0 =A0 =A0 =A0 end
> =A0 =A0 =A0 end
> =A0 =A0 end
> =A0 end % function mousePressedCallback
>
> =A0 =A0function selected_cb( tree, ev )
> =A0 =A0 =A0 =A0nodes =3D tree.getSelectedNodes;
> =A0 =A0 =A0 =A0node =3D nodes(1);
> =A0 =A0 =A0 =A0path =3D node2path(node);
> =A0 =A0 =A0 =A0%path =A0 =A0 =A0
> =A0 =A0end
>
> =A0 =A0function path =3D node2path(node)
> =A0 =A0 =A0 =A0path =3D node.getPath;
> =A0 =A0 =A0 =A0for i=3D1:length(path);
> =A0 =A0 =A0 =A0 =A0 =A0p{i} =3D char(path(i).getName);
> =A0 =A0 =A0 =A0end
> =A0 =A0 =A0 =A0if length(p) > 1
> =A0 =A0 =A0 =A0 =A0 =A0path =3D fullfile(p{:});
> =A0 =A0 =A0 =A0else
> =A0 =A0 =A0 =A0 =A0 =A0path =3D p{1};
> =A0 =A0 =A0 =A0end
> =A0 =A0end
>
> =A0 =A0% add node
> =A0 =A0function b1_cb( h, env )
> =A0 =A0 =A0 =A0nodes =3D tree.getSelectedNodes;
> =A0 =A0 =A0 =A0node =3D nodes(1);
> =A0 =A0 =A0 =A0parent =3D node;
> =A0 =A0 =A0 =A0childNode =3D UITreeNode('dummy', 'Child Node', [], 0);
> =A0 =A0 =A0 =A0treeModel.insertNodeInto
> (childNode,parent,parent.getChildCount());
> =A0 =A0 =A0 =A0% expand to show added child
> =A0 =A0 =A0 =A0tree.setSelectedNode( childNode );
> =A0 =A0 =A0 =A0% insure additional nodes are added to parent
> =A0 =A0 =A0 =A0tree.setSelectedNode( parent );
> =A0 =A0end
>
> =A0 =A0% remove node
> =A0 =A0function b2_cb( h, env )
> =A0 =A0 =A0 =A0nodes =3D tree.getSelectedNodes;
> =A0 =A0 =A0 =A0node =3D nodes(1);
> =A0 =A0 =A0 =A0if ~node.isRoot
> =A0 =A0 =A0 =A0 =A0 =A0nP =3D node.getPreviousSibling;
> =A0 =A0 =A0 =A0 =A0 =A0nN =3D node.getNextSibling;
> =A0 =A0 =A0 =A0 =A0 =A0if ~isempty( nN )
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tree.setSelectedNode( nN );
> =A0 =A0 =A0 =A0 =A0 =A0elseif ~isempty( nP )
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tree.setSelectedNode( nP );
> =A0 =A0 =A0 =A0 =A0 =A0else
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tree.setSelectedNode( node.getParent );
> =A0 =A0 =A0 =A0 =A0 =A0end
> =A0 =A0 =A0 =A0 =A0 =A0%node
> =A0 =A0 =A0 =A0 =A0 =A0treeModel.removeNodeFromParent( node );
> =A0 =A0 =A0 =A0end
> =A0 =A0 end
> end % of main function treeExperiment6
>
> =A0 function [I,map] =3D checkedIcon()
> =A0 =A0 I =3D uint8(...
> =A0 =A0 =A0 =A0 [1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0;
> =A0 =A0 =A0 =A0 =A02,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1;
> =A0 =A0 =A0 =A0 =A02,2,2,2,2,2,2,2,2,2,2,2,0,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,1,1,1,1,1,1,0,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,1,1,1,1,1,0,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,1,1,1,1,0,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,1,1,1,0,0,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,0,0,1,1,0,0,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,0,0,0,0,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,0,0,0,0,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,0,0,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,0,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
> =A0 =A0 =A0 =A0 =A02,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
> =A0 =A0 =A0 =A0 =A01,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1]);
> =A0 =A0 =A0map =3D [0.023529,0.4902,0;
> =A0 =A0 =A0 =A0 =A0 =A0 1,1,1;
> =A0 =A0 =A0 =A0 =A0 =A0 0,0,0;
> =A0 =A0 =A0 =A0 =A0 =A0 0.50196,0.50196,0.50196;
> =A0 =A0 =A0 =A0 =A0 =A0 0.50196,0.50196,0.50196;
> =A0 =A0 =A0 =A0 =A0 =A0 0,0,0;
> =A0 =A0 =A0 =A0 =A0 =A0 0,0,0;
> =A0 =A0 =A0 =A0 =A0 =A0 0,0,0]; =A0
> =A0 end
>
> =A0 function [I,map] =3D uncheckedIcon()
> =A0 =A0 =A0I =3D uint8(...
> =A0 =A0 =A0 =A0[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
> =A0 =A0 =A0 =A0 2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1;
> =A0 =A0 =A0 =A0 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,1,1,1,1,1,1,1,1,1,1,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
> =A0 =A0 =A0 =A0 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,1;
> =A0 =A0 =A0 =A0 1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1]);
> =A0 =A0 =A0map =3D ...
> =A0 =A0 =A0 [0.023529,0.4902,0;
> =A0 =A0 =A0 =A01,1,1;
> =A0 =A0 =A0 =A00,0,0;
> =A0 =A0 =A0 =A00.50196,0.50196,0.50196;
> =A0 =A0 =A0 =A00.50196,0.50196,0.50196;
> =A0 =A0 =A0 =A00,0,0;
> =A0 =A0 =A0 =A00,0,0;
> =A0 =A0 =A0 =A00,0,0];
> =A0 end
>
> <--SNAP-->
>
> Beware of the line wraps.
>
> Hope this helps.
>
> Gwendolyn

Thanks Gwendolyn,
It was what I searched for!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui Sprinceana 22 Aug, 2009 06:27:57
treeview Sprinceana 22 Aug, 2009 06:27:53
java Yair Altman 26 Feb, 2008 05:46:11
tree Yair Altman 26 Feb, 2008 05:46:11
undocumented Yair Altman 20 Feb, 2008 14:13:58
rssFeed for this Thread

Contact us at files@mathworks.com