Cells and Structure Probs

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online