1 Page

HW3ABC

Course: CS CS 1371, Fall 2008
School: Georgia Tech
Rating:
 
 
 
 
 

Document Preview

= clear clc A ones(1,5) B = 1:length(A) C = rand(1,1) * 10 if C < 4 D = 0 elseif C > 7 D = 1 else D = 2 end E 0 if = D == 0 for x = A(B); E = E + x; end elseif D == 1 while E < 10 E = E + 1; end else D == 2 E = 0; end

Register Now

Unformatted Document Excerpt

Coursehero >> Georgia >> Georgia Tech >> CS CS 1371

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
= clear clc A ones(1,5) B = 1:length(A) C = rand(1,1) * 10 if C < 4 D = 0 elseif C > 7 D = 1 else D = 2 end E 0 if = D == 0 for x = A(B); E = E + x; end elseif D == 1 while E < 10 E = E + 1; end else D == 2 E = 0; end
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Georgia Tech - CS - CS 1371
function [A B C D E] = ABCs_cell_arrays(C, ca1, ca2)% PROBLEM 3. The ABCs of Cell Arrays%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the first line of code)% a) Creating. Create a cell ar
Georgia Tech - CS - CS 1371
function [A B C D] = ABCs_conditionals(x, y, z)% PROBLEM 4. The ABCs of Conditionals%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the first line of code)% a) if statements. x is a number.
Georgia Tech - CS - CS 1371
function [A A_method B B_method C] = ABCs_iteration(x)% PROBLEM 5. The ABCs of Iteration%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the first line of code)% 1) for loops. Below are two fo
Georgia Tech - CS - CS 1371
function [A B C D E F G H I J] = ABCs_strings(ch1, str1, str2, str3, vec1, alph1, x, num1)% PROBLEM 2. The ABCs of Strings%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the first line of code)
Georgia Tech - CS - CS 1371
%PROBLEM 7%% Write a function named cellParse that takes in a cell array with each% element being either a string (character array), or a vector% (containing numbers), or a boolean value (logical array of length 1).% Your function should
Georgia Tech - CS - CS 1371
%PROBLEM 6%function output = cellUnwrap(A)while iscell(A{1}) = true A = A{1};endoutput = Aend
Georgia Tech - CS - CS 1371
function result = myStrCmpI(x, y) if (length(x) ~= length(y) result = false; return; enddiff = 'a' - 'A';i=1; while (i &lt;= length(x) &amp; (x(i) = y(i) | . (isletter(x(i) &amp; isletter(y(i) &amp; abs(x(i) - y(i) = diff)
Georgia Tech - CS - CS 1371
%PROBLEM 4%%% Write a function named myStrFindI that takes in two strings. Your% function should return a vector containing the starting index of all% the occurences of the first string within the second string. Your% function should
Georgia Tech - CS - CS 1371
function mySum = mySum(A)% computes the sum of the elements in the given vectormySum = 0;index = 1;while index &lt;= length(A) x = A(index); mySum = mySum + x; index = index + 1;endend
Georgia Tech - CS - CS 1371
%PROBLEM 2%function output = removeSpaces(A)% takes in a string and outputs the same string but with all the space characters removedindex = 1;while index &lt;= length(A); if uint8(A(index) = 32; A(index) = []; end index = index
Georgia Tech - CS - CS 1371
%PROBLEM 5%% Write a function named slowSort that takes in a vector, sorts it in % ascending order (smallest to largest), and then outputs it.%% Note: you may *not* use the built-in sort function in MATLAB.% function output = slowSort(A)
Georgia Tech - CS - CS 1371
function [A B C D] = ABCs_structure_arrays(str1, str2, str3, sa1)% PROBLEM 2. The ABCs of Structure Arrays%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the first line of code)%% a) Creatin
Georgia Tech - CS - CS 1371
function [A B C D E F G H I J] = ABCs_structures(a_name, a_price, b_name, b_price, st1, st2, f1, var1)% PROBLEM 1. The ABCs of Structures%% This is a multi-part problem. Do each of the parts below.%% DO NOT CHANGE THE FUNCTION HEADER (the firs
Georgia Tech - CS - CS 1371
%=% Problem 3. Sorting Structures%-%% In homework 4, you implemented an algorithm to sort a vector.% You will now implement the same algorithm to sort a structure array based% on one of its fields. To do this, please complete parts A and B bel
Georgia Tech - CS - CS 1371
% Problem Statment:%% Write a function named structFromCell that takes in a cell array and% returns a structure constructed from the cell array. The elements in% the odd indexes of the cell array should determine the field name and% the
Georgia Tech - CS - CS 1371
%=% Problem 2. Searching through a structure array%-%% Problem Statment:%% Write a function named structSearch that takes in a structure array, a% fieldname, and a value. The function should return a new structure% array containing ever
Georgia Tech - CS - CS 1371
function S = structSort2(A,str)a = A;b = A;[r c] = size(A);vec = [];if r = 1 a = A; [v loc] = minStruct(a,str); vec = [vec v]; a(loc) = [];else for x = 1:r for y = 1:c [v loc] = minStruct(b,str);
Georgia Tech - CS - CS 1371
%=% Problem 3, part B. Sorting the structure array%-%% Problem Statment:%% Write a function named structSort that takes in a structure array and a% string. The string specifies the name of a field in the structure% array that will only
Georgia Tech - CS - CS 1371
function [A B C D_rows D_cols E F G H I J] = ABCs_arrays(num1, arr1, arr2, i, j, arr3, arr4, arr5, vec1)% PROBLEM 3. THe ABCs of Arrays% This is a multi-part problem. Do each of the parts below.% % DO NOT CHANGE THE FUNCTION HEADER (the first lin
Georgia Tech - CS - CS 1371
function genStats(excel)[num str cell]= xlsread(excel);[row col]=size(cell);avg=mean(num,2);for x=2:row cell{x,col+1}=avg(x-1);endtotavg=mean(num);for y=2:col cell{row+1,y}=totavg(y-1);endcell{end,end}=mean(totavg);cell{1,end}='Aver
Georgia Tech - CS - CS 1371
%Write a function called myCSVread which takes in a filename and returns a%cell array containing the doubles and chars from the file. Each value%will be seperated by commas. This function should work as the reverse of%myCSVwrite.%Hint: str2num
Georgia Tech - CS - CS 1371
%Write a function called myCSVwrite which takes in a cell array of doubles%and chars and a filename, returns nothing but writes a file with each of the cells'%contents seperated by commas. The cell array may be two dimensional, you%should put eac
Georgia Tech - CS - CS 1371
% Write a function called snake that takes in an array and a number% indicating how many places to &quot;snake&quot; the array as described below.% Snaking the vector involves shifting the numbers down columns, and % appending the overflow onto the top of
Georgia Tech - CS - CS 1371
function numwords=wordCount(string)fh=fopen(string,'r');words=';count=1;while ischar(words); words=fgets(fh); [tk rest]= strtok(words); while ~isempty(rest) [tk rest]= strtok(rest); count=count+1; endend numwo
Georgia Tech - CS - CS 1371
%=% Problem 5. Plotting Simple Shapes%-%% Problem Statement:%% Write a function called plotPolygon that will take in two vectors of the same% length and have no outputs. The first vector will contain the x values for the% polygon and t
Georgia Tech - CS - CS 1371
%=% Problem 7. Plotting Pretty Colors%-%% Problem Statment:%% Write a function named plotRainbow that takes in the radius, and an% increment value. Starting at the initial radius, plot 6 semicircles to% create a rainbow. The order of
Georgia Tech - CS - CS 1371
%=% Problem 1. Signal Processing%-% After graduating from Georgia Tech with a 4.0 GPA, you easily get a job% with SETI (search for extra terrestrial intelligence)% as an extra-terrestrial signal analyst. One day, while you are% working on the
Georgia Tech - CS - CS 1371
%=% Problem 2. Finding the determinant of a matrix using recursion%-% % Problem Statement:%% Write a function called recurDet which takes in a square matrix and % returns the determinant of that matrix using recursion.%% Hint: Use
Georgia Tech - CS - CS 1371
%=% Problem 4. Recursive Math%-%% Problem Statement%% Write a function named recMod that takes in 2 numbers and% returns the remainder of the first number divided by the second number.% This function should use recursion to produce th
Georgia Tech - CS - CS 1371
%=% Problem 1. Finding the sum of a vector with recursion%-%% Problem Statement:%% Write a function called recurSum which takes in a vector and returns% the sum of that vector using recursion.% % Notes: % -You *must* use rec
Georgia Tech - CS - CS 1371
%=% Problem 6. Plotting a Slinky%-%% Problem Statment:%% Write a function named slinky which takes in a number r, which is the % number of revolutions, and a number n, which is the number of points.% Your function should then plot a 3D
Georgia Tech - CS - CS 1371
%=% Problem 3. Arrays and Recursion%-%% Problem Statment:%% Write a recursive function named sumRings that consumes an M by N array% and returns a vector of the sums of its rings of elements. Consider:% [1 1 1 1 1 1 1% 1 2
Georgia Tech - CS - CS 1371
%=% Problem 8. Designing a Tunnel.%-%% Create a recursive function, tunnel.m, that will take in three inputs: a% radius (r), and two scalars, x and y. Plot a circle using the% coordinates (x,y) as the center and the radius (r) as your radius. C
Agnes Scott College - MGMT - 303
Besanko &amp; Braeutigam Microeconomics, 3rd editionSolutions ManualChapter 2 Supply and Demand AnalysisSolutions to Review Questions1. Excess demand occurs when price falls below the equilibrium price. In this situation, consumers are demanding a
Agnes Scott College - MGMT - 303
Agnes Scott College - MGMT - 303
Agnes Scott College - MGMT - 303
1. 2. 3.4. 5.6.7.8.9.Ch. V What is the cost-minimizing level of output? a. Given a desired level of o/p, isoquants and isocosts provide information to determine o/p level. Cost min level of inputs/ a. Determined by point at which ratio of
Agnes Scott College - MGMT - 303
ACCT 245 BronsteinExercise 3-13b a. Contribution margin per unit = $25 - $7 = $19 Break-even point in units = $81,000 19 = 4500 Break-even point in dollars = $25 x 4500 = $ 112500 (Fixed cost + Desired profit) Contribution margin per unit = ($81,
Agnes Scott College - MGMT - 303
Sales Rev. COGS_ Gross Margin Gen. Sales &amp; Admin Net Income Calculating % Change: (Alt. Measure Base Measure)/ Base Meas Assets = Equity Cash+Inv.+Manf.Eq+Off. Furn= Common Stock + Retained Earn Inc Stmnt Contr. Margin fmt: Var Cost pe
Agnes Scott College - MGMT - 303
Acct245 Bronstein 10amProblem 6-19B a. Overhead Cost Allocation Under ABCTotal $934,000Mat. Hndlng Mach. Set. Product Facility Cost pool $366,000 $180,000 $28,000 $360,000 Cost drivers # of parts # Setups # units test Mach. Hrs. 1,220,000 90 1,4
Agnes Scott College - MGMT - 303
3212 E Morley Way Seattle, WA 98112425.208.5617 Erich.B.Anderson@gmail.comErich AndersonObjectiveTo obtain a fulfilling job that gives me the opportunity to interact daily with clients as well as represent the highest level of service that cli
Agnes Scott College - MGMT - 303
How Good Am I at Building and Leading a Team?InstrumentUse the following rating scale to respond to the 18 questions on building and leading an effective team: 1 = Strongly disagree 2 = Disagree 3 = Slightly disagree 4 = Slightly agree 5 = Agree 6
Agnes Scott College - MGMT - 303
GROUP COMPOSITION REPORT and CONTRACT The rules of the exercise:1. 2.No one may talk until all group members have finished reading The Rules of the Exercise. Once everyone on your group is finished reading the rules, your group should elect (or on
Agnes Scott College - MGMT - 303
CH X 1. Price: a. The amount of money charged for a product or service, or the sum of the values that a consumer exchanges for the benefits of having or using the product or service. b. Non-Price factors have become more important recently. c. Dynami
Agnes Scott College - MGMT - 303
ACCT 245 BronsteinExercise 9-8B Operating income Operating assets = ROI Operating income $2,500,000 = 10% Operating income = Operating assets x ROI Operating income = $2,500,000 x 10% = $250,000 Operating income = Sales Expenses = $5,000,000 Ex
Agnes Scott College - MGMT - 303
Lab Section Monday .Case Worksheet #1: Motivation and Incentive SystemsThis case worksheet is worth a total of 50 points and counts as 5% of your final course grade. It pertains to two readings: &quot;The Art of Motivation&quot; and &quot;The Best Laid Incen
Agnes Scott College - MGMT - 303
Math 102 HomeworkMath 112 Homework Fall 2007 HW # 1 Due Monday, October 1Read 1.1, 1.2, 1.3, 1.4Recommended: 1.1 # 1-3, 7-9, 11, 13-18, 21, 24-27, 29, 32-33 1.2 # 3, 11, 14, 16-25, 27-29, 31-32, 36-38, 41-42, 47, 50-56, 61-63, 75-76Required: 1.
Agnes Scott College - MGMT - 303
Issue Is it within Washington's jurisdiction to require International Shoe Company, a foreign-based corporation, to pay unemployment compensation statutory of employees in Washington? Rule A company is within the jurisdiction of a state if it does bu
Agnes Scott College - MGMT - 303
Greetings class, Wed, you are to do a paper that reflects on the transaction you have chosen to study. You did the paper on the categories. Now, look at your transaction thru the lense of what it takes to make a Legally Enforceable Contract. So far,
Agnes Scott College - MGMT - 303
Note: This nutrition debate is in chapter 16 on pages 610-11. Considering the potential benefits of calorie restriction, do you think it is worth following this type of diet? Remember you must discuss this issue fully, and provide authoritative facts
Agnes Scott College - MGMT - 303
Many stressed out people today have been told to take a 50 B Complex supplement (contains 50 mg of Vitamins B1, B2, B3, B6). Based on what you read, give the pros and cons of this recommendation. Your answer must cover a significant amount of the mat
Agnes Scott College - MGMT - 303
NEGOTIABLE INSTRUMENTS A negotiable instrument is a (1) written instrument, (2) signed by the maker or drawer of the instrument, (3) that contains an unconditional promise or order to pay (4) a fixed amount of money (with or without interest in a sp
Agnes Scott College - MGMT - 303
1.Week 1 Discussion Questions Chapter 1 A great manager must have good planning, organizing, leading, and controlling abilities. They must be motivated and be able to motivate others. A good manager also rethinks their approach to accommodate chang
Agnes Scott College - MGMT - 303
1/5/2007 PE 1DLPE 108/208-Independent FitnessFITNESS PLAN WORKSHEET1.What physical activities are you currently doing for the following (specify activity, frequency, intensity, time and how long you've been working out)? a. Flexibility Trainin
Agnes Scott College - MGMT - 303
Name: Credits: 1 Week 4 Goal: Increase amount of Cardio by 20 min. Target Heart Rate Zone: 180 85%Exercise Heart Rate or RPE Exercise TimeDay SunDate 1/21ActivityWarm-up/ cool-down CV Strength FlexCommentsQuick workout today.Treadmill La
Agnes Scott College - MGMT - 303
CHAPTER 1 OUTLINEI. A. MANAGING IN THE NEW ERA The Internet1. 2.The Internet changes the way management thinks and acts. In the future, one of the most important jobs in your company will be that of chief Web officers. a. The chief Web officer w
Agnes Scott College - MGMT - 303
Course Documents LECTURETTE 1.1 &quot;AN ANALYSIS OF UNITED STATES VS. JAPANESE MANAGEMENT&quot; Research conducted in comparing American style management vs. the Japanese style of management are clearly distinct from one another. As an example the cofounder
Agnes Scott College - MGMT - 303
Sam NiskanenEthics Case The ethics case I chose to write about is about the chief executive at Boeing quitting due to criticism. Phillip M. Condit resigned December 1, 2003. The Boeing Company has had its reputation tarnished by charges of ethical
Agnes Scott College - MGMT - 303
P. 218 Discussion Questions 1. The world economy is becoming more integrated, because more and more corporations are crossing over to other nations due to lowered barriers on free trade. Many of them, such as Nike, are employing citizens of other cou
Agnes Scott College - MGMT - 303
I chose to write about the founder of Taco Bell, Glen Bell. Not many know or even care about Glenn Bell, but he was a successful entrepreneur. Taco Bell is a successful fastfood chain, taking in over $1.8 billion in 2005 (Wikipedia). Bell was born in
Agnes Scott College - MGMT - 303
1.Citigroup has been in a number of different scandals. A notable one is the accusation that Citi was helping Enron hide their losses by loaning money in such a way that it would not appear on the balance sheet. They settled a classaction lawsuit o