Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
help with area and volume cyclinder?
조회 수: 1 (최근 30일)
이전 댓글 표시
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)
댓글 수: 1
답변 (2개)
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.)
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!