Message Boards Message Boards

0
|
3178 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Replace "I" with "0"?

Posted 5 years ago

So I wanted to replace i with 0 in my equation (pls don't ask why). I tried several options but none of them gave the result I wanted. What should I do?showcase of the problem

POSTED BY: Daniel Voloshin
3 Replies

or use Re[] to get the real part of an expression.

POSTED BY: Neil Singer

Although you can do

Replace[I + 4, Complex[x_, 1] -> x]

and do what you want.

Regards,

Neil

POSTED BY: Neil Singer

You can check the full form of an expression

In[1]:= FullForm[4+I]
Out[1]//FullForm= Complex[4,1]

In[2]:= FullForm[x+I]
Out[2]//FullForm= Plus[4,x]

The first case is atomic thus no substitution happens.

POSTED BY: Shenghui Yang
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract