x=1:1:10;for z=1:length(x);if x(z)>=1 & x(z)<3,y=2*x;plot (x,y);else if x(z)>=3 & x(z)<=7plot (x,y);y=4*x;else if x(z)>7 & x(z)<=10y=5*x;plot (x,y);
MATLAB: For a range of x, say x=10, i need for x=1 to 3, y= f(x); for x= 4 to 7, y=g(x); for x=8 to 10, y=h(x); and how to present graph of x and y with x=1 to 10 using matlab coding
for loop
Best Answer