Differences between revisions 1 and 2
Revision 1 as of 2010-12-17 19:01:21
Size: 948
Editor: 10
Comment: Plotting a graph for given function
Revision 2 as of 2010-12-17 19:04:47
Size: 910
Editor: trnkarthik
Comment: Plotting a graph for given function
Deletions are marked like this. Additions are marked like this.
Line 36: Line 36:
   * <Your Name>, <Profession>, <Organization>
   * <Your Name>, <Profession>, <Organization>
   * <T.R.N.Karthik>, <Student>, <Gitam University>
   
  • Book

    Getting started with MATLAB

    Author

    Rudra Pratap

    Edition

print "Given matrix A is:\n",A
A=matrix([[1,3,3,3],[5,10,-2,-20],[3,5,10,2],[1,0,0,9]])
print "Function f(x) is defined as f(x)=sin(x)*cos(x)+0.5"
f(x)=sin(x)*cos(x)+0.5
print "The limits in which x should be plotted are given as :(1,6*pi) "
print "Plot statement used to plot the given graph is: plot(f(x),(x,1,6*pi))"
plot(f(x),(x,1,6*pi))


Result:

                

Given matrix A is:
[  1   3   3   3]
[  5  10  -2 -20]
[  3   5  10   2]
[  1   0   0   9]
Function f(x) is defined as f(x)=sin(x)*cos(x)+0.5
The limits in which x should be plotted are given as :(1,6*pi) 
Plot statement used to plot the given graph is: plot(f(x),(x,1,6*pi))

  • Solution by:

    • <T.R.N.Karthik>, <Student>, <Gitam University>

Pratap-4.3.2 (last edited 2010-12-18 07:12:43 by trnkarthik)