Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
persistent eWithDeltaL;
eWithDeltaL = [];
eWithDeltaL(end+1) = e;

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Jun. 2016
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 Kommentare
kintali narendra
kintali narendra am 2 Jun. 2016
Is there any other way to define the variable and to get it updated.
Walter Roberson
Walter Roberson am 2 Jun. 2016
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by