how to fix this error -> Undefined function 'eq' for input arguments of type 'cell'.

%%%%Calculate the number of times each element from netlist appears. %%%%
num_tot =(size(element));
num_tot = num_tot(1);
num_ind = sum(element(:) =='L');
num_res = sum(element(:) == 'R');
num_cap = sum(element(:) == 'C');
num_exc = sum(element(:) == 'E');

 Respuesta aceptada

Guessing here that ‘element’ is a cell array of some sort.
Try this:
element = {'L' 'R' 'C' 'E' 'L' 'R' 'C' 'E'}; % Create What I believe ‘element’ Is
num_ind = sum(strcmp(element, 'L'));

Más respuestas (0)

Categorías

Preguntada:

AD
el 15 de Nov. de 2017

Editada:

el 15 de Nov. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by