summaryrefslogtreecommitdiff
path: root/3809/CH3/EX3.4/EX3_4.sce
blob: 0e77235a495dfd1cd1f9877448ad759012f9f5bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Chapter 3, Example 3.4
clc

R1=25               //resistance in ohm
R2=400              //resistance in ohm

//To solve simultaneous equation by converting them into matrices form
a=[R1 -2;R2 -8]
b=[50;3200]
x=a\b

//Results
printf("Voc = %d V\n",x(1))              //display voltage Voc
printf("R = %d Ohm",x(2))                 //display Resistance R