题目
求两个数的和:给一个c,求c=a+b
matlab代码
function c = add_two_numbers(a,b) c = a+b end
调用方式:
add_two_numbers(1,2)
测试例子比如:
%% a = 17; b = 2; c_correct = 19; assert(isequal(add_two_numbers(a,b),c_correct))
求两个数的和:给一个c,求c=a+b
function c = add_two_numbers(a,b) c = a+b end
调用方式:
add_two_numbers(1,2)
测试例子比如:
%% a = 17; b = 2; c_correct = 19; assert(isequal(add_two_numbers(a,b),c_correct))