필터 지우기
필터 지우기

move values from uneven size matrix

조회 수: 1 (최근 30일)
Bathrinath
Bathrinath 2014년 5월 7일
답변: Andrei Bobrov 2014년 5월 7일
I have created 100x6 matrix with zeros. I need to move the first row of gbestseq to first row of globbestseq and remaining rows in globbestseq has to be zero. Here matrix sizes are not same.Suggest some points
n=6; gbestseq=[1,3,2,5,4,6; 2,3,1,4,6,5; 3,2,1,5,4,6;]; globbestseq=zeros(100,n);

채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 5월 7일
globbestseq(1,:) = gbestseq(1,:);

추가 답변 (0개)

카테고리

Help CenterFile 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