How to call built in MuPAD functions from MATLAB command window

In summary, to use the ellipticF function in MATLAB, you can open the MuPAD Notebook Interface and use the command "F(0.0796)" or use the mupad function with the syntax "[F] = mupad('F', 0.0796)".
  • #1
CraigH
222
1
Is anyone here any good with MATLAB? I could do with some help.

I want to use the ellipticF function as shown http://www.mathworks.co.uk/help/symbolic/mupad_ref/ellipticf.html. I just want to put in a number and it return another number (the answer).

I want it to work like the ellipke function:

[K,E]=ellipke(0.0796)

K =

1.6035


E =

1.5391

But the ellipticF isn't working like this.

It says I have to use the MuPAD Notebook Interface, but I don't know what this means. Apparently it is possible to call MuPad functions using the MATLAB command window, but I can't get it work.

If anyone here is good with MATLAB could you please post what I have to type into get this function to work?

Thank you!
 
Physics news on Phys.org
  • #2
You can use the MuPAD Notebook Interface by typing "open_mupad" into the MATLAB command window. This will open the MuPAD Notebook, which is a graphical interface for MuPAD commands. You can then type in the ellipticF function you want to use and it will return the answer. For example, if you wanted to calculate ellipticF(0.0796), you would type in the following: F(0.0796) If you want to use the same syntax as the ellipke function, you can use the following command: [F] = mupad('F', 0.0796)
 

1. What is the syntax for calling a built-in MuPAD function from the MATLAB command window?

The syntax for calling a built-in MuPAD function from the MATLAB command window is: mupad('function_name', argument1, argument2, ...). This will execute the function and return the result to MATLAB.

2. Can I use variables from my MATLAB workspace as arguments for a MuPAD function?

Yes, you can use variables from your MATLAB workspace as arguments for a MuPAD function by passing them as strings in the mupad() command. For example, mupad('diff(sin(x), x)') will use the value of the variable x from your MATLAB workspace.

3. How can I see the output of a MuPAD function in the MATLAB command window?

The output of a MuPAD function can be seen in the MATLAB command window by using the sym() function. This will convert the output into a MATLAB symbolic expression that can be displayed in the command window.

4. Is it possible to call multiple MuPAD functions in one line from the MATLAB command window?

Yes, it is possible to call multiple MuPAD functions in one line from the MATLAB command window by separating each function call with a semicolon. For example, mupad('solve(x^2 + 2*x + 1 = 0); int(sin(x), x)') will execute both the solve() and int() functions.

5. Can I modify the default display format of MuPAD functions called from the MATLAB command window?

Yes, you can modify the default display format of MuPAD functions called from the MATLAB command window by using the digits() function. This will change the number of digits displayed in the output of MuPAD functions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
14K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
Back
Top