# Matlab function help

1. Feb 24, 2010

### jmed

1. The problem statement, all variables and given/known data
Implement a matlab function y=radicals(v) that calculates sqrt v(1) + sqrt v(2) +sqrt v(3) +......sqrt v(n). These values are components of v.
Then I need to write a script to test function. Enter positive integer k. Generate random vector r of length k using rand function. Then calculate following sequence by calling function radicals repeatedly. sqrt r(1), sqrt r(1)+sqrt r(2), sqrt r(1)+sqrtr(2)+sqrt r(3),......
, sqrt r(1)+sqrt r(2)+sqrt r(3)....+sqrt r(k)

Save calculated values to a vector seq. Display and plot seq.

2. Relevant equations

3. The attempt at a solution

Set up a function y = radicals(v)