Can't plot all the four points among the inputs given in an OR Gate.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Here's my code for plotting the inputs in an OR Gate but among the four inputs only three gets plotted.Can anyone provide me solution to this??
CODE:
x=[1 0;0 1;0 0;1 1];
y=[1;1;0;1];
plot(x,y,'o')
Here is the output showing only three points rather it should have showen four.
Can anyone please provide me the reason behind this and the solution to overcome this.
2 Kommentare
James Tursa
am 29 Mai 2020
It is not clear to me what result you want for the plot. Can you describe what your desired plot would look like?
Antworten (1)
Ameer Hamza
am 29 Mai 2020
The way you are using plot() does not make much sense here. Using scatter() with y as the color value will show the difference f true and false values.
x=[1 0;0 1;0 0;1 1];
y=[1;1;0;1];
scatter(x(:,1),x(:,2),[],y,'filled')
colormap(cool)
8 Kommentare
Siehe auch
Kategorien
Mehr zu Discrete Data Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!