First Examination - Computational Methods | AOE 2074, Exams of Aerospace Engineering

First Examination Material Type: Exam; Professor: Cliff; Class: Computational Methods; Subject: Aerospace and Ocean Engineerin; University: Virginia Polytechnic Institute And State University; Term: Fall 2000;

Typology: Exams

2019/2020

Uploaded on 11/25/2020

koofers-user-6yd-1
koofers-user-6yd-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AOE/ESM 2074
Introduction to Computational Methods
First Examination
26 September 2000
This is a closed-book, closed-notes examination. Be sure that your name is on this sheet
and all others that you turn in. Sign the question sheet to indicate that you have not
provided or received any unauthorized aid.
1. (15) Given a= [1 : 2 : 6] and b= [4 : 6] which of the following are well-defined ?
Where possible, describe the nature of the result.
i) c=ab
ii) c=ab
iii) c=a.b
2. (20) Provide one or more Matlab statements (i.e. a script) to generate plots of sin(t)
and cos(t) at 51 uniformly spaced points on the interval [0]. The lines should appear on
the same graph, with the sin as a red line and the cos as a blue line. Include a legend to
label the two lines.
3. (15) Given a=1234;3456;5678
evaluate the following (where
possible)
i) a(:,2:3)
ii) size(a(:))
iii) a(2,3:5)
If an expression results in an error, provide a brief explanation.
1
pf2

Partial preview of the text

Download First Examination - Computational Methods | AOE 2074 and more Exams Aerospace Engineering in PDF only on Docsity!

AOE/ESM 2074

Introduction to Computational Methods

First Examination

26 September 2000

This is a closed-book, closed-notes examination. Be sure that your name is on this sheet and all others that you turn in. Sign the question sheet to indicate that you have not provided or received any unauthorized aid.

  1. (15) Given a = [1 : 2 : 6] and b = [4 : 6] which of the following are well-defined? Where possible, describe the nature of the result.

i) c = a′^ ∗ b

ii) c = a ∗ b′

iii) c = a′. ∗ b

  1. (20) Provide one or more Matlab statements (i.e. a script) to generate plots of sin(t) and cos(t) at 51 uniformly spaced points on the interval [0, π]. The lines should appear on the same graph, with the sin as a red line and the cos as a blue line. Include a legend to label the two lines.
  2. (15) Given a =

[ 1 2 3 4; 3 4 5 6; 5 6 7 8

] evaluate the following (where

possible)

i) a(:, 2 : 3)

ii) size(a(:)′)

iii) a(2, 3 : 5)

If an expression results in an error, provide a brief explanation.

  1. (15) Using the array a described in Question 4 examine each of the following state- ments. If the expression is not legal indicate an error. If the expression is legal indicate its value.

i) a(:, 3) > a(3, 2 : 4)′

ii) a(3, 5) <= a(2, 3)

iii) a(:, 4) > a(3, 1)

  1. (15) Provide Matlab script to ask the user for a value of a positive integer n. Compute the sum of the first n integers and also their product (n! or n-factorial). Write the three values (n, the sum and the product) to the screen with a brief label for each.
  2. (20) Write a function .m file that will accept a real array x and return two numbers: the average and the value of the element on the array that is closest to the average. The first line of the function is function [ x avg, x cls] = avc(x)