Consider the following information about metals: a) Create the following arrays:
ID: 3818775 • Letter: C
Question
Consider the following information about metals: 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. 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. b) Group the arrays you created in part (a) into a single cell array, named dataCellArray. c) Extract the following information from your cell array (i.e., form dataCellArray. Find the name, atomic weight, and crystal structure of the fourth element in dataCellArray. Find the average atomic weight of all the elements in daiaCellArray. Store the information presented in Problem 4 into a structure array. Name your structure array dataStructArray. Use your structure array to determine a) the maximum density. b) the element with the maximum density. e) the element with the maximum atomic weight. Write a script to ask and let the user to enter additional information into your dataStructArray created in Problem 5. Use your script to add the followingExplanation / Answer
Metals = {'Aluminium' , 'Copper' , 'Iron' , 'Molybdenum' , 'Cobolt' , 'vanadium' };
Symbols = {'Al' , 'Cu' , 'Fe' , 'Mo', 'Co', 'V'};
AtomicNumber = int8([13,29,26,42,27,23]);
AtomicWeight = [ 26.98 , 63.55 ,55.85 , 95.94 , 58.93 , 50.94 ];
Density = [2.71 , 8.94 , 7.87 , 10.22 ,8.9 ,6.0];
CrystalStructure = char('FCC ' ,'FCC ','BCC' ,'BCC','HCP','BCC');
dataCellArray = { Metals ; Symbols ;AtomicNumber; AtomicWeight; Density; CrystalStructure };
%Each cell has a different data type so the way to access specific element varies.
Name = dataCellArray{1}{4};
Weight = dataCellArray{3}(4);
%Char array break down the structure into a 2D array.To piece it together strcat() is used.
Structure = strcat( dataCellArray{6}(4) , dataCellArray{6}(8), dataCellArray{6}(12));
%mean is an inbuilt function to calculate mean of an array.
Average = mean(dataCellArray{3});
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.