Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
edu
mafe
Commits
0ef265f1
Commit
0ef265f1
authored
Sep 19, 2018
by
Andreas Zilian
Browse files
Improve treatment of constructor arguments.
parent
8cc6cb98
Changes
1
Hide whitespace changes
Inline
Side-by-side
+mafe/Node2D.m
View file @
0ef265f1
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment