Commit 0ef265f1 authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Improve treatment of constructor arguments.

parent 8cc6cb98
......@@ -8,14 +8,14 @@ classdef Node2D < mafe.Node
methods
%% constructor
function obj = Node2D(ref_coords)
if nargin >= 1
obj.ref = ref_coords;
end
if exist('ref_coords','var')
obj.ref = ref_coords;
end
end
%% print nodal data
function str = print(self)
str = sprintf('[% 7.3f,% 7.3f]', self.ref(1), self.ref(2));
str = strcat( str, print@mafe.Node(self) );
str = sprintf('[% 7.3f,% 7.3f]', self.ref(1), self.ref(2));
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