How do I Create a function named “evennum” that returns 2 if its argument is even, and 1 if its argument is odd, using either the built in mod or floor functions on MATLAB?
1 次查看(过去 30 天)
显示 更早的评论
I am totally new to MATLAB and am unsure of how to tackle this problem. Any suggestions?
1 个评论
Geoff Hayes
2020-6-4
Victoria - see Declare function name, inputs, and outputs for details on how to create a function. Also, see Start learning MATLAB and Simulink with free tutorials.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!