Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
school
git
basic-practice
Commits
6a6fcc3b
Commit
6a6fcc3b
authored
Jan 31, 2019
by
Diana HENDRICKX
Browse files
fix Matlab functions
parent
30d883cd
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/firstCommit/addTwoNumbers_diana.m
View file @
6a6fcc3b
function
c
=
addTwoNumbers_myName
(
a
,
b
)
% addTwoNumbers_
myName
(a, b) returns the sum of a and b
% addTwoNumbers_
diana
(a, b) returns the sum of a and b
c
=
a
+
b
;
end
src/secondCommit/multiplyTwoNumbers_diana.m
0 → 100644
View file @
6a6fcc3b
function
c
=
multiplyTwoNumbers_diana
(
a
,
b
)
% multiplyTwoNumbers_diana(a, b) returns the product of a and b
c
=
a
*
b
;
end
src/secondCommit/multiplyTwoNumbers_myName.m
deleted
100644 → 0
View file @
30d883cd
function
c
=
multiplyTwoNumbers_myName
(
a
,
b
)
% multiplyTwoNumbers_myName(a, b) returns the product of a and b
c
=
a
/
b
;
end
src/thirdCommit/sqrt_diana.m
View file @
6a6fcc3b
function y = sqrt_diana(x)
y = sqrt(x)
y = sqrt(x)
;
endfunction
test/suite/test_diana.m
View file @
6a6fcc3b
...
...
@@ -5,11 +5,11 @@ c = addTwoNumbers_diana(1, 2)
% test if the addition function works as expected
assert
(
c
==
3
)
%
d = multiplyTwoNumbers_diana(c, c)
d
=
multiplyTwoNumbers_diana
(
c
,
c
)
% test if the multiplication function works as expected
%
assert(d == 9)
assert
(
d
==
9
)
% Test for the homework
% test my sqrt function
assert
(
sqrt_diana
(
d
)
==
sqrt
(
d
))
assert
(
sqrt_diana
(
d
)
==
sqrt
(
d
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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