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

조회 수: 1 (최근 30일)
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
Amethyst McLaughlin
Amethyst McLaughlin 2022년 5월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by