MATLAB Answers

Milenko

semilogx problem with two data sets

Asked by Milenko
on 19 Sep 2013

My code:

load('ap08.dat')
load('periods.dat')
a=reshape(ap08,2,24)
x=periods
e=a(1,:)
e1=e(24:-1:1)
h=a(2,:)
h1=h(24:-1:1)
im=figure;
semilogx(x,e1,'b')
semilogx(x,h1,'p')
saveas(im,'apr01.jpg');

It works ok for e1 but does not draw h1.

How to solve this?

  0 Comments

Tags

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 19 Sep 2013

Add

hold on

after the first semilogx() call

  1 Comment

Milenko
on 20 Sep 2013

No it does not work that way,draws a line. semilogx(x,h,'p'); hold on; semilogx(x,e,'b');


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today