Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Problem in assignning the real of complex number
1 回表示 (過去 30 日間)
古いコメントを表示
Hello
I want to assign the real of certain complex number,for example
x=2+2*j;
when i write the following command real(x)=0;
matlab output the following error Subscript indices must either be real positive integers or logicals.
but i don't understand the reason, can anyone help me
Thanks
0 件のコメント
回答 (2 件)
Azzi Abdelmalek
2013 年 11 月 17 日
編集済み: Azzi Abdelmalek
2013 年 11 月 17 日
x=2+2*j;
real(x) will return the real part of x , if you want to assign 0 to real(x) , just write
x=imag(x)*i
%or
x=new_x+imag(x)*i
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!