Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Matlab Question

  • 14-10-2004 7:54am
    #1
    Registered Users, Registered Users 2 Posts: 1,368 ✭✭✭


    Ok guys,

    Im doing some matlab programming and have come across the following problem:

    The matlab code is supposed to represent an equation which includes the square root of e, e being the exponential.

    So I tried to implement it as follows:

    x() = 2 * sqrt(exp) * i * fc * e^(-1 * 2 *(pi * i * fc)^2);

    also I've tried

    x() = 2 * sqrt( e ) * i * fc * e^(-1 * 2 *(pi * i * fc)^2);

    but both give errors...

    Has anyone got any ideas,

    Thanks,
    Martin


Comments

  • Closed Accounts Posts: 113 ✭✭midnorthfourzer


    Ok guys,

    Im doing some matlab programming and have come across the following problem:

    The matlab code is supposed to represent an equation which includes the square root of e, e being the exponential.

    So I tried to implement it as follows:

    x() = 2 * sqrt(exp) * i * fc * e^(-1 * 2 *(pi * i * fc)^2);

    also I've tried

    x() = 2 * sqrt( e ) * i * fc * e^(-1 * 2 *(pi * i * fc)^2);

    but both give errors...

    Has anyone got any ideas,

    Thanks,
    Martin

    'e' in Matlab is represented as 'exp(1)' "e to the power of 1"

    Arrays are indexed using parentheses, don't use square brackets, e.g.
    'x(i)', 'x(1,i)' or 'x(i,1)' depending on your row/column preferences

    Make sure that your initial value of 'i' is 1. 'x(0)' will throw up an error.

    Get ahead of the class and write the square root of e as 'exp(0.5)' "e to the power of 0.5". In long form it's 'sqrt(exp(1))'

    don't forget to initialise 'fc' and 'i' . The following code snippet should give you an idea....the values of x will be on one row in this example.
    x(1,i) = 2 * sqrt(exp(1)) * i * fc * exp(-2*(pi*fc*i)^2);
    


  • Registered Users, Registered Users 2 Posts: 1,368 ✭✭✭king_of_inismac


    Thanks for the help man :D


Advertisement