In matlab how do I Prompt the user to select a material from the Material string array. If user exits out of the menu, keep asking the user for a selection until one is made. You will use this selection to determine the Young's modulus value from the Elasticity vector. Each material has a corresponding Young's modulus [Pa].
material=["Rubber","Wood (along grain)","Aluminum","Titanium","Graphene","Steel","Cobalt-Chrome"]
%you can ask user to enter a number corresponding to the
material
material=["Rubber","Wood (along
grain)","Aluminum","Titanium","Graphene","Steel","Cobalt-Chrome"];
menu=sprintf('%s:
%s\n',[string(1:length(material));material]);
fprintf(menu)
num = input('Enter a material: ');
while num<1 || num>length(material)
fprintf(menu)
num = input('Enter a material: ');%keep asking untill the correct
choice is made
end
%in this way you can have the required index for young's modulus
vector as
%well

In matlab how do I Prompt the user to select a material from the Material string...