Functions of I, for i=1, n, n-1
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kyle Langford
le 29 Avr 2023
Réponse apportée : Walter Roberson
le 29 Avr 2023
I have the equation:
dT = (a/r) * ((T(i+1) - T(i-1))/2*dr) + r*((T(i+1) - T(i) + T(i-1)) / dr^2) + q/cp*rho;
I want to plug in values for i, such as i=1, i=2:n-2, and i=n-1. where n=51
I am not sure how to go about this.
0 commentaires
Réponse acceptée
Walter Roberson
le 29 Avr 2023
dT = @(i) (a/r) * ((T(i+1) - T(i-1))/2*dr) + r*((T(i+1) - T(i) + T(i-1)) / dr^2) + q/cp*rho;
dT(2:n-2)
Caution, dT(1) will fail.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!