{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

recursiveProd HW9 - elements and returns the product as a...

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

View Full Document Right Arrow Icon
% 10/14/2009 % Function Name: recursiveProd % Inputs: 1.(Double) Vector of numbers. % Outputs: 1.(Double) Product of the elements in the input vector % % Function Description: % This function takes in a vector of doubles, RECURSIVELY multiplies its
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % elements and returns the product as a scalar. If the input is an % empty vector, the function should return 1. function out = recursiveProd(in) if isempty(in) out=1; else out = in(1).*recursiveProd(in(2:end)); end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online