I am trying to write a matlab script using for loop and I want to make a 4\*2 subplot.

I tried to use the `legend` function into each graph but, I faced a problem. I intend that each graph has as legend using `legend('Motor1+i')`, but all graphs have same name `Motor1+i`.

I want to have `Motor1`, `Motor2`, `Motor3`, ...

```
g_wPWMOut=[g_wPWMOut0 g_wPWMOut1 g_wPWMOut2 g_wPWMOut3 g_wPWMOut4 ...
              g_wPWMOut5 g_wPWMOut6 g_wPWMOut7];

figure
for i=0:1:7;
   subplot(421+i)
   plot(FCCTime, g_wPWMOut(:,(1+i)))
   grid on
   legend('Motor1+i')
   ymax = max(g_wPWMOut(:,(1+i)));
   ymin = min(g_wPWMOut(:,(1+i)));
   xmax = max(FCCTime);
   xmin = min(FCCTime);
   axis([xmin-((xmax-xmin)*0.05) xmax+((xmax-xmin)*0.05) ...
   ymin-((ymax-ymin)*0.05) ymax+((ymax-ymin)*0.05)])
end

```