absolute value - % absoluteValue(16) -> 16 %...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %absoluteValue (number) -> number %Description: % This functixon evaluates a given number and returns its absolute value %Examples: % absoluteValue(-3) -> 3
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % absoluteValue(16) -> 16 % absoluteValue(5) -> 5 function output = absoluteValue(x) output = x if x > 0 output = x elseif x < 0 output = x * -1 end...
View Full Document

Ask a homework question - tutors are online