MATLAB: From a structure find the number of rows with a certain character structures In a structure there is a column having characters of (LB, LL). How can I find how many LB and LL are there? Best Answer Hello Asim Ismail! Maybe this can be helpfull:I create a struct "s" with a field "type".clear all;close all;clc; A = ['LB';'LB';'LL';'LB';'LL'];field = 'type';value = A;s = struct(field,value);LB_quant = sum(s.type(:,2)=='B') %number of 'LB' in array type of struct sLL_quant = sum(s.type(:,2)=='L') %number of 'LL' in array type of struct s Related SolutionsMATLAB: Array of structures containing arrays s(1) = struct('field1', [1:3;4:6]);s(2) = struct('field1', [4:6;1:3]);z = cell2mat(struct2cell(s))out = squeeze(z(1,3,:))' MATLAB: Question about structures in Matlab Yes, that's possible:s = struct('field1', 45, 'field2', 'Nothing')s.field3 = struct('subfield1', 232)And you can access:s.field3.subfield1 Related QuestionComparing two structures and find the common
Best Answer