MATLB - how to show REAL numbers only

Click For Summary
SUMMARY

The discussion focuses on using the MATLAB symbolic toolkit to eliminate complex conjugate terms from symbolic matrices. The user demonstrates an example with symbolic variables 'l' and 'd', resulting in a matrix that includes the "conj" function. The solution provided is to declare the variables as real using the command "syms l d real", which effectively removes the conjugate terms from the output. This approach is essential for applications that exclusively deal with real numbers.

PREREQUISITES
  • Familiarity with MATLAB symbolic toolbox
  • Understanding of symbolic variables and matrices
  • Knowledge of complex numbers and their properties
  • Basic experience with MATLAB syntax and commands
NEXT STEPS
  • Explore MATLAB symbolic toolbox documentation for advanced features
  • Learn about defining constraints on symbolic variables in MATLAB
  • Investigate the implications of using real versus complex variables in MATLAB
  • Practice creating and manipulating symbolic matrices in MATLAB
USEFUL FOR

Mathematicians, engineers, and researchers using MATLAB for symbolic computation, particularly those focused on real-number applications without the need for complex numbers.

Curl
Messages
756
Reaction score
0
I'm trying to use the MATLAB symbolic toolkit, but the "conj" term keeps annoying me. Here's an example:

>>syms l d
>>A=[l d ; d*l -l*l*d]
>>A'
ans =

[ conj(l), conj(d)*conj(l)]
[ conj(d), -conj(d)*conj(l)^2]

How do I tell MATLAB I'm only interested in real numbers, and get rid of the conj terms? My applications do not involve any imaginary numbers at all.

Thanks
 
Physics news on Phys.org
Code:
syms l d real;
 
I appreciate it.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 85 ·
3
Replies
85
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 25 ·
Replies
25
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K