- Item onehttps://uk.mathworks.com/help/matlab/matlab_prog/create-functions-in-files.html
- Your input is the radius
- The output is the area
- And the body of the function is the circle area formula: https://www.mathsisfun.com/geometry/circle-area.html
please ,I need to create function calculate the area of three different circles radius? any one can solve this issue is highly appreciated.
1 次查看(过去 30 天)
显示 更早的评论
i tried this function but its not work. unction [area] = CircleArea(radius) rad1=('8'); area1 = CircleArea(rad1); area = pi * radius^2; disp(['Area of Circle1 = ' num2str(area1)]) end
0 个评论
回答(1 个)
Pawel Jastrzebski
2018-3-23
Literally, have a look at how to define functions in Matlab - this page has many simple examples to follow:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computational Geometry 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!