Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

A simple Question( i believe)

Status
Not open for further replies.

chumbica

Aerospace
Aug 25, 2005
1
how can i do the matlab plot the resultant points at the same graphic.
for example( only to take a idea)

for x=1:10
y=x^2
end

when i put plot(x,y) the matlab plots only the last value calculated, but what i want is that it plots every points at the same graphic

TANKS
 
Replies continue below

Recommended for you

for x=1:10
y(x)=x^2
end

or better yet

x = 1 : 10;
y = x .^ 2;

This is called vectorization in the MATLAB community. It can remove the inner loop sometimes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor