Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why doesn't a simple progream work?

조회 수: 1 (최근 30일)
Ayob
Ayob 2014년 4월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Jan
Jan 2014년 4월 27일
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.

답변 (1개)

per isakson
per isakson 2014년 4월 27일
편집: per isakson 2014년 4월 27일
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"

태그

Community Treasure Hunt

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

Start Hunting!

Translated by