Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
school
git
basic-practice
Commits
09742e34
Commit
09742e34
authored
Jan 30, 2019
by
Laurent Heirendt
✈
Browse files
Merge branch 'homework_guadalupe' into 'develop'
Homework guadalupe See merge request R3school/git.practice!51
parents
89b51e15
ead1cebe
Pipeline
#8540
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/firstCommit/addTwoNumbers_
myNam
e.m
→
src/firstCommit/addTwoNumbers_
guadalup
e.m
View file @
09742e34
function
c
=
addTwoNumbers_
myNam
e
(
a
,
b
)
function
c
=
addTwoNumbers_
guadalup
e
(
a
,
b
)
% addTwoNumbers_myName(a, b) returns the sum of a and b
c
=
a
-
b
;
c
=
a
+
b
;
end
src/secondCommit/multiplyTwoNumbers_
myNam
e.m
→
src/secondCommit/multiplyTwoNumbers_
guadalup
e.m
View file @
09742e34
function
c
=
multiplyTwoNumbers_
myNam
e
(
a
,
b
)
function
c
=
multiplyTwoNumbers_
guadalup
e
(
a
,
b
)
% multiplyTwoNumbers_myName(a, b) returns the product of a and b
c
=
a
/
b
;
c
=
a
*
b
;
end
src/thirdCommit/sqrt_guadalupe.m
0 → 100644
View file @
09742e34
function
c
=
sqrt_guadalupe
(
a
)
% sqrt_guadalupe(a) returns the square root of a
c
=
a
^
(
1
/
2
);
end
test/suite/test_
myNam
e.m
→
test/suite/test_
guadalup
e.m
View file @
09742e34
% Test file
c
=
addTwoNumbers_
myNam
e
(
1
,
2
)
c
=
addTwoNumbers_
guadalup
e
(
1
,
2
)
% test if the addition function works as expected
assert
(
c
==
3
)
%
d = multiplyTwoNumbers_
myNam
e(c, c)
d
=
multiplyTwoNumbers_
guadalup
e
(
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_
myNam
e(d) == sqrt(d))
assert
(
sqrt_
guadalup
e
(
d
)
==
sqrt
(
d
))
Write
Preview
Markdown
is supported
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