omav = 5*1000*2*pi;
sigma = [0,0.5,1,2,5].*1000*2*pi;
t = 100;
om = linspace(-3*sigma(i), 3*sigma(i),100);
num = -(om-omav).^2;
den = 2.*sigma(i).^2;
gaus = exp(num./den);
figure(i), plot(om, gaus)
title( [' for sigma = ' num2str(sigma(i)/(2000*pi))] )
This is my code, i'm trying to make each figure with new x limits from the value of the variable omm but i get an error says:
" Error using matlab.graphics.axis.Axes/set
While setting the 'XLim' property of 'Axes':
Value must be a 1x2 vector of numeric type in which the second element
is larger than the first and may be Inf "
I thought this because of the zero value of first sigma, therefore i added an if statement that if i>1 , set the x limits, and the error disappeared, but the limits still as they were.