I have the following code but Im having issues trying to make this plot the standard deviation for the vector 'Ibig'. When i run the code i get an error saying that 'x2' in the 8 isnt the same vector size. How can i fix this problem or is there another way to plot the standard deviation?
y = Ibig;
x = 1:numel(y);
std_dev = std(y);
curve1 = y + std_dev;
curve2 = y - std_dev;
x2 = [x, fliplr(x)];
inBetween = [curve1, fliplr(curve2)];
fill(x2, inBetween, 'g');
hold on;
plot(x, y, 'r', 'LineWidth', 2);

x2? What issues do you have?yhave? Your code works ifyis a row vector (1 x n). It doesn't work for column vectors or arrays with higher dimension.