Selection of a variable from a resulting equation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
close all ; % i need to determine values of "ep" and "v" according to the value of fi
clc; % the "v" and "ep" variables need to be determined from the given table
format long
F= 161;
v1=0.27;
v2=0.27;
E1=210000;
E2=210000;
D1=40/2 ;
d=6/2 ;
r=6.16/2;
AB=(2*(1/d))+(1/D1)-(1/r);
k1=(1-v1^2)/E1;
k2=(1-v2^2)/E2;
E=(2*E1*E2)/(E1+E2);
fi=abs((1/D1)+(1/r))/AB % ---> result of the equation determines "ep" and "v" from the table
ep=5.22; %---> variable to be chosen from the table
v=0.352; %---> variable to be chosen from the table
a=1.4*ep*((F/(E*AB))^(1/3));
b=1.4*v*((F/(E*AB))^(1/3));
P=(3*F)/(2*pi*a*b)
% I want my code to be able to automaticly determine "ep" and "v" after i change my other variables, and move on with rest of the calculations,
% Please see the picture attached, Thank you in advance
0 comentarios
Respuestas (2)
Vilém Frynta
el 5 de Dic. de 2022
Hi, this could be done by using find() and indexing. If your table structure will always be the same (meaning that your first and fourth row will always be fi, and under that, there will be ep and v) you can use indexing to choose the variables.
Please let us know which variable type you are using. Are you loading your data as a cell / matrix / table / structure?
0 comentarios
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!