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');

 Accepted Answer

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'));

More Answers (0)

Asked:

AD
on 15 Nov 2017

Edited:

on 15 Nov 2017

Community Treasure Hunt

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

Start Hunting!