필터 지우기
필터 지우기

Iterations in matlab.

조회 수: 4 (최근 30일)
Pranjal Pathak
Pranjal Pathak 2012년 1월 30일
Hi,
I have done a coding in matlab and this is the point where I am hanging,can anyone please help me out?
I have an equation
P(i,j)=Q(i,j)+R(i,j)/2;
Where P,Q,R are all matrices of dim=4x4.
Values of R(i,j) is given to us.
Now,initially assuming Q-matrix to be a zero matrix (all the elements are 0), the P(i,j) matrix is calculated. My, problem is that, once I calculate the P-matrix, I want to assign its value to the Q-matrix (a new Q-matrix instead of the initial zero matrix) to calculate a new P(i,j)-matrix. In this way I want to run the iterations for 4-times.
Will anyone please help me out over here?
Thanking You!
  댓글 수: 2
Jan
Jan 2012년 1월 30일
Please post the existing code and explain, which problems occur. To help you out, it is required to know the problem.
Walter Roberson
Walter Roberson 2012년 1월 30일
Last known code was completely non-functional: <http://www.mathworks.com/matlabcentral/answers/27367-matrix-iterative-solution-using-matlab>

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

채택된 답변

Jan
Jan 2012년 1월 30일
Do you mean something like this:
Q = zeros(4, 4);
R = magic(4);
for k = 1:4
P = Q + R;
Q = P;
end
?
  댓글 수: 1
Pranjal Pathak
Pranjal Pathak 2012년 1월 31일
Thanks Simon Sir!
Yeah! your hint help me out.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 State-Space Control Design and Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by