可视化计算离线作业(9)
时间:2025-04-21
时间:2025-04-21
many large enterprises from the dozens of personal development to enterprise employees also have had hundreds of thousands, even tens of thousands of people. Predictably, the pure by manpower to calculate each monthly net salary is not realistic. Recent learning Matlab, found that it not only can write some simple program, can put a lot more people present in the form of image data, for the enterprise management with the help of the statistical work and wages are huge. Because learning time is not long, so I am to learn knowledge, based on reference to some other books, a collection of books on the design experience of others, oneself write a small program, can quickly calculate the one real wages each month. 英文关键词:mage statistics wages
1.引言
Matlab是一套高性能的数值计算和可视化的工具软件。也是一套十分强大的计算机科学计算、可视化辅助设计和可视化的教学软件。它的应用十分的广泛,包括科学计算、信号和图像处理、通讯、控制系统计算、测试和测量、财务建模和分析,以及计算生物学等众多科学领域。
日常,我们计算一些数据量小,数据个数不多的文件,可能人工计算也能很快的得出结果,但是在大数据面前,如:每个月的工资统计。钥匙还是使用人力计算,就需要大量的人和时间,还存在着一定的错误率,这明显是十分没有效率的;但是用Matlab设计一个简单的程序,就能解决所有的问题,更能使正确率达到100%。
由简至繁,我们还可以根据我们不同的需求来制定不同的程序,而要做的也仅仅只是改动一下代码,这样既灵活多变,也能解决许多日常工作中繁琐的问题。
2.算法基础
条件语句if else;elseif
例:某IT公司员工的工资计算方法如下:
(1)工作时数超过170小时者,超过部分加发15%。
(2)工作时数低于150小时者,扣发700元。
(3)其余按每小时50元计发。
按输入的工号和该号员工的工时数,计算应发工资。
3.程序代码
clear;
num=input('请输入工号:');
time=input('请输入工时数:');
if time<150
salary=time*50-700;
elseif time>170
salary=84*170+(time-120)*84*(1+0.15);
else
salary=time*50;
end
salary