function create(name,varargin)
global zeng2 
if isempty(varargin)
   num=1; 
else
   num=varargin{1}; 
end

if isempty(zeng2.var)
    num_varlist=0;
	num_var    =0;
else
    num_varlist=length(zeng2.varlist);
	num_var    =length(zeng2.var);
    for i=1:num_varlist
        if strcmp(zeng2.varlist{i},name)
            zexst('err',['You already have ''' name '''.' ]);
            return
        end
    end
end
eval(['global ' name])
zeng2.varlist{num_varlist+1}=name;
if num==1
    new_num_var=num_var+1;

    zeng2.var{new_num_var}.name=name; 
    zeng2.var{new_num_var}.paraname{1} ='vm';   %used in viewplot
    zeng2.var{new_num_var}.paraname{2} ='ve';   %used in viewplot
    zeng2.var{new_num_var}.paraname{3} ='I';    %used in viewplot
    zeng2.var{new_num_var}.paraname{4} ='Ilk';  %used in viewplot
    zeng2.var{new_num_var}.paraname{5} ='Ic';   %used in viewplot
    
    eval([name '.name       = name  ;'])                  
    eval([name '.varnum     = new_num_var;'])   %marker    
    eval([name '.nseg       = 1;'])             %um
    eval([name '.dia        = 10;'])            %um
    eval([name '.da_D       = 1;']) 
    eval([name '.dn_D       = 1;'])             %um
    eval([name '.Linter_D   = 100;'])           
    eval([name '.L          = 100;'])           %um
    eval([name '.Lmode      = 1;'])	            %Lmode   1=fix, 2 = L_D x D x nseg
    eval([name '.lnodal     = [];'])		    %um
    eval([name '.cm         = 1;'])             %uf/cm2
    eval([name '.ra         = 100;'])           %ohm-cm
    eval([name '.rm         = 3;'])             %kohm-cm2   %should be the same unit as in model;otherwise, be careful at zrun.
    eval([name '.vini      =-70;'])            %mV
    eval([name '.model      = [];'])            %mV
    eval([name '.vestim     = [];'])            %mV  Extracellular Stimulator
    eval([name '.xyz        = [];'])            %um 
    eval([name '.xyzi       = [];'])            %
    eval([name '.xyzc       = [];'])            %um
    
    
else
	for i =1:num
	    zeng2.var{num_var+i}.name=[name '{' num2str(i) '}']; 
	    zeng2.var{num_var+i}.paraname{1} ='vm'; %used in viewplot
    	zeng2.var{num_var+i}.paraname{2} ='ve'; %used in viewplot
    	zeng2.var{num_var+i}.paraname{3} ='I';  %used in viewplot
	    zeng2.var{num_var+i}.paraname{4} ='Ilk';%used in viewplot
        zeng2.var{num_var+i}.paraname{5} ='Ic'; %used in viewplot
        
        eval([name '{i}.name     = [name ''{'' num2str(i)  ''}''];'])                  
        eval([name '{i}.varnum   = num_var+i;'])%marker
        eval([name '{i}.nseg     = 1;'])        %um
        eval([name '{i}.dia      = 10;'])       %um
	    eval([name '{i}.da_D     = 1;']) 
        eval([name '{i}.dn_D     = 1;'])		%um
        eval([name '{i}.Linter_D = 100;'])      
        eval([name '{i}.L        = 100;'])      %um
        eval([name '{i}.Lmode    = 1;'])		%Lmode   1=fix, 2 = const x D x nseg
        eval([name '{i}.lnodal   = [];'])       %um
        eval([name '{i}.cm       = 1;'])        %uf/cm2
        eval([name '{i}.ra       = 100;'])      %ohm-cm
        eval([name '{i}.rm       = 3;'])        %kohm-cm2   %should be the same unit as in model;otherwise, be careful at zrun.
        eval([name '{i}.vini    =-70;'])       %mV
        eval([name '{i}.model    =[];'])        %mV
        eval([name '{i}.vestim   =[];'])        %mV     Extracellular Stimulator
        eval([name '{i}.xyz      =[];'])        %um
        eval([name '{i}.xyzi     =[];'])        %um
        eval([name '{i}.xyzc     =[];'])        %um
    end
end
