フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

help with area and volume cyclinder?

1 回表示 (過去 30 日間)
Ruqayyah tahir
Ruqayyah tahir 2014 年 12 月 6 日
閉鎖済み: Oleg Komarov 2014 年 12 月 6 日
Write a function to compute the area and volume of a cylinder. The first line is function [area, volume] = cylinder(height, radius)
Perform the following tests in the Command window:
>> [a, v] = cylinder(1, 1)
>> cylinder(1, 1)

回答 (2 件)

Star Strider
Star Strider 2014 年 12 月 6 日
First, write down the formulae for the surface and volume of a cylinder, calculate their values from some data you’re given, then tell MATLAB to do exactly the same thing. Check your calculations with the values MATLAB produces to be sure you’ve told MATLAB how to do the calculations correctly.
See Function Basics for help with writing your function. (I would use anonymous functions — they’re easy for problems such as this — unless you’re supposed to use function files.)

Stalin Samuel
Stalin Samuel 2014 年 12 月 6 日
編集済み: Stalin Samuel 2014 年 12 月 6 日

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by