Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.1K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Substitute function

Posted 10 years ago

Hey, everyone. How can i substitute a function, e.g. Cos[x] to an expression like Cos(x) I tried it with the replacement rule:

 Cos[a_] -> StringJoin["cos(", ToString[a, ")"]

Unfortunately than a is a string and i want it to stay a symbol. Thanks for you help!

POSTED BY: Jan Dentler
2 Replies

Have you tried TraditionalForm[Cos[a]]? You had better write your input in StandardForm as Cos[a], but then you can convert the input cell to TraditionalForm.

POSTED BY: Gianluca Gorni

I'm not sure I understand what you are trying to do. Are you looking to change the syntax of the programming language so that you can type cos(...) instead of Cos[...]?

I strongly recommend you don't do this.

You can usually create stuff like this using the Notations package. More information about that package is available in the documentation.

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