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 Center および File ExchangeGet Started with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by