Can I match data from several find functions?
Show older comments
I am working on a Matlab class project. In this project I made a data file with 20 materials and 5 of their material properties and wanted to allow a user to enter values needed for the 5 properties and have the program tell them what material qualifies. I decided to use 5 find functions to find out which rows (each row is a different material) qualify for each property but I am unsure how to make it find the rows that surpass all the properties since the resulting vectors from the find functions are different sizes.
% Have user enter properties
Mod=input('Enter the minimum Young''s Modulus: ');
TS=input('Enter the minimum Tensile Strength: ');
YS=input('Enter the minimum Yield Strength: ');
Den=input('Enter the maximum Density: ');
HC=input('Enter the minimum Heat Capacity: ');
% Run find statement
ModMat=find(Modulus>=Mod);
TSMat=find(TensileStrength>=TS);
YSMat=find(YieldStrength>=YS);
DenMat=find(Density<=Den);
HCMat=find(HeatCapacity>=HC);
% Show resulting row in material form
Material=find(ModMat==TSMat==YSMat==DenMat==HCMat)
Accepted Answer
More Answers (0)
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!