how can i obtain just the real part instead of immaginary part ?

1 次查看(过去 30 天)
i want just the real part from these vlaues
knowng that
Name Size Bytes Class Attributes
Vpsim 51x500 408000 double complex
1.3252 + 0.0000i 1.4465 + 0.0000i 1.4043 + 0.0000i
1.3300 + 0.0000i 1.2834 + 0.0000i 1.4307 + 0.0000i
1.3310 + 0.0000i 1.3500 + 0.0000i 1.3947 + 0.0000i
1.3313 + 0.0000i 1.2473 + 0.0000i 1.3757 + 0.0000i
1.2713 + 0.0000i 1.0426 + 0.0000i 1.3731 + 0.0000i
0.9120 + 0.0000i 1.3442 + 0.0000i 1.3818 + 0.0000i

回答(1 个)

Dave B
Dave B 2021-11-14
The functions real and imag pull out the real and imaginary parts:
X = sqrt(-rand(3))+rand(3)
X =
0.8163 + 0.4712i 0.7445 + 0.6770i 0.7423 + 0.8525i 0.2628 + 0.6231i 0.1585 + 0.6913i 0.2367 + 0.7967i 0.7158 + 0.7837i 0.9413 + 0.9009i 0.0461 + 0.8458i
R = real(X)
R = 3×3
0.8163 0.7445 0.7423 0.2628 0.1585 0.2367 0.7158 0.9413 0.0461
I = imag(X)
I = 3×3
0.4712 0.6770 0.8525 0.6231 0.6913 0.7967 0.7837 0.9009 0.8458
  5 个评论
RADWAN A F ZEYADI
RADWAN A F ZEYADI 2021-11-14
yes my code contain also function after i called it i got this error its defficult to provide all the code because contain a function
Dave B
Dave B 2021-11-14
This warning can mean lots of different things depending on the context. A singular matrix is one that has a determinant of 0, but my guess is you're using a higher level function that depends on a non-singular matrix to do some math.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by