Table column with different subclasses of a superclass
이전 댓글 표시
I am try to combine tables that have a column of objects. The objects in these columns are both subs of a common superclass, but are different subs. When I try to combine tables, I get an error saying "Could not concatenate the table variable 'var' using VERTCAT.".
My object structure resembles the following:
classdef (Abstract) super
% Some stuff
end
classdef sub1 < super
% Some stuff
end
classdef sub2 < super
% Some stuff
end
Is there a way for me to have both of these tables, with different sub definitions in the same 'var' column, combine into one table? Can I assign the type of 'var' column to type super and would this allow vertcat to work?
댓글 수: 1
Luna
2019년 1월 11일
Could you please share sample tables with the code?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Subclass Definition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!