Commit f301ce97 authored by Guadalupe Garcia's avatar Guadalupe Garcia
Browse files


parent 991bc2bc
function c = addTwoNumbers_myName(a, b)
function c = addTwoNumbers_guadalupe(a, b)
% addTwoNumbers_myName(a, b) returns the sum of a and b
c = a + b;
function c = multiplyTwoNumbers_guadalupe(a, b)
% multiplyTwoNumbers_myName(a, b) returns the product of a and b
c = a * b;
function c = sqrt_guadalupe(a)
% sqrt_guadalupe(a) returns the square root of a
c = a^(1/2);
% Test file
c = addTwoNumbers_guadalupe(1, 2)
% test if the addition function works as expected
assert(c == 3)
d = multiplyTwoNumbers_guadalupe(c, c)
% test if the multiplication function works as expected
assert(d == 9)
% Test for the homework
% test my sqrt function
assert(sqrt_guadalupe(d) == sqrt(d))
Markdown is supported
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