Create a function that returns the square and the squareroot
Create a function that returns the square and the squareroot of a number supplied by the script or command line that calls it. Make sure the output includes a statement to indicate which in which.
Solution
PROGRAM:
%From Command Prompt:
% function to get powers : For square n=2 used & for square root n=0.5 used.
function [y,z] = powers(x)
