Help needed in MATLAB , Please ( Simple question )

  • Context: MATLAB 
  • Thread starter Thread starter Serena_hm
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

This discussion focuses on how to input imaginary values in MATLAB, specifically for defining impedance. Users can define an imaginary number using either the variable "i" or "j" as long as they have not been redefined in the program. The correct syntax for defining impedance is demonstrated with examples such as Z = 100 + 10*i or Z = 100 + 10*j. Additionally, if there is uncertainty about the variable "i", it can be explicitly defined as i = sqrt(-1).

PREREQUISITES
  • Basic understanding of MATLAB syntax
  • Familiarity with complex numbers
  • Knowledge of variable assignment in programming
  • Access to MATLAB documentation
NEXT STEPS
  • Explore MATLAB's complex number functions
  • Learn about variable scoping in MATLAB
  • Research MATLAB's built-in functions for mathematical operations
  • Review examples of impedance calculations in MATLAB
USEFUL FOR

MATLAB users, engineers working with electrical impedance, students learning complex numbers in programming, and anyone needing assistance with MATLAB programming syntax.

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
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K