完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
老师给留的作业 用matlab操作 新手什么都不会啊!!!求指导
请问这个程序该怎样写!!!真心求教 Water tank example: r = input('Enter the radius of the tank base (in meters):'); if ( r <= 0 ), error( ‘Radius must be positive' ); end h = input('Enter the height of the tank (in meters):'); if ( h <= 0 ), error( ‘Height must be positive' ); end w = input('Enter the amount of water (in m3):'); if ( w <= 0 ), error( ‘Amount of water must be positive' ); endcapacity = pi * r^2 * h; space = capacity - w; if ( space > 0 ), disp( [ 'There is ' num2str(space) ' m3 extra space' ] ); else disp( 'Tank is full' ); end |
|
相关推荐
|
|
这个程序有些小问题,修改后,基本上是可以运行的.
r = input('Enter the radius of the tank base (in meters):'); if ( r <= 0 ), error('Radius must be positive' ); end h = input('Enter the height of the tank (in meters):'); if ( h <= 0 ), error('Height must be positive' ); end w = input('Enter the amount of water (in m3):'); if ( w <= 0 ) error('Amount of water must be positive' ); end capacity = pi * r^2 * h; space = capacity - w; if ( space > 0 ), disp( [ 'There is ' num2str(space) ' m3 extra space' ] ); else disp( 'Tank is full' ); end |
|
|
|
|
|
1533 浏览 1 评论
200圆!求助大佬给一份VSG并网和离网模式的simulink仿真
1817 浏览 0 评论
MATLAB(3)--矩阵的引用(sub2ind、ind2sub、reshape函数使用)
2634 浏览 0 评论
2970 浏览 0 评论
4094 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 13:20 , Processed in 0.424448 second(s), Total 48, Slave 38 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号