Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Aug 25, 2005
Messages
1
Location
BR
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
 
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

Back
Top