MATLAB: Problem with matrix dimensions

general matlab usage

I am attempting to write a program that will compute a range of values from a equation I derived in another program but I am stuck with a error about matrix dimensions and I cannot find where in the code this is happening. I'm sure this is a idiot question but I am absolutely awful at MATLAB and still trying to learn it. Any help with this would be greatly appreciated. I apologize in advance about the length of the equations in the program they are very long and hard to read.
a = 5:.001:30;
%M = .1 L = 1.3 um
R_1 = (1/135)*((1777*(sqrt(15)*sqrt(30375000000*a.^2+5611284433)-675000*a).^(1/3))/15.^(2/3)-3157729/((15.^(1/3))*(sqrt(15)*sqrt(30375000000*a.^2+5611284433)-675000*a).^(1/3))+30000*a);
%M = .5 L = 1.3 um
R_2 = (1777*(sqrt(3)*sqrt(16875000000*a.^2+5611284433)-225000*a).^(1/3))/(125*3.^(2/3))-3157729/(125*3.^(1/3)*(sqrt(3)*sqrt(16875000000*a.^2+5611284433)-225000*a).^(1/3))+400*a;
%M = .75 L = 1.3 um
R_3 = (3554*2.^(1/3)*(sqrt(6)*sqrt(8437500000*a.^2+5611284433)-225000*a).^(1/3))/(125*3.^(2/3))-(6315458*2.^(2/3))/(125*3.^(1/3)*(sqrt(6)*sqrt(8437500000*a.^2+5611284433)-225000*a).^(1/3))+800*a;
%M = .1 L = 1.55 um
R_4 = ((19979*(sqrt(6)*sqrt(30375000000000*a.^2-7974826450739)+13500000*a).^(1/3))/6.^(2/3)+399160441/(6.^(1/3)*(sqrt(6)*sqrt(30375000000000*a.^2-7974826450739)+13500000*a).^(1/3))+1500000*a)/6750;
%M = .5 L = 1.55 um
R_5 = (19979*(sqrt(30)*sqrt(16875000000000*a.^2-7974826450739)+22500000*a).^(1/3))/(1250*30.^(2/3))+399160441/(1250*30.^(1/3)*(sqrt(30)*sqrt(16875000000000*a.^2-7974826450739)+22500000*a).^(1/3))+400*a;
%M = .75 L = 1.55 um
R_6 = (19979*(sqrt(15)*sqrt(8437500000000*a.^2-7974826450739)+11250000*a).^(1/3))/(625*15.^(2/3))+399160441/(625*15.^(1/3)*(sqrt(15)*sqrt(8437500000000*a.^2-7974826450739)+11250000*a).^(1/3))+800*a;
plot(a, R_1)
plot(a, R_2)
plot(a, R_3)
plot(a, R_4)
plot(a, R_5)
plot(a, R_6)

Best Answer

You appear to have vector divided by vector. You probably want to use ./ for that operation instead of / as the / operator is matrix division.