help-octave
[Top][All Lists]
Advanced

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

Re: Problem in plotting a specific function graph


From: Stefanos Beligiannis
Subject: Re: Problem in plotting a specific function graph
Date: Wed, 2 Jan 2019 15:20:52 +0000 (UTC)

Well done! It works perfectly!

Thank you Tony

Happy new year and kind regards

photo
Stefanos Beligiannis
Rural & Survey Engineer MSc/Construction Project Manager MSc

+30 231 550 4700 | +30 697 299 3938, +30 694 805 9589, +44 780 117 3921 | address@hidden

http://smpel9.wixsite.com/stefanosbeligiannis | Skype: stefanos.beligiannis

P.O. Box 2572 , Triadi, Thermi, Thessaloniki GREECE 57001
Create your own email signature
DISCLAIMER:

This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain confidential information. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer.




On Wednesday, January 2, 2019, 5:15:29 PM GMT+2, Richardson, Anthony <address@hidden> wrote:




> Subject: Problem in plotting a specific function graph
>
> I am new user of Octave. I wanted to plot a function and I wrote this code: 
> pi=3.14159;
> t=0:0.1:10;
> y=8*sinc(8*t)-4*sinc(2*t)*cos(6*pi*t);
> plot(t,y);
> print(hf,"f:\yef.png");
>
> but does not work.
> Can anybody advice? 
>
> Best Regards
> Stefanos Beligiannis

Change the "y=...." line to:


y=8*sinc(8*t)-4*sinc(2*t).*cos(6*pi*t);


Note the use of ".*" instead of "*" for the second multiplication.  "*" is for matrix multiplication while ".*" is used for element-by-element multiplication of the two operands.
The print statement should just be "print("f:\yef.png")" to print the current figure.

Tony Richardson



reply via email to

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