Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help needed in MATLAB , Please ( Simple question )

  1. Sep 19, 2012 #1
    hello everybody !

    I'm working on a simple MATLAB program & I got stuck with something so I'll appreciate it if anyone can help

    how can I write an imaginary value in a MATLAB program as input , for example, impedance Z = 100+10i
  2. jcsd
  3. Sep 19, 2012 #2


    Staff: Mentor

  4. Sep 19, 2012 #3


    User Avatar
    Science Advisor

    I'm pretty sure you can do it exactly as you've just typed.

    Also, as long as variables "i" and "j" have not been redefined by your program, then use either:

    Z = 100 + 10*i


    Z = 100 + 10*j

    If you're not sure about "i" being redefined you can always do "i = sqrt(-1)" first.
    Last edited: Sep 19, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook