How do you create a matrix of matrices in a method?
Mostra commenti meno recenti
I'm trying to design a class whose instance is an array of matrices. The matrices are read from some source file, xls, csv, etc. The super matrix is of size 30, and the user can add files in each slot. The declaration needs to allow for dynamic possibilities. But I'm not sure how to do this syntactically. I'm running MATLAB R2012B.
Here is the code thus far:
classdef BankAccount < handle properties (Hidden) end
properties (SetAccess = private)
VEC
IndicatorCount = 0;
Index = zeros(30); %This obviously won't work because of a dimension mismatch
end
methods
function BA = BankAccount(filename)
if nargin ~=0 %handles empty declarations
BA.VEC = xlsread(filename);
BA.IndicatorCount = FI.IndicatorCount +1; %find shorthand
disp(FI.IndicatorCount)
BA.Index(FI.IndicatorCount)= FI.VEC; %need the Index to be able to take on %different matrix sizes dynamically
end
end
end
end
if someone can tell me how to do this in a smart way I would appreciate the help
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Construct and Work with Object Arrays in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!