Create a script circle.m that will which receives diameter as an argument and returns two outputs area and circumference. your script should prompt to give diameter

5 次查看(过去 30 天)
function[circumference, area]=circleArea(diameter)
circumference=pi*diameter;
area=1/4*pi*diameter;
end
Not sure what to do from here. How do I prompt to put a diameter in a regular script?

回答(1 个)

Cris LaPierre
Cris LaPierre 2022-9-22
You are creating a function, while the instructions say to create a script.
You might be interesting in the input function.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by