- #1
Leanne
- 14
- 4
- Homework Statement
- I'm trying to find the diameter of a wire knowing the length, volts, current, and resistivity, and then code it in Matlab. I've been working on it for hours and I can't seem to get it right. Can anyone help?
- Relevant Equations
- V=IR, R=(pl)/A, A=pi(0.5d)^2 and resistivity for aluminum, copper, gold, and silver.
Mentor node: Added code tags
From=menu('select:','c', 'g', 'a', 's:'); This is part of my code and I'm not coming up with anything close
From=menu('select:','c', 'g', 'a', 's:'); This is part of my code and I'm not coming up with anything close
Matlab:
l=input('input wire length') %current copper=12.5572 to the right answer. :/
V=input('input Voltage') %current gold=8.8518e-08
switch From %current aluminum= 7.8540
case 1 %current silver= 13.5839
cp='1.72*10^-8 ohm/m';
b=l*cp;
v=110;
r=v/12.5572;
A=b/r;
x=A/pi;
rad=sqrt(x);
dia=rad*2
Last edited by a moderator: