Help understanding the erorr in a matlab code

조회 수: 1 (최근 30일)
googo
googo 2013년 3월 25일
I'm writing a function which recives a matrix of birth and death dates and return the number of days between them.
function daysVector=dateDiffMatrix(dateMat)
p=zeros(size(datMat,1),1);
for i=1:size(dateMat,1)
p(i)=dateDiff(dateMat(i,1:3),dateMat(i,4:6));
end
daysVector = p;
end
when I run it on the command window I received this message: Error in dateDiffMatrix (line 2) p=zeros(size(datMat,1),1);
Can you help me understand what is wrong with the code? thank you very much.
  댓글 수: 2
Jan
Jan 2013년 3월 25일
Please use meaningful tags. All questions in a Matlab forum concern "matlab", and almost all concern "matlab code". Thanks.

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

답변 (1개)

Ilham Hardy
Ilham Hardy 2013년 3월 25일
Hi,
datMat is suppossed to be dateMat
  댓글 수: 2
googo
googo 2013년 3월 25일
hoo :) thank's!
Image Analyst
Image Analyst 2013년 3월 25일
Please mark the answer that best answers your questions as "Accepted." Do so for all your other questions too.

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

카테고리

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