diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1076/CH9/EX9.3 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1076/CH9/EX9.3')
-rwxr-xr-x | 1076/CH9/EX9.3/9_3.sce | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/1076/CH9/EX9.3/9_3.sce b/1076/CH9/EX9.3/9_3.sce new file mode 100755 index 000000000..056421e97 --- /dev/null +++ b/1076/CH9/EX9.3/9_3.sce @@ -0,0 +1,46 @@ +clear
+clc
+
+data=[ 1 2 .025 .1
+ 2 3 .02 .08
+ 3 4 .05 .2
+ 1 4 .04 .16
+]
+
+n=4
+e=4
+Y=zeros(n,n)
+
+for i=1:e
+ ynew = 1/(data(i,3)+(%i *real(data(i,4))))
+ n1=real(data(i,1))
+ n2=real(data(i,2))
+ if(n1==0)
+ Y(n2,n2)=Y(n2,n2)+ynew
+ else
+ Y(n1,n1)= Y(n1,n1)+ynew
+ Y(n1,n2)= Y(n1,n2)-ynew
+ Y(n2,n1)= Y(n2,n1)-ynew
+ Y(n2,n2)= Y(n2,n2)+ynew
+ end
+end
+
+disp(round(Y*1e2)/100,"(a)")
+
+data(e+1,:)=[1 3 .1 .4]
+i=e+1
+ynew = 1/(data(i,3)+(%i *real(data(i,4))))
+
+n1=real(data(i,1))
+n2=real(data(i,2))
+if(n1==0)
+ Y(n2,n2)=Y(n2,n2)+ynew
+else
+ Y(n1,n1)= Y(n1,n1)+ynew
+ Y(n1,n2)= Y(n1,n2)-ynew
+ Y(n2,n1)= Y(n2,n1)-ynew
+ Y(n2,n2)= Y(n2,n2)+ynew
+end
+
+
+disp(round(Y*1e2)/100,"(b)")
|