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 visualizaciones (últimos 30 días)
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?

Respuestas (1)

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

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by