how i can select an indice in vector and matrix
이전 댓글 표시
Hello guys i have a problem to select an indice in matlab for ex: i have this programme:
T=[0 10 20 30 40 50]; % température en°C
phi=[0 20 40 60 80 100]; % Humidité relative en %
Cs =
0.2685 0.3110 0.3501 0.3857 0.4192 0.4528
0.2691 0.3079 0.3449 0.3785 0.4093 0.4368
0.2690 0.3048 0.3394 0.3708 0.3991 0.4229
0.2688 0.3025 0.3345 0.3635 0.3893 0.4107
0.2692 0.3016 0.3313 0.3576 0.3806 0.3999
0.2709 0.3031 0.3309 0.3538 0.3738 0.3900
we can imagine this like that
0 10 20 30 40 50
0 0.2685 0.3110 0.3501 0.3857 0.4192 0.4528
20 0.2691 0.3079 0.3449 0.3785 0.4093 0.4368
40 0.2690 0.3048 0.3394 0.3708 0.3991 0.4229
60 0.2688 0.3025 0.3345 0.3635 0.3893 0.4107
80 0.2692 0.3016 0.3313 0.3576 0.3806 0.3999
100 0.2709 0.3031 0.3309 0.3538 0.3738 0.3900
so i want to when i input temperature and humidity the programme select the Cs's value
for ex: if i do that
tx=input('chose your température plz')
phix=input('chose your humidity plz')
and i chose tx=10 & phix=20 the result will be
Csx=0.3079
i hope i explained my problem and i'm waiting your answers
채택된 답변
추가 답변 (3개)
ilyas ilyas
2013년 4월 26일
편집: ilyas ilyas
2013년 5월 16일
0 개 추천
댓글 수: 3
Cedric
2013년 4월 27일
This is essentially what INTERP2 does in my comment above, so there is little interest in re-implementing it by yourself (unless it is for a homework and you have to implement it by yourself).
So try using INTERP2; look up for examples in the official documentation and/or online if you need more than my example.
ilyas ilyas
2013년 4월 27일
Cedric
2013년 4월 27일
At what point did you make the test and what/how did you compute.
The issue if you really want to implement your formula by hand is that you will have to manage quite a few special cases, which means that you will have to implement more code that just the formula that you have above.
ilyas ilyas
2013년 4월 27일
편집: ilyas ilyas
2013년 5월 16일
0 개 추천
댓글 수: 1
Cedric
2013년 4월 28일
Ok, great if you found a solution; bonne continuation !
카테고리
도움말 센터 및 File Exchange에서 Process Point Clouds에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!