필터 지우기
필터 지우기

How to Update matrix values

조회 수: 11 (최근 30일)
Arun Badigannavar
Arun Badigannavar 2013년 1월 2일
I have a matrix[2 2:2 2]I want to update these four values one by one ie[3 3:3 3],[4 4:4 4],[5 5:5 5] like thgis I want to update ,,,how can i achieve this with script?

채택된 답변

Sriram
Sriram 2013년 1월 2일
b = {};
a=[1 2;3 4]
for i=1:1:100;
a=a+1;
b = [b a];
end
  댓글 수: 1
Arun Badigannavar
Arun Badigannavar 2013년 1월 2일
exactly what i wanted

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2013년 1월 2일
  댓글 수: 4
Walter Roberson
Walter Roberson 2013년 1월 2일
If you want to see each updated value, you could remove the semi-colon from the addition
a(i) = a(i) + 1 %no semi-colon
Arun Badigannavar
Arun Badigannavar 2013년 1월 2일
ya i know this ,,but i want to save the value of a(i) from i =1 to i=100

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by