2

I have plotted a graph and I need to change the window size of the plot window. Please help.

x=0:0.1:3;

for i = 1:4
    y0=[-0.05;-0.1;0.05;0.1];

y=y0(i,1)*exp(-2*x);
plot(x,y)
hold all
end
dda
  • 6,030
  • 2
  • 25
  • 34
Hadiza Hamza
  • 37
  • 1
  • 6

1 Answers1

0

Before your loop, create a figure and set the position as [startX, startY, width, height]

x=0:0.1:3;
figure('Position',[100 100 500 500]);
for i = 1:4
    y0=[-0.05;-0.1;0.05;0.1];
    y=y0(i,1)*exp(-2*x);
    plot(x,y)
    hold all
end

Alternatively, after your original code, run

f = gcf;
f.Position = [100 100 500 500]
jkazan
  • 1,149
  • 12
  • 29