Borrar filtros
Borrar filtros

Create a for loop for a function

1 visualización (últimos 30 días)
Yunus Tunc
Yunus Tunc el 4 de Oct. de 2016
Respondida: Yunus Tunc el 4 de Oct. de 2016
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)

Respuestas (2)

Joe Yeh
Joe Yeh el 4 de Oct. de 2016
MATLAB is case sensitive. Your function call should match exactly your function definition.

Yunus Tunc
Yunus Tunc el 4 de Oct. de 2016
That's why I want to see what wrongs I have

Categorías

Más información sobre Loops and Conditional Statements 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