help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple question regarding plotting in for loops


From: Doug Stewart
Subject: Re: Simple question regarding plotting in for loops
Date: Wed, 20 Feb 2013 22:23:30 -0500




On Wed, Feb 20, 2013 at 10:20 PM, Henriamaa <address@hidden> wrote:
When I write a function for plotting this way:
function test
for i =1:10;
h = sin (i);
plot(h)
endfor

it does not plot anything but when I do this:
function test
 i =1:10;
h = sin (i);
plot(h)
it plots the points.

This is a general pattern. I have been able to draw a circle without the for
loop but once I put the plot statement in the for loop nothing is plotted.
What am I doing wrong?



--
View this message in context: http://octave.1599824.n4.nabble.com/Simple-question-regarding-plotting-in-for-loops-tp4650092.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


Try this
for i =1:10;
h(i) = sin (i);
endfor
plot(h)
--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]