Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
legend

Subject: legend

From: Avi

Date: 18 Nov, 2010 13:14:04

Message: 1 of 2

i have 3 commands
gscatter(x,y,g,'br','ps')
plot(x(i),y(j),'go')
plot(x(k),y(k),'mo')

legend('A','B','C','D')

THE ISSUE THAT SOMTIMES I or j can be empty
and maybe in g only one type instead of 2 , so legend doesnt show correctly
how to fix !!

Subject: legend

From: Sean de

Date: 18 Nov, 2010 14:45:05

Message: 2 of 2

"Avi " <michaels@dsit.co.il> wrote in message <ic38qr$s3l$1@fred.mathworks.com>...
> i have 3 commands
> gscatter(x,y,g,'br','ps')
> plot(x(i),y(j),'go')
> plot(x(k),y(k),'mo')
>
> legend('A','B','C','D')
>
> THE ISSUE THAT SOMTIMES I or j can be empty
> and maybe in g only one type instead of 2 , so legend doesnt show correctly
> how to fix !!

if isempty(i) || isempty(j)
   %do one thing
else
   %do another
end

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us