دستورات for و plot در متلب

clear all

clc

i=0

for x=-5:5

     y=x^2+4*x

     x(i)=x

     y(i)=y

     i=i+1

   if x<0

       plot(y,x,'gs');hold on

   else

       plot(y,x,'r*');hold on

   end

end


این برنامه کاملا تست شده و فاقد ایراد می باشد