Solve function that calculates UTS and stores in Matrix

Most metals weaken as temperature increases. For many metals, its Ultimate Tensile Strength (UTS) is defined by the following equation, where T is the current temperature and the Exponent is specific to the metal:
UTS = 1.0 - (T/1000)^(exponent)
For example, a common type of Stainless Steel has an Exponent value of 2.0. For the temperature values [0, 100, 200, 300, 400, 500], the UTS of this type of stainless steel is [1.0, 0.99, 0.96, 0.91, 0.84, 0.75]. That means, for example, that at 500 degrees C, this type of stainless steel retains 75% of its original strength.
Write a function that takes 2 vectors, T and E --- temperatures and exponents --- and returns a matrix of UTS values for each combination of temperature and exponent. Example: suppose T = [0, 200, 400] and E = [2.0, 3.0], then the function returns
1.0, 1.0
0.96, 0.992
0.84, 0.936
The rows denote each temperature [0, 200, 400] and the columns denote each exponent [2.0, 3.0]. [ Hint: you may need a loop to build the resulting matrix, either row by row or column by column. ]
Solve the function below:
function M = UTS(T, E)
M = ???
end

Answers (1)

Nimmy - rather than posting your homework assignment verbatim, why not make an attempt at solving the problem? You are told exactly how to calculate the UTS as
UTS = 1.0 - (T/1000)^(E);
So try to do the same with the inputs, realizing that both T and E are vectors and, as suggested in the assignment, that you may need to use a for loop.

This question is closed.

Asked:

on 21 Nov 2015

Closed:

on 22 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!