clear allrr=0.99997622; % reflectivity of the cavity
r=sqrt(rr); finesse=pi.*sqrt(rr)./(1-rr); % finesse of the cavity
fsr=10^9;x=-9e4:10:9e4; % frequnecy detuning
z=x./fsr;FWHM=fsr./finesse;mod=40e6; % modulation frequency to the laser
m=mod./fsr;g=r.*(exp(((x./fsr).*(2.*pi)).*1i)-1)./(1-(r.^2).*exp(((x./fsr).*(2.*pi)).*1i)); abg=abs(g);sg=power(abg,2);dfg=diff(sg);y=m.*dfg;plot(x,y)
MATLAB: I am getting this error- “Vectors must be the same lengths.”. Also please explain why its showing this error as I am plotting a funtion with ‘x’ as variable with defined vector.
errorMATLABvectors must be the same lengths
Related Question
- How to reference a variable saved as .mat file to execute code
- I am getting a single number , but what want to get is a vector so that I can graph this formula
- Is there any way that I can optimise this code. It takes lot of time to run and for larger iteration like ‘nc=10e6’ its stops stating runtime error.
- How to convert the x-axis of an FFT from frequency to wavelength
- (Solved) How to change the t and dVdT to input in a 31×1 double, instead of 1×31 (row to colum)
Best Answer