Commit 8cc6cb98 authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Improve treatment of constructor arguments.

parent 03afcedc
......@@ -7,15 +7,15 @@ classdef Node1D < mafe.Node
methods
%% constructor
function obj = Node1D(ref_coord)
if nargin >= 1
obj.ref = ref_coord;
end
function obj = Node1D(ref_coords)
if exist('ref_coords','var')
obj.ref = ref_coords;
end
end
%% print nodal data
function str = print(self)
str = sprintf('[% 7.3f]', self.ref(1));
str = strcat( str, print@mafe.Node(self) );
str = sprintf('[% 7.3f]', self.ref(1));
str = strcat( str, print@mafe.Node(self) );
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment