필터 지우기
필터 지우기

Functions of I, for i=1, n, n-1

조회 수: 2 (최근 30일)
Kyle Langford
Kyle Langford 2023년 4월 29일
답변: Walter Roberson 2023년 4월 29일
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.

채택된 답변

Walter Roberson
Walter Roberson 2023년 4월 29일
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개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by