In Maple how does one prompt a user to input an equation with variable x? Then convert that equation into a data type that will enable me to perform functions on said equation?
Asked
Active
Viewed 187 times
1 Answers
1
One way to do this is to use the readstat command, which prompts the user to enter a Maple statement whose value is returned. For example:
Test := proc()
local p, x;
x := readstat( "Enter Variable: " );
p := readstat( "Enter Polynomial: " );
diff( p, x )
end proc:
Then you can do:
> Test();
Enter Variable: x;
Enter Polynomial: x^2 - a*x + 2;
-a + 2 x
>
James
- 9,272