How to find a corresponding matrix value

I have two matricies, y and t, and I calculated the values of t from the values of y. I then found the minimum value of t, but I also need to find the corresponding value of y from the other matrix and I'm not sure how to do that. So what I have is:
% Creating a vector of y-values
y = [20:.5:48];
% Inputting values of constants
Vr = 3;
Vs = 1;
L = 48;
ds = 30;
dw = 42;
% Calculating the total travel time for each y-value
tr = sqrt(y.^2+ds^2)/Vr;
ts = sqrt((L-y).^2+dw^2)/Vs;
t = tr + ts;
% Finding the minimum value of t
min(t)
So now I know that 59.2946 is the shortest amount of time, but I don't know how to find the corresponding y value.

 採用された回答

Torsten
Torsten 2019 年 4 月 4 日
編集済み: Torsten 2019 年 4 月 4 日

0 投票

[M I] = min(t);
y(I)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by