Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab problem Aluminum alloys are made by adding other elements to aluminum to

ID: 672198 • Letter: M

Question

Matlab problem

Aluminum alloys are made by adding other elements to aluminum to improve its properties, such as hardness or tensile strength. The following table shows the composition of five commonly used alloys, which are known by their alloy numbers (2024, 6061, and so on) [Kutz, 1999] Composition of aluminum alloys 1.5 1.4 0.3 %Mn 0.6 %Mg %Si Alloy 2024 6061 7005 7075 3560 4.4 0.6 4.5 1.6 The cost of each element per unit amount is shown in the following table Material cost of each element per ton ($ x 10 Al 2.0 Mg 2.65 Mn 4.5 Si 3.2 Zn 2.1 7.1

Explanation / Answer

The MATLAB diary command is used to record an interactive session. To start recording type

where ``filename'' is the name of the file to which the diary command copies all of the commands enterred and all of the resulting output. To stop recording type

In other words a typical session would be

The result is a plain text file called ``myDiary'' in the current working directory. A diary file can be an easy way to create a script (or function) m-file. After you've recorded the diary you delete the MATLAB output, including any error messages and incorrect commands, and save the result as another file.