필터 지우기
필터 지우기

Martix is getting updated with the value of e,Without adding a new column, Please help me.

조회 수: 1 (최근 30일)
persistent eWithDeltaL;
eWithDeltaL = [];
eWithDeltaL(end+1) = e;

채택된 답변

Walter Roberson
Walter Roberson 2016년 6월 2일
You are overwriting eWithDeltaL with [] every time. You should have the assignment of [] to the variable only when you know that you want to reset the variable.
  댓글 수: 2
kintali narendra
kintali narendra 2016년 6월 2일
Is there any other way to define the variable and to get it updated.
Walter Roberson
Walter Roberson 2016년 6월 2일
When you declare a variable as persistent, it is automatically assigned [] if it does not already exist. You do not need to initialize it to [] unless you want to reset it.

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

추가 답변 (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