function solve3x3();
% This function solves a 3x3 matrix equation of the form G * V = S
% Replace the zeros in each equation with values as needed

% Clear all variables in the workspace
clear all

% Enter the values for each matrix element, G(row,column)
% You may enter an equation for the value (1/1500 + 1/3.9e3 + ...)
% You may use exponential notation (-1/3.9e3) or regular notation (-1/3900)
% Some values will be positive and some will be negative
G(1,1) = 0.0;
G(1,2) = 0.0;
G(1,3) = 0.0;
G(2,1) = 0.0;
G(2,2) = 0.0;
G(2,3) = 0.0;
G(3,1) = 0.0;
G(3,2) = 0.0;
G(3,3) = 0.0;
% Display the matrix
G

% Enter and display the values for S, a 3x1 column vector
S = [0.0; 0.0; 0.0]

% Find the inverse of the matrix so that V = inv(G) * S
Ginv = inv(G);

% Calculate the voltages at the corresponding nodes
V=Ginv * S;

% Display the voltages rounded to hundredths
fprintf('V1 = %4.2f volts\n',V(1))
fprintf('V2 = %4.2f volts\n',V(2))
fprintf('V3 = %4.2f volts\n',V(3))