Compile a simple function
Show older comments
Hi everyone, I'm a very young user of Matlab and completely new to the programming world. I'm trying to do a simple matlab program that ables me to calculate a simple Mathematical equation ( Newton's Law F=m.a).
I've done this simple code:
function F = Newton(m, a)
F=m*a
end
So, if I in Matlab type:
x=Newton(2,2) I get the result correctly.
So I tried to compile this simple .m file with the help of deploytool. But when I finish to create the .exe file, when I click on it nothing happens.
And, if I go to that .exe file through DOS line command, I can see that the error I get is:
Error using newton (line2) Not enough input arguments. MATLAB:minrhs
So, I need your help. I'm very new to this so I'm sorry if it is a stupid question.
Thanks to all that will try to help me
Regards
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!