Method Input within Function (or something like that)
Ältere Kommentare anzeigen
function [Matrix,SubcomponentMatrix] = myfunction(other things + SubcomponentMatrix)
for i=1:length(something)
element = Nodes(List{i,2}).(List{i,3})...
(List{i,6});
element = update(element,SubcomponentMatrix,i);
end
where element is a class instance
and update is a method
function obj = update(obj,SubcomponentMatrix,i)
for m=3:sum(~cellfun(@isempty,SubcomponentMatrix(i,:)),2) %length var therefore only consider non empty cells
x = SubcomponentMatrix{i,m}.property1;
y(m-2,1) = SubcomponentMatrix{i,m}.y(x+1);
end
obj.K = 1-min(y);
end
SubcomponentMatrix is a cell that contains classes of a different type
The first two colums of SubcomponentMatrix contain some sort of ID and don't contain relevant information
I'm pretty sure I didn't catch something basic on OOP - the error is "not enough Input arguments" in update
I'm very grateful for any help.
4 Kommentare
Guillaume
am 28 Okt. 2019
Can you please give us the full text of the error message. Copy/paste everything in red.
Lucas Russi
am 28 Okt. 2019
Guillaume
am 28 Okt. 2019
Ok, so the problem is with myfunction, not with update. What is the actual signature of myfunction, and more importantly, how did you call it?
Have you really given us the full text of the error message? The answer to these questions would have been in the rest of the error message.
Lucas Russi
am 28 Okt. 2019
Bearbeitet: Guillaume
am 28 Okt. 2019
Akzeptierte Antwort
Weitere Antworten (3)
Lucas Russi
am 28 Okt. 2019
0 Stimmen
Lucas Russi
am 28 Okt. 2019
0 Stimmen
Lucas Russi
am 28 Okt. 2019
0 Stimmen
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
