here, i couldn't get the A,B,C values while using if, elseif conditions. how to get values while using conditional statement?
Show older comments
dx=0.05; dy=0.25; dt=0.2;
for j=1:n
if i==2:m
C(i)=V(i,j)*dt/4*dy-dt/2*(dy)^2;
elseif i==1:m-1
A(i)=-V(i,j)*dt/4*dy-dt/2*(dy)^2;
elseif i==1:m
B(i)=1+U(i,j)*dt/2*dx+dt/(dy)^2;
end
end
5 Comments
Dyuman Joshi
on 12 Dec 2022
Arif Hoq
on 13 Dec 2022
what is the value of n and i ?
Yanni
on 13 Dec 2022
Dyuman Joshi
on 13 Dec 2022
You still haven't answered - What is the value of i? Is there a value to i?
What exactly are you trying to achieve from this code?
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!