Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to store each value of T0 in a matrix of order (l,240)?

조회 수: 2 (최근 30일)
CYC12
CYC12 2017년 9월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
for t=b:dt:240
for x=a:dx:l
for n=d:dn:5
cn=(2/n*pi)*(((40/n*pi)*(sin(n*pi)))-(40*cos(n*pi)));
T0=cn*(exp(-(n^2)*(pi^2)*t/(l^2)))*(sin(n*pi*x/l));
end
end
end
  댓글 수: 1
Roger Stafford
Roger Stafford 2017년 9월 28일
Your request implies that the triple nested for-loops will iterate L*240 times. That is certainly not evident and would depend very much on the values of b, a, d, dt, dx, dn, and L. Please tell us what these seven values are.

답변 (1개)

KSSV
KSSV 2017년 9월 28일
t=b:dt:240 ;
x=a:dx:l ;
n=d:dn:5 ;
T0 = zeros(length(t),length(x),length(n)) ;
for i = 1:length(t)
for j = 1:length(x)
for k = length(n)
cn=(2/n(k)*pi)*(((40/n(k)*pi)*(sin(n(k)*pi)))-(40*cos(n(k)*pi)));
T0(i,j,k)=cn*(exp(-(n(k)^2)*(pi^2)*t(i)/(l^2)))*(sin(n(k)*pi*x(j)/l));
end
end
end

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by