Could someone help please? Having errors with line 21 for "Time". %This program will calculate the approximate time for electrons to travel
% from cathode to anode of a rectifier tube.
%
clearclc%Get user input
min_V=input('Enter the min limit of accelerating voltage:');max_V=input('Enter the max limit of accelerating voltage:');r1=input('Enter the radius of the inner tube (cathode) in mm:');r2=input('Enter the radius of the outer tube (anode) in mm:');%%V=(min_V:1:max_V);%Range of voltage 1-10, increments 1
z=log(r2./r1);%Natural Logarithm of R2/R1
q=1.60206*10^-19;%Charge of electron in coulombs
m=9.1083*10^-31;%Mass of electron in kilograms
time=z*r1*(sqrt((2*m)/(q.*V)))*(1+(z/3)+(z^2/10)+(z^3/42)+(z^4/216));%Time for electron to travel from cathode to anode (in sec)
%%%%%Display output as required
my_results=[V',time'];disp(' ');disp('Voltage Time');disp('-------- ------');disp('(volts) (seconds)');disp(my_results);%%End of file
MATLAB: Line 21 giving me troubles
error
Best Answer