How to find the loaction of an element in an array
古いコメントを表示
Say I have two arrays, one for outside temperature and the other for heat rate. All elements in the array line up and correspond to each other. Is there a way that I could get the location of a certain temperature (from the temperature array) and pull the heat value element (from the heat array) that corresponds to that temperature element location? For example:
T=[0 1 2 3]'; Q=[100 200 300 400]';
I'd want to choose T=2 --> which is in the (3,1) position. How can find out the corresponding Q value? I'm doing this because because the arrays are very large and some of the temperatures are the same values and I want to group the Qs for the same temperature. Thanks
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!