如何用MATLAB编写这个程序?

img

你好,代码供参考

price = input('输入价格:');
[~,~,c] = histcounts(price, [0, 200, 1000, 5000, inf]);
switch c
case 1
price = price*1;
case 2
price = price*0.95;
case 3
price = price*0.9;
case 4
price = 0.85*price;
end
fprintf('实际销售价格:%f\n', price);

有帮助望采纳哟