필터 지우기
필터 지우기

Info

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

Values in the loop are overwritten

조회 수: 1 (최근 30일)
swati mane
swati mane 2019년 8월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello sir ..my code is:
for i=1:1:4; S=M(1:1,i)./20; valueOfB(j)=S; end
I should get 4 different values of S. But same value i am getting four times. Where M is taken for frames 1 to 25...26 to 50 ...51 to 75 and so on.and for M i am getting correct values. And j = 1:25:100.
Thanks in advance.
  댓글 수: 4
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 8월 3일
편집: KALYAN ACHARJYA 2019년 8월 3일
It's OK, minor modification
valueOfB=zeros(1,4);
for i=1:1:4
valueOfB(i)=M(1,i)/20;
end
Or
valueOfB=M(1,1:4)./20; % Without loop
swati mane
swati mane 2019년 8월 5일
Yes its working.thanks a lot @ kalyan acharjya

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by