here is the code for your problem. you can change the range of the plot by changing range = -15:0.1:15 line (but you must use symmetric range, I mean from -a to +a). The number in the middle (0.1) is the distance between two points (sampling distance). You can aslo change that but use same sampling distance for n and range. If you need a more general case or a solution using for loops, let me know.
range = -15:0.1:15;
size_of_range = size(range);
n = -12:0.1:12;
size_of_n = size;
x = zeros(size_of_range(2));
x((size_of_range(2)-size_of_n(2))/2+1size_of_range(2)+size_of_n(2))/2) = 5.^(abs);
plot(range,x)