MATLAB: Need more data points for the plot. can’t index non whole numbers

for loopsindexing

I am running a simple step response function at certain points using 2 for loops. i am only getting 12 data points and i need much more for a smooth graph. Ive tried changing to increments of .1 but i can't index those values. Code:
k=1;
for ksi=[0.2,0.3,0.4,0.5,0.7,0.9];
theta = acos(ksi);
beta = sqrt(1-ksi^2);
for wnt = (0:12)
y = (k-(k/beta)*(exp(-ksi*wnt))*sin(beta*wnt+theta))
y1(wnt+1)=y;
wnt1(wnt+1)=wnt;
end
plot(wnt1,y1)
thank you in advance.

Best Answer

wntvals = linspace(0, 12, 100);
for wntidx = 1 : length(wntvals)
wnt = wntvals(wntidx);
y = (k-(k/beta)*(exp(-ksi*wnt))*sin(beta*wnt+theta))
y1(wntidx)=y;
wnt1(wntidx)=wnt;
end