convert c to matlab code

for (ix=0; ix< iNx; ix++)
for (iy=0; iy< iNy; iy++)
{
fMeanIn += pfIm0[X(ix,iy)]*pfu[X(ix,iy)];
fNormalizationIn += pfu[X(ix,iy)];
fMeanOut += pfIm0[X(ix,iy)]*(1.0-pfu[X(ix,iy)]);
fNormalizationOut += 1.0-pfu[X(ix,iy)];
}
the above code is C code.... how to convert this into matlab code.... i'm getting error in pfIm0[X(ix,iy)].... please help me to solve it out...

 채택된 답변

Andreas Goser
Andreas Goser 2012년 11월 8일

0 개 추천

MATLAB start with index 1 and has no index 0.

댓글 수: 2

Elysi Cochin
Elysi Cochin 2012년 11월 8일
thanks sir... what about the remaining portion....
Andreas Goser
Andreas Goser 2012년 11월 8일
In my view this depends on the data going into the code. You could post dummy data like A=1:10 or B=rand(3,3) to run test code

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by