How to plot the following function? I need x range of [0; 1]
.
syms y(x)
y(x) = dsolve(diff(y,x) == tan(x), y(0) == 1);
plot(y, [0 1]);
How to plot the following function? I need x range of [0; 1]
.
syms y(x)
y(x) = dsolve(diff(y,x) == tan(x), y(0) == 1);
plot(y, [0 1]);
Copyright © 2021 Jogjafile Inc.
The error message that you get is:
This exactly tells what the problem is.
y
is not numeric data here. Rather it is a symbolic function. You need to evaluatey
at the required points and then plot it.Fixed Code:
Output: