Write a function “separatethem” that will receive one input argument which is a structure containing fields named ‘length’ and ‘width’, and will return the two values separately. Here is an example of calling the function:
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:8| Question number:18.8
All Answers
total answers (1)
separatethem.m
function [len, wid] = separatethem(rect)
len = rect.length;
wid = rect.width;
end
need an explanation for this answer? contact us directly to get an explanation for this answer