Complete the code to define a simple function that adds two numbers.
function result = addNumbers(a, b)
result = a [1] b;
endThe plus sign + adds two numbers in MATLAB.
Complete the code to call the function 'addNumbers' with inputs 3 and 5.
sum = [1](3, 5);
The function is named addNumbers, so calling it requires that exact name.
Fix the error in the function definition by completing the missing keyword.
[1] addNumbers(a, b)
result = a + b;
enddef.In MATLAB, functions start with the keyword function.
Fill both blanks to create a function that returns the square of a number.
function [1] = squareNumber([2]) [1] = [2]^2; end
^.The function output variable is result and the input variable is num.
Fill all three blanks to create a function that checks if a number is positive.
function [1] = isPositive([2]) if [2] [3] 0 [1] = true; else [1] = false; end end
The function returns result, takes input num, and checks if num > 0.
