I am trying to plot y=A*(x+B)^n with constant A and B-values but I want to plot three different lines, each with a different n-value (n=1, 2, and 3). It keeps giving me a plot with one line and it also says there is an error using ".^". Can anybody tell me what's wrong with my code?
x = linspace(0, 2*pi, 100);A = 1;B = 1;n = 1:3;y = A*(x+B).^n;for n = 1:3 plot(x,y); hold onendhold off
Best Answer