0% found this document useful (0 votes)
42 views1 page

Contour and Waterfall Graphs in MATLAB

This document contains code that graphs two functions using contour3 and waterfall plots. The first function, y = 4cos3x, is graphed using contour3 and waterfall plots. The second function, y = sinx + 1, is also graphed using contour3 and waterfall plots. Detailed code is provided using meshgrid, contour3, and waterfall functions in MATLAB to generate the four plots.

Uploaded by

Vinz Gonzaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views1 page

Contour and Waterfall Graphs in MATLAB

This document contains code that graphs two functions using contour3 and waterfall plots. The first function, y = 4cos3x, is graphed using contour3 and waterfall plots. The second function, y = sinx + 1, is also graphed using contour3 and waterfall plots. Detailed code is provided using meshgrid, contour3, and waterfall functions in MATLAB to generate the four plots.

Uploaded by

Vinz Gonzaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

EXERCISE 8.

1
CS10-8
Name: Gonzaga, Vinz Scott P. Section: A1

Graph the following using contour3 (1) and waterfall (2). Write the detailed syntax/functions
used. Use appropriate domain .
(Copy/paste or screened shot the graph/output)
1. y = 4cos3x

2. y = sinx +1

Code used:
[x, ~] =meshgrid(linspace(-10,10,200));
a=4*cos(3*x);
contour3(a)
title ('Part a contour3')
figure
waterfall(a)
title ('Part a waterfall')
b=sin(x)+1;
figure
contour3(b)
title ('Part b contour3')
figure
waterfall(b)
title ('Part b waterfall')

You might also like