MATLAB CODE Atomic Atomic Density,Crystal Symbol Number Weight g/em3 Structure M
ID: 3706120 • Letter: M
Question
MATLAB CODE
Atomic Atomic Density,Crystal Symbol Number Weight g/em3 Structure Metal AluminumCu26 9594 89 BCC Al 13 29 26.982.71 63.558.94FCC 55.857.87BCC 95.9410.22 BCC 58.938.9 50.94 FCC Copper Molybdenum Mo Vanadium on Fe 42 27 23 Co HCP 6.0 a) Create the following arrays: Store the name of all metals into a cell array. Store the symbol for all these metals into a cell array Store the atomic number into an int8 integer array. . Hint: get help and use the int8 () command) . Store the atomic weight into a numeric array . Store the density into a numeric array . Store the crystal structure into a single padded character array. (Hint: get help and use the char ) command) b) Group the arrays you created in part (a) into a single cell array, named dataCellArray.Explanation / Answer
MATLAB Code
Answer a:
% Storing the name of all metals into a cell array
Name = {'Aluminum', 'Copper', 'Iron', 'Molybdenum', 'Cobalt', 'Vanadium'}
% Storing the symbol for all these metals into a cell array
Symbol = {'Al','Cu','Fe','Mo','Co','V'}
% Storing the atomic number into an int8 integer array.
AtomicNumber = [13,29,26,42,27,23]
AtomicNumber = int8(AtomicNumber)
% Storing the atomic weight into a numeric array
AtomicWeight = [26.98,63.55,55.85,95.94,58.93,50.94]
% Storing the density into a numeric array
Density = [2.71,8.94,7.87,10.22,8.9,6.0]
% Storing the crystal structure into a single padded character array.
CrystalStructure = {'FCC','FCC','BCC','BCC','HCP','BCC'}
CrystalStructure = char(CrystalStructure)
Answer b:
% Grouping the above arrays into a single cell array, named dataCellArray
dataCellArray = {Name;Symbol;AtomicNumber;AtomicWeight;Density;CrystalStructure}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.