MATLAB: Are we giving {1} in below command … What is the significance ? residue C=tf(1, [1 3 2]); [x, y]=residue(C.num {1}, C.den {1}) temp=0; syms s t for i=1:numel(y) temp=temp+(x(i)/(s-y(i))) end Best Answer C.num and C.den are cell arrays. Checkclass(C.num)Cell arrays are different than simple array in MATLAB. To index a cell array, you need {} brackets. Related SolutionsMATLAB: Inserting matrices in a cell – in a for loop You need to get the data out of the cell array before concatenating it with the new data, i.e. replacewholedff{c_event} = [wholedff(c_event),num_dff]withwholedff{c_event} = [wholedff{c_event},num_dff]% ^ ^ correct indexinghttps://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-cell-array.html MATLAB: Divide a cell arrays with a part of another cell array Try this:C = num2cell(bsxfun(@rdivide,cell2mat(A),cell2mat(B(1,2:end))));Note that B{1,2:end} using the curly braces will be a comma-separated-list of the contents of B, whereas B(1,2:end) using parentheses will simply be another cell array. Related QuestionDouble to cell from workspaceError with basic tf function when num and den data are enormousSummary of the cellHow to round off the coefficients of sys2 polynomial(num/den)How to store the matrix value in cell array
Best Answer