defining a variable in matlab
显示 更早的评论
V = ((pi*h^2)/3)*((3*r)-h)
plot(h,V)
??? Undefined function or variable 'h'.
Error in ==> p5_22 at 6 V = ((pi*h^2)/3)*((3*r)-h)
I'm sure this is very simple but i forgot how to tell matlab that 'h' is a variable
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-9-10
h=0:0.1:10
r=5
V= (pi*h.^2/3).*(3*r-h)
plot(h,V)
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!