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;
댓글 수: 0
채택된 답변
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
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 Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!