Cells and Structure Probs

# Cells and Structure Probs - PROB1 CELL ARRAY...

This preview shows pages 1–2. Sign up to view the full content.

PROB1 CELL ARRAY function [avg_sal, sal_pct_inc, ranked_by_sal] = Prob1CellArray(EmployeeData) % Purpose: % To compute % (1) the average salary of a set of employees % (2) each employee's average yearly increase in salary (%) % (3) the rank of a set of employees (ascending) by yearly increase % % Input: A cell array of employee data, in the following order: first name, % last name, city, salary (scalar), vector of salaries from past years with % the newest salary first. % % Outputs: % (1) average salary across set of employees % (2) structure array containing employees' names and their average yearly % increase in salary % (3) structure array containing employees' names and their average yearly % increase in salary, ranked in ascending order of salary increase total_sal = 0; sal_pct_inc = []; counter = 0; % Compute each employee's average yearly increase in salary for oneEmployee = EmployeeData' counter = counter+1; % Keep track of the total salary so that we can find the average later

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

Cells and Structure Probs - PROB1 CELL ARRAY...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online