MATLAB Help needed in MATLAB , Please ( Simple question )

  • Thread starter Thread starter Serena_hm
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To input an imaginary value in a MATLAB program, such as impedance Z = 100 + 10i, it can be done directly as written. Users can define the imaginary unit using either "i" or "j" as long as these variables have not been redefined in the program. If there is uncertainty about the definition of "i," it is advisable to explicitly set it with "i = sqrt(-1)" before using it in calculations. This ensures that the imaginary component is correctly interpreted in the program.
Serena_hm
Messages
18
Reaction score
2
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
 
Physics news on Phys.org
Serena_hm said:
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

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

or

Z = 100 + 10*j

If you're not sure about "i" being redefined you can always do "i = sqrt(-1)" first.
 
Last edited:

Similar threads

Replies
4
Views
4K
Replies
3
Views
2K
Replies
5
Views
3K
Replies
12
Views
2K
Replies
2
Views
2K
Replies
4
Views
2K
Back
Top