필터 지우기
필터 지우기

Create a for loop for a function

조회 수: 1 (최근 30일)
Yunus Tunc
Yunus Tunc 2016년 10월 4일
답변: Yunus Tunc 2016년 10월 4일
I want to create a function for volume of the cylinder but it always says 'Undefined function'
function Volume(pi,r)
for r=1:N
A=r^2*pi;
disp([num2str(pi) '*' num2str(r^2) '=' num2str(A)])
end
volume(pi,4)

답변 (2개)

Joe Yeh
Joe Yeh 2016년 10월 4일
MATLAB is case sensitive. Your function call should match exactly your function definition.

Yunus Tunc
Yunus Tunc 2016년 10월 4일
That's why I want to see what wrongs I have

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by