Luke Gilling
Luke Gilling

Reputation: 1

plotting using modified array in Matlab

clear

for I = 1:1:41
    Result(I) = sqrt((I-1)*5+20)
end
plot(result)


The above is an example from my lab book. I want to do the same kind of thing except plotting the graph 4x^2-3x+2 where x is from 0 to 10 in steps of 0.5.
it doesn't seem to work when i substitute x for I though?
could someone help me out?

Upvotes: 0

Views: 75

Answers (1)

FJDU
FJDU

Reputation: 1473

x=0:0.5:10;
plot(x, 4*x.^2-3*x+2);

Upvotes: 1

Related Questions