Info

This question is closed. Reopen it to edit or answer.

how to create a graph where each point (x,y) has one of two colors, depending whether f(x,y) is 0 or 1?

1 view (last 30 days)
I have two parameters: x and y, and a function f(x,y) that gives only 0 or 1. I want to create a graph in which: if f(x,y)=0 the point (x,y) will be in one color, and if f(x,y)=1 the point (x,y) will be in another color. thanks, Yael

Answers (1)

Matt J
Matt J on 24 Mar 2014
Edited: Matt J on 24 Mar 2014
Something like the following maybe,
scatter(x_one,y_one,'r*'); hold on
scatter(x_zero,y_zero,'bd'); hold off

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!