필터 지우기
필터 지우기

Info

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

How can I compute the following formular recursive ?

조회 수: 1 (최근 30일)
Fox
Fox 2016년 1월 13일
댓글: Pavithra Ashok Kumar 2016년 1월 21일
x1=b(1)+ b(2)*x0+resrd2(1,:); % b1 and b2 are scalars x(0) also resrd2 is a matrix of 743x1
x2=b(1)+ b(2)*x1+resrd2(2,:);
x3=b(1)+ b(2)*x2+resrd2(3,:);
How can I solve this ? My Problem here is, that the x values should change recursively and that I want to get the fitting values from the resrd2. In the end the goal is to get a matrix of 743x1. Can somebody please help me here ?
  댓글 수: 3
Fox
Fox 2016년 1월 13일
편집: Fox 2016년 1월 13일
Problem is that I've now the resrd in addition and it doesn't work with the structure before. I've the formular to solve the problem without resrd.
xm = a*(1-b.^m)/(1-b) + b.^m*xx0;
When I've now the resrd, I can transform this to:
for i=1:743
xx=a+resrd(i,:);
xm = xx*(1-b.^m)/(1-b) + b.^m*xx0;
end
However my solutions are wrong. You know a way how to fix this or another approach to solve this problem ?
Pavithra Ashok Kumar
Pavithra Ashok Kumar 2016년 1월 21일
%Call this function with x(n)
function out = x(index)
if index == 1
return x(0);
else
out = a+b*x(index-1) + resrd(index-1);
end
Collecting the out values will give the array you are looking for. Hope this helps.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by