data set for this question has both a stress data set vector
data set for this question has both a stress data set (vector) and and strain data set (vector), I have done Part A and am able to get the maximum stress but whenever I try to find corresponding strain value using the find() function, I only get the index (the 7xxth value of the strain data set) below is the code MY question is what code is used to bring out the value for the 7xxth value in the strain data set.
help with the other questions would be useful too
Solution
Dear Asker,
You need to replace following line:
strain = find(stress==current_max);
with below line:
strain_at_max_stress = strain(find(stress==current_max));
Note : [ I am assuming there is a vector named \'strain\' with strain values]
How it works? \'find()\' function always returns the index of searched value in the vector/array, in this case the vector is stress and searched value is current_max, in order to get corresponding value of strain, we need to supply the returned index from find() to vector strain.
When displaying correspnding strain use strain_at_max_stress variable as following
disp([\'max strain\' num2strstrain_at_max_stress )]);
