MATLAB script
clc
clear
k=menu('Power formula for DC','P=I*V','R*I^2','P=V^2/R');
if k==1
I=input('Input current value');
V=input('Input voltage value');
P=I*V;
fprintf('Power is %g\n',P)
elseif k==2
I=input('Input current value');
R=input('Input resistance value');
P=I^2*R;
fprintf('Power is %g\n',P)
else
R=input('Input resistance value');
V=input('Input voltage value');
P=V^2/R;
fprintf('Power is %g\n',P)
end
Result after choosing P=V^2/R
Input resistance value2
Input voltage value7
Power is 24.5
USE A MATHLAB PROGRAM AND RUN IT FOR RHE FOLLOWING EJERCICE Matab n eleclric circuits there is a very important formula wthere the POWER thl is dissipoled in a compenant i catulted The pewer far...