Question

y in the blank lines provided below, insert the approprilate commands) needed to complete the fgure. x1 - linspace (0, 4, 25) Y1 linspace(0, 3, 25); G(ii) a)Generate a possible script file using appropriate sequence of cylinder, surf, title etc commands to develop a MATLAB script that will generate the 3-d graphics image shown. This figure was obtained using cyfinder function ais b)What does a and b stand for in the command viewla,b). What will be the view () commands to obtain the side view shown below Ths Sigurewas obtained using cylinder Sucton
2-D Graphics 6 (ii) Develop the MATLAB script in detail to create the exact Rool figure given below with title, label, fill, axis, text, plot and other applicable Matlab commands Base 10 X-AXIS
0 0
Add a comment Improve this question Transcribed image text
Answer #1
Program 1
X1 = linspace(0, 4, 25);
Y1 = linspace(0, 3, 25);
[X,Y] = meshgrid(X1,Y1);
Z = X.^2 + Y.^2;
figure
surf(X,Y,Z)

OUTPUT

4 3 2 2 5 503

Program 2 (part a, part b)

radius = 5;
height = 2;
N = 50;
[X,Y,Z] = cylinder([0 radius], N);
% Plotting the upper part
figure
surf(X,Y,Z*height)
% plotting the lower part
hold on
surf(X,Y,-Z*height)
axis square
hold off
xlabel('x')
ylabel('y')
zlabel('z')

pause(3)

% View part b
a = 0;
b = 0;
view(a,b)

OUTPUT

-2 5 -5

5 5 251 0 5 2

Program 3

rectangle('Position', [6,1,2,2])
hold on
plot([8 6], [1 3], 'k')
plot([6 8], [1 3], 'k')

tri_points_x = [6,7,8];
tri_points_y = [3,4,3];
fill(tri_points_x, tri_points_y, 'k')
axis([4 10 -1 6])
hold off
grid on
xlabel('X-AXIS')
ylabel('Y-AXIS')
title('2-D Graphics')
text(7, 4.5, 'Roof')
text(7, 0.5, 'Base')
hold off

OUTPUT

2-D Graphics Roof 4 2 Base 4 6 10 X-AXIS

4 3 2 2 5 503 -2 5 -5 5 5 251 0 5 2 2-D Graphics Roof 4 2 Base 4 6 10 X-AXIS

Add a comment
Know the answer?
Add Answer to:
y in the blank lines provided below, insert the approprilate commands) needed to complete the fgure....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB ONLY gauss.jpg BELOW Instructions: The following problems can be done interactively or by writing the...

    MATLAB ONLY gauss.jpg BELOW Instructions: The following problems can be done interactively or by writing the commands iın an M-file (or by a combination of the two). In either case, record all MATLAB input commands and output in a text document and edit it according to the instructions of LAB 1 and LAB 2. For problem 2, include a picture of the rank-1 approximation. For problem 3, include a picture of the rank-10 approximation and for problem 4, include a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT