benpolletta / Lee2015

Code for laminar cortical model from Lee, Whittington, & Kopell 2015 (depends on DynaSim).
2 stars 0 forks source link

Error using cell/ismember (line 34) #1

Open davestanley opened 5 years ago

davestanley commented 5 years ago

Setup sim struct


>> sim_struct = Lee2015initSimStruct

sim_struct = 
  struct with fields:

                 solver: 'euler'
                  tspan: [0 3000]
                 dsfact: 100
         save_data_flag: 1
          parallel_flag: 0
              num_cores: 16
           compile_flag: 0
           cluster_flag: 0
              qsub_mode: 'array'
    one_solve_file_flag: 1
             debug_flag: 0
     analysis_functions: {}
       analysis_options: {}
                 column: 'a1_2013'
               ach_flag: 0
               excluded: {}
                   vary: {}

Run

>> [data, name, sim_spec] = Lee2015functionMode(sim_struct)
Warning: Directory already exists. 
> In Lee2015functionMode (line 15) 
solver =
    'euler'
Error using cell/ismember (line 34)
Input A of class char and input B of class cell must be cell arrays of character vectors, unless one is a character vector.
Error in dsCheckSpecification (line 867)
      if isfield(spec.(object),'mechanisms') && ~isempty(spec.(object)(i).mechanisms) && ismember(mech,{spec.(object)(i).mechanisms.name})
Error in dsGenerateModel (line 159)
specification = dsCheckSpecification(specification, varargin{:}); % standardize & auto-populate as needed
Error in dsCheckModel (line 102)
  model = dsGenerateModel(model);
Error in dsSimulate (line 540)
model = dsCheckModel(model, varargin{:}); % handles conversion when input is a string w/ equations or a DynaSim specification structure
Error in Lee2015functionMode (line 65)
    data = dsSimulate(sim_spec,'tspan',tspan,'downsample_factor',dsfact,'solver',solver,'coder',0,... 
34          error(message('MATLAB:ISMEMBER:InputClass',class(a),class(b)));
K>> 
davestanley commented 5 years ago

Issue is here. One of the mechanisms is empty

K>> mech
mech =
    'iCaL'
K>> {spec.(object)(i).mechanisms.name}
ans =
  1×4 cell array
    {'FSiNaF'}    {'FSiKDR'}    {0×0 double}    {'IBiM'}
davestanley commented 5 years ago

Population in question:

K>> spec.populations(3)
ans = 
  struct with fields:

              name: 'supSI'
              size: 20
         equations: ';dV/dt=(Iapp+@current)./Cm;  V(0)=-65; gNaF=+100.00000000; gKDR=+80.00000000; Cm=+0.90000000; gleak=+0.10000000; gM=+8.00000000; gCaL=+0.00000000; Iapp=-1.00000000;'
    mechanism_list: {'FSiNaF@current'  'FSiKDR@current'  'ileak@current'  'IBiM@current'  'iCaL@current'}
        mechanisms: [1×4 struct]
        parameters: {1×22 cell}
      conditionals: []
          monitors: []
             model: []

Missing mechanism

K>> spec.populations(3).mechanisms
ans = 
  1×4 struct array with fields:
    name
    equations
K>> spec.populations(3).mechanisms
ans = 
  1×4 struct array with fields:
    name
    equations
K>> spec.populations(3).mechanisms.name
ans =
    'FSiNaF'
ans =
    'FSiKDR'
ans =
     []
ans =
    'IBiM'