The following 5 choices represent the first line of a functi

The following 5 choices represent the first line of a function file in Matlab. Which ones are VALID first lines?
i. function [x,y,z] = funnyFunction(a,b,c)
ii. function [z] = funnyFunction.m(a,b,c)
iii. function [x,z] = funnyFunction(a b)
iv. function (x,y,z) = funnyFunction
v. function [x] = funnyFunction(a(i))
vi. function = funnyFunction(a1)

Solution

i. function [x,y,z] = funnyFunction(a,b,c)
=> valid as syntax of input and output arguments is correct

ii. function [z] = funnyFunction.m(a,b,c)
=> Invalid as syntax of input and output argumnets is correct but
function name cannot be a file name of matlab

iii. function [x,z] = funnyFunction(a b)
=> valid as syntax of input and output argumnets is correct

iv. function (x,y,z) = funnyFunction
=> Invalid as syntax of input and output argumnets is not correct

v. function [x] = funnyFunction(a(i))
=> Invalid as input arguments is not defined properly,value of i should be
defined for it to be accessed by function

vi. function = funnyFunction(a1)
=> Invalid as output argumnets is not given

The following 5 choices represent the first line of a function file in Matlab. Which ones are VALID first lines? i. function [x,y,z] = funnyFunction(a,b,c) ii.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site