필터 지우기
필터 지우기

More efficient code for placing variables in one line?

조회 수: 1 (최근 30일)
Brian
Brian 2013년 5월 3일
Hi,
I've been looking for a while but I can t find any solution. Is there surely a better way than this to define elements:
j= j+1;
MMG(j, 1)=j;
MMG(j, 2)=1;
MMG(j, 3)=xc + r
MMG(j, 4)=xc - r
MMG(j, 5)=yc + r
MMG(j, 6)=yc - r
Apologies, this is probably basic, I couldn't find anything

채택된 답변

the cyclist
the cyclist 2013년 5월 3일
편집: the cyclist 2013년 5월 3일
MMG(j,1:6) = [j,1,xc+r,xc-r,yc+r,yc-r];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by