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

2 views (last 30 days)
%%%%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

Star Strider
Star Strider on 15 Nov 2017
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)

Categories

Find more on Descriptive Statistics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!