plotting, no graph appears
Mostra commenti meno recenti
I am trying to plot an equation however once i run the code, the graph that appears is empty... any idea on the error behind this?
x = 0:0.01:1;
y = (0.5*(1-x))/(5-x);
plot(x,y)
Risposte (1)
Because you forgot the 'dot' when dividing corresponding elements in the x vector.
x = 0:0.01:1;
y = (0.5*(1-x))./(5-x);
plot(x,y)
You can see this example clearly:
x = 1:10
data = [x' x'.^2]
data =
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
Categorie
Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!