필터 지우기
필터 지우기

problem with matlab index

조회 수: 2 (최근 30일)
rajashekar
rajashekar 2012년 1월 28일
hi
i'm rajashekar from JNTU doing my M.tech
i have been trying to solve an equation and it requires me repaet this equation in a loop and store values . the equation is
I(n*td) = sin(((alpha(n)./2)) + (((beta./2)).*(I((n-1)*td)))).^2;
here n is an integer but td is in micro or milli seconds and matlab does not allow for storing n*td that gives a decimal values. is there any way i can save my iteration results in a matrix?
thank you

답변 (1개)

Walter Roberson
Walter Roberson 2012년 1월 28일
Your only use of td is to multiply the index in to I. So unless there are reasons not to, just leave td out:
I = zeros(FinalValueIndex,1);
I(1) = TheInitialValue;
for n = 2 : FinalValueIndex
I(n) = sin(alpha(n)./2) + (beta ./2 .* I(n-1)).^2;
end
Unless, that is, beta is a vector.
  댓글 수: 3
rajashekar
rajashekar 2012년 1월 30일
also my original equation which i have to simulate is
I(t)=sin(((alpha(t)./2)) + (((beta./2)).*(I((t-td)))).^2;
where t is time and td is time delay....can you tell me how do i simulate this?
rajashekar
rajashekar 2012년 1월 31일
any ideas?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by