matlab beginner issues

Discussion in 'Programmer's Corner' started by monkeyhead, Nov 27, 2008.

  1. monkeyhead

    Thread Starter Active Member

    Mar 5, 2007
    Hi there,
    Basically I'm working through an exercise where I need to estimate the value of pi by using series expansion.
    I've just created my function file as follows:

    function [pi_approx_inc] = pi_approx_arg(k)

    pi_approx_inc = 1/16^k((4/8k+1)-(2/8k+4)-(1/8k+5)-(1/8k+5)-(1/8k+6));

    In the editor however, the first line bar function has a red line under it and claims to have never been set?

    Also I get a red line underneath the k in 4/8k+1. Claiming to be of an invalid syntax?

    I'm uncertain what I'm doing wrong here, and would gladly appreciate any feedback.

    Kind regards,