필터 지우기
필터 지우기

What this means sum( time(i,1:i-1) ) ?

조회 수: 3 (최근 30일)
Ami
Ami 2011년 6월 4일
time is a 5X5 matrix I want to know what means time(i,1:i-1) , I'm new at matlab
But I mean what does i,1:1-1 do whit the matrix, I know the results that this send, but I want to know like, It means that is taking the data from the matrix at.... something like that, thanks...

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 6월 4일
See it yourself: type the following lines one at time at the Matlab command window
time=magic(5)
i=4
time(i,1:i-1)
sum(time(i,1:i-1))
  댓글 수: 2
Matt Fig
Matt Fig 2011년 6월 4일
Or, perhaps:
time = magic(5)
for ii = 1:5
T = time(ii,1:ii-1)
sum(T)
end
Run this and look at the output...
Fangjun Jiang
Fangjun Jiang 2011년 6월 4일
Good catch, Matt! I changed the value of i from 1 to 4 to avoid confusion.

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

추가 답변 (0개)

카테고리

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