1 classdef ICompositeMatrix < handle
2 %classdef ICompositeMatrix
3 % Handle
class holding a cell array for a "composite-matrix".
7 properties (Access =
protected)
8 M; % cell array storing the matrices
15 % returns a characteristic size
18 % mat = getMatrix(this)
20 mat = getMatrix(this);
29 function res = length(this)
30 % length of cell array
34 function this = set(this, mat, index)
36 if index > length(this)
42 function mat =
get(
this, index)
43 % returns one cell or sub-matrix
44 if max(index) > length(
this)
55 function obj1 = horzcat(obj1, obj2)
56 % horizontal concatenation
58 if isa(obj2, 'handle')
65 obj1.M{i} = horzcat(obj1.M{i}, obj2.M{i});
70 function mat = ctranspose(
this)
71 % transposition, returns matrix
72 mat = ctranspose(this.getMatrix);
75 function mat = plus(obj1, obj2)
77 if isa(obj1,
'VecMat.ICompositeMatrix')
79 mat = getMatrix(obj1) + getMatrix(obj2);
81 mat = getMatrix(obj1) + obj2;
84 mat = obj1 + getMatrix(obj2);
88 function mat = minus(obj1, obj2)
92 mat = getMatrix(obj1) - getMatrix(obj2);
94 mat = getMatrix(obj1) - obj2;
97 mat = obj1 - getMatrix(obj2);
101 function mat = mtimes(obj1, obj2)
102 % multiplication with array or composite-matrix
105 mat = getMatrix(obj1) * getMatrix(obj2);
107 mat = getMatrix(obj1) * obj2;
110 mat = obj1 * getMatrix(obj2);
114 function mat = mldivide(obj1, mat)
116 mat = mldivide(getMatrix(obj1), mat);
119 function varargout = subsref(this, S)
120 % subscript reference to matrix
122 [varargout{1:nargout}] = builtin(
'subsref',
this, S);
124 [varargout{1:nargout}] = subsref(getMatrix(
this), S);
128 function M = subsasgn(
this, S, B)
130 M = subsasgn(getMatrix(
this), S, B);
Handle class holding a cell array for a "composite-matrix".