- 26
- 0
- 约1.25万字
- 约 68页
- 2017-02-16 发布于湖北
- 举报
* Application of Matlab Language * 例 某商场对顾客所购买的商品实行打折销售,标准如下: price200 没有折扣 200=price500 3%折扣 500=price1000 5%折扣 1000=price2500 8%折扣 2500=price5000 10%折扣 5000=price 14%折扣 输入所售商品的价格,求其实际销售价格。 选择结构 * Application of Matlab Language * price = input(‘请输入商品价格’); switch fix(price/100) case{0,1} %价格小于200 rate = 0; case{2,3,4} rate = 3/100; %价格大于等于200但小于500 case num2cell(5:9) rate = 5/100; %价格大于等于500但小于1000 case num2cell(10:24) rate = 8/100; %价
原创力文档

文档评论(0)