Error in TDMA gallery function
1 view (last 30 days)
Show older comments
clear,clc
x=[];
n=input('Number of total nodes:');
L=input('Enter the length of nodes:');
b=input('Enter cont/exp factor:');
sum=1.0;
a=input('Enter value of intial tem.');
z=zeros(n-3,1);
E=[a;z];
if (b>=0.90)&&(b<=1.10)
%Grid Generation
for i=1:n-2
sum=sum+b^i;
dx=(L/sum);
end
for k=2:n-1
x(1)=0;
x(k)=x(k-1)+(dx*b^(k-1));
x(n)=1;
end
fprintf('\n\n');
x=transpose(x);
disp(x)
%formation of TDMA
for i=2:n-2
q(i)=1+(x(i)-x(i-1));
end
else
fprintf('\n\n');
disp('please enter the value of cont./exp.factor between 0.90 and 1.10');
end
p=-1;
r=0;
X=full(gallery('tridiag',n-2,p,q,r))
T=inv(Tm)*E
0 Comments
Answers (0)
See Also
Categories
Find more on Run on Target Hardware 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!