Need help Matlab script Question
Show older comments
Hi, I am trying to make scripts that follow this table :
Could you choose one of them and help me finding how can i manage the differents input to make changes that are automatically saved in the .mat file
Script Name
General Algorithm
AddNewEmployee
- Display all of the ID numbers currently in use
- Read in a new ID number
- If the ID number read in is already in use
- Report this fact
- End this script
- Else (this is a new ID number)
- Read in:
- Years with the company
- Salary
- Vacation days
- Sick days
- Add this new employee to the database (by appending a new row to the end of the EmployeeData matrix)Note that this command should alter, not only the EmployeeData matrix, but also the EmployeeData.mat file (i.e. it should automatically save to the MAT-file)
DeleteEmployee
- Display all of the ID numbers currently in use
- Read in an ID number
- If the ID number exists, delete that employeeNote that this command should alter, not only the EmployeeData matrix, but also the EmployeeData.mat file (i.e. it should automatically save to the MAT-file)
- Else tell the user that that employee ID does not exist
PrintEmployees
- Print out a table showing all of the current employees and all of their respective data
ShowEmployeeDataStatistics
- Print out statistics about the current employees including:
- The number of employees
- The average, minimum, and maximum values of:
- Years at the company
- Salary
- Vacation days
- Sick days
FindMaxEmployee
- Find and report the employee ID with the maximum value of either:
- Years at the company
- Salary
- Vacation days
- Sick days
If more than one employee has that maximum value, show all of the ID numbers with that maximum
FindMinEmployee
- Find and report the employee ID with the minimum value of either:
- Years at the company
- Salary
- Vacation days
- Sick days
If more than one employee has that minimum value, show all of the ID numbers with that minimum
But i am having difficulties could you help me make at least one of them ?
I got this for the first one :

i also have a data table of employee :
See the link attached to it
Answers (0)
Categories
Find more on Database Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!