How to set up trial and error while taking corresponding values in given tables

1 visualizzazione (ultimi 30 giorni)
To simplfy the project I'm working on, I have 10 values that I used linspace to come up with. I also have two tables and two constant values(P1 and R) I was given. Let's say table dog and table cat. For each of the 10 values I need to set up trial and error. So say for the first linspace value I take an area(A1) from table dog and its corresponding Mach number(M1). I go to table cat for that value of M1 and find corresponding M2 and P2. I go back to table dog for value of M2 and find corresponding A2. I then multiply R*(1/A1)*(A2) = A3. I go to table dog for that value of A3 to find P3. I then multiply (1/P3)*(P2)*(P1)= P . If P does not equal the value that I started with from linspace then I move onto the next value of A1 from table dog until it is equal. I need to set up this trial and error so by the end I can graph the linspace values vs A3 values.
  1 Commento
Amethyst McLaughlin
Amethyst McLaughlin il 1 Mag 2022
A1,A2,and A3 would all be in the same column of table dog. M1 and M2 are in the same column of table dog. P2 and P3 are in the same column of table dog. I should also mention that while jumping back and forth between tables and calculations, that the exact values won't be listed in the table. I'll have to use whatever value is closest.

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by