How do I pull a value out of a different equation @ a specific value

1 visualizzazione (ultimi 30 giorni)
I am trying to find the value of D @ time Tmin but in my mind I think it should go like Tmin(D) but it says indices must be positive intgers or logical values.
function[Tmin,Dt] = Tension(Lb,Lc,W,Dmin,Dmax)
D = linspace(Dmin,Dmax,20);
T = (Lb*Lc*W)./(D.*sqrt(Lc^2-D.^2));
Tmin = min(T);
Dt = T(Tmin);

Risposta accettata

James Tursa
James Tursa il 3 Ott 2019
Modificato: James Tursa il 3 Ott 2019
[Tmin,k] = min(T);
Dt = D(k);
  1 Commento
Bryce Johnson
Bryce Johnson il 3 Ott 2019
Thanks I just couldn't figure it out, also I replaced Dmin with Dt because Dmin is already specified in the function input but that still worked.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Argument Definitions in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by