How to create a function that can work out an input provided the output and and all other variables are known?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
aman verma
el 21 de Jun. de 2022
Comentada: aman verma
el 22 de Jun. de 2022
I have a function with 6 variables in. 3 of which are fixed values, 2 of which are randomised in a certain domain and then the final variable is the one that needs to be worked out. L1,l1 and h1 are fixed. I want to randomise L2 and h2 and then try and find the corresponding value of l2. However, the value of l2 must make the function equal the function if L1,l1 and h1 were inputted with the already randomised L2 and h2.
To make it easier to describe, I will try and write it out mathematically.
f(L1,l1,h1) = f(random L2, ?l2?, random h2)
However, this needs to be done in one big function containing all the variables like:
f(L1,L2,l1,l2,h1,h2)
To be full, I wil include the values for each vairable.
L1 = 2e-3; l1 = 5e-3; h1 = 0.5e-3;
x = randi([0 10],1,1);
L2 = x.*1e-3;
y = randi([0 1],1,1)
h2 = y.*1e-3;
Again, im not sure if this is 100% clear as it is hard to put into words, if this needs re-explaining I can try and reword it. Thank you for your help in advance.
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Historical Contests 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!