How to Update matrix values

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일

0 개 추천

b = {};
a=[1 2;3 4]
for i=1:1:100;
a=a+1;
b = [b a];
end

추가 답변 (1개)

Walter Roberson
Walter Roberson 2013년 1월 2일

0 개 추천

A = A + 1;

댓글 수: 4

a=[1 2;3 4]
for i=1:100;
a(i)=a(i)+1;
end
How to see the each update value
a=[1 2;3 4]
for i=1:1:100;
a=a+1
end
Here I want to see the a values for each step of i,,,which is saved in the array of a(i)
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

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

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

Community Treasure Hunt

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

Start Hunting!

Translated by