I'm trying to figure out this bootleg programming language but keep getting stumped on things like this.
My code is as follows:
clc;
clear;
for i = -3:6;
x(i) = i;
y(i) = (i^4)-(4*(i^3))-(6*(i^2))+15; %being my given function
end
plot(x,y)
It works if I start from 1 because it's a positive integer. It can't access zero nor negative values. How do I go around this?
edit: thanks for the swift response you guys, I like your methods and definitely wanted to approach it different ways but one of the requirements in my text is to use the for loop, sadly