Can't plot all the four points among the inputs given in an OR Gate.
1 view (last 30 days)
Show older comments
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 Comments
James Tursa
on 29 May 2020
It is not clear to me what result you want for the plot. Can you describe what your desired plot would look like?
Answers (1)
Ameer Hamza
on 29 May 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 Comments
See Also
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!