Obtaining a single term of a multi-term variable

Discussion in 'MATLAB' started by EC, Oct 30, 2006.

  1. EC

    EC Guest

    Is there a way to get just one term, for example the first of a
    multi-term variable?

    My problem is I have a variable
    v = 2.3 + 0.000i
    and all I want is the 2.3. Is there a way to do this?

    Thanks in advance!
     
    EC, Oct 30, 2006
    #1
    1. Advertisements

  2. EC

    Steven Lord Guest

    That's not a multi-term variable as I understand the term. That's a complex
    number. To extract the real or imaginary parts of a complex number, use
    REAL or IMAG.
     
    Steven Lord, Oct 30, 2006
    #2
    1. Advertisements

  3. EC

    Loren Shure Guest

    Check out isreal for this case. But I don't know if that's general
    enough for what you are really trying to do.

    --Loren
    http://blogs.mathworks.com/loren/
     
    Loren Shure, Oct 30, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.