MATLAB Answers

0

plot a graph in intagrl2

Asked by Vu Hai Duong on 18 May 2019 at 4:38
Latest activity Commented on by Vu Hai Duong on 18 May 2019 at 13:34
syms x y real
fun = x
y1 = x
y2 = cos (x)
b= solve (y1==y2);
Volumeofsolid = int(int(fun,y,y1,y2),x,0,b)
x = linspace (0,b,25)
% Please teach me how to assign the value of x to y1
y = linspace (y1,y2,25)
plot(x,y)

  1 Comment

You defined x as a vector of lengh 25. If you substitute that vector into your y1 and y2 formula, then that would be something that you could not linspace()

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 18 May 2019 at 5:26
 Accepted Answer

I am going to guess:
plot(x,subs([y1;y2]).')

  1 Comment

thanks you, i plotted this graph

Sign in to comment.