1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab function help

  1. Feb 24, 2010 #1
    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)

    function y=radicals(v)
    n = 1
    ???
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?



Similar Discussions: Matlab function help
  1. Matrices in MATLAB (Replies: 0)

Loading...