1

I'm trying to show this Matlab text, but apparently there is an error in the line

title('z(x)=1+e^(-2x)*cos(\omegax)');

I thought anything I put between $..$ LaTeX would read as an mathematical expression. And since the line has only mathematical expressions, I cant find the error.

Can any of you help me?

This is the whole block:

x=linspace(0,2,1000);
w1=0.1;
w2=0.5;
w3=1.0;
z1=1+exp(-2*x).*cos(w1*x);
z2=1+exp(-2*x).*cos(w2*x);
z3=1+exp(-2*x).*cos(w3*x);
figure(1)
plot(x,z1,'k-',x,z2,'k--',x,z3,'k.');
grid on;
xlabel('tempo(s)');
zlabel('z(x)');
title('z(x)=1+e^(-2x)*cos(\omegax)');
legend('\omega=0,1','\omega=0,5','\omega=1');
2
  • Welcome to TeX SX! What is the line in the .log file?
    – Bernard
    Feb 29 '16 at 23:09
  • i see \omegax on the next to last line. should probably be `omega x' with a space. Feb 29 '16 at 23:21
2

\omegax is undefined. You probably want \cos(\omega x) in your line title('z(x)=1+e^(-2x)*cos(\omegax)');.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.