필터 지우기
필터 지우기

Change column in array

조회 수: 16 (최근 30일)
nty huy
nty huy 2019년 9월 27일
편집: KALYAN ACHARJYA 2019년 9월 27일
Arr= [ 5 5 5 5 ; 5 5 5 5; 5 5 5 5 ; 5 5 5 5; 5 5 5 5]
how to change all elements in a column to a diffrent number?

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 27일
편집: KALYAN ACHARJYA 2019년 9월 27일
Arr=[5 5 5 5 ; 5 5 5 5; 5 5 5 5 ; 5 5 5 5; 5 5 5 5];
% First column number change the 10
Arr(:,1)=10
%Do the same for others
Result:
Arr =
10 5 5 5
10 5 5 5
10 5 5 5
10 5 5 5
10 5 5 5
You can do multiple column elements change with single assignments also

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by