Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I would like to call a row element from a matrix however, the row is written inside another matrix

1 回表示 (過去 30 日間)
mert inanli
mert inanli 2019 年 4 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello guys, I have a matrix a which tells me which row has the minimum value of temperatures. E.g. :A=[241 241 296 296 241 241 241 241 287 287 287 241]
Here it means that row 241 ,241,296... have the minimum error value.
I would like to call the 241th element of the temperature matrix (The actual temperature value). Is there a way I can code this? Thank you and hope I was clear.
P.s. I dont want to type the row number manually, I would like MATLAB to look for the first value of the A matrix, then search another matrix and call the nth element where n is the values written inside the A matrix.
  1 件のコメント
madhan ravi
madhan ravi 2019 年 4 月 19 日
Totally unclear. Illustrate with an example and show explicitly how your output should look like.

回答 (1 件)

the cyclist
the cyclist 2019 年 4 月 19 日
If T is the temperature matrix, then it sounds like maybe you want to do
T(A(1))
Or use a loop to access more rows of T?
for n = 1:7
T_value = T(A(n))
% Do something here with the value?
end
As madhan has said, it is a bit unclear what you mean.

Community Treasure Hunt

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

Start Hunting!

Translated by