Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Why doesn't a simple progream work?

1 Ansicht (letzte 30 Tage)
Ayob
Ayob am 27 Apr. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I wrote a simple program, but it doesn't work. I'm completely confused of how such a simple program doesn't work.
x=0:0.1:4;
Ti=0.5;
y=1-(1/(Ti/2)*(0.5))*atan((sin(2*(Ti/2)*(0.5)))/(cos(2*(Ti/2)*(0.5))+exp(2.*acos(x))));
plot(x,y);
hold ond
  1 Kommentar
Jan
Jan am 27 Apr. 2014
Please do not only state, that "it does not work", but explain the occurring problems with details. It is much easier to help, when one does not have to guess the problem at first.

Antworten (1)

per isakson
per isakson am 27 Apr. 2014
Bearbeitet: per isakson am 27 Apr. 2014
My guess: Change
y=1-(1/(Ti/2)*(0.5))*atan((sin(2*(Ti/2)*(0.5)))/(cos(2*(Ti/2)*(0.5))+exp(2.*acos(x))));
to
y=1-(1./(Ti/2)*(0.5))*atan((sin(2*(Ti/2)*(0.5)))./(cos(2*(Ti/2)*(0.5))+exp(2.*acos(x))));
and read http://www.mathworks.se/help/matlab/ref/rdivide.html and search for doc for "Element-wise"

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by