필터 지우기
필터 지우기

How can I compute value of this variable y iteratively

조회 수: 1 (최근 30일)
TRISHITA BANERJEE
TRISHITA BANERJEE 2018년 7월 13일
댓글: Geoff Hayes 2018년 7월 13일
j = 0:jmax - 1;
jmax=5;
x(j) = [zeros(t(j),1);x_m';zeros(t_max -t(j),1)];
y_m = x(1)+x(2)+x(3)+x(4)+x(5);% Simulated Measurement
% y_m=y_m';
  댓글 수: 2
madhan ravi
madhan ravi 2018년 7월 13일
what's t ?
Geoff Hayes
Geoff Hayes 2018년 7월 13일
Trishita - is the above code supposed to be in a for loop like
for j = 0:jmax - 1
% your code
You will need to define jmax before you use it
jmax = 5;
for j = 0:jmax-1
% do something
end
But what is it that you want to do on each iteration of the loop? You update the x array but it is unclear what this is? Is each element of x a row? Please provide more details...

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by