i have two tables, 1table is for power and other one is for area, if do have data in table 1

i have two tables, 1table is for power and other one is for area, if I do have data in table 1 how would i know the equivalent value on that number to table 2? table 1 ranges 700-800 and table2 ranges 100-300..
TABLE same as here
POWER(700-800) AREA(100-300)
800 300
799 299
798 298
... ....
... ...
down to 1 down to 1

 채택된 답변

You could use one of Matlab's interpolation functions. Just ensure that your power and area tables are the same size. See:
doc interp1
Example:
mPower = [700 750 800];
mArea = [100 200 300];
mInputPower = 720;
outputArea = interp1(mPower, mArea, mInputPower);

댓글 수: 4

hmmm I am new at matlab a little bit confusing about the code... okay consider i have matlab calculator which computer power,area,etc... then i am solving for elevation(which ranges is from 700-800).. then capacity(ranges 100-300).. i wanted to know if i got result for elevation i want to know the equivalent value of that result in elevation to the capacity..
for example i got result EL = 760 what is the equivalent value of capactiy which ranges 100-300?
above code can do that? please answer.. thanks I appreciate your reply...
Yes, Chris's code does handle that, if you have appropriate mPower and mArea vectors, provided that capacity depends only on elevation.
i got a new problem now, if ever i get a decimal result like 701.2,703.2 or any decimal value? can interp handle that?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2011년 12월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by