how to add element in vector?

2 Ansichten (letzte 30 Tage)
Rohit Bhoi
Rohit Bhoi am 28 Feb. 2016
Kommentiert: Jan am 28 Feb. 2016
I have a gui in which there is one edit text box and two buttons namely add and save. I have created on blank vector as v=[]; whenever user press add the value of edit text should be added to the vector? how to do that?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 28 Feb. 2016
v=[]
a=10
v=[v a]
  3 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 28 Feb. 2016
use guidata function
Jan
Jan am 28 Feb. 2016
@Azzi: I think the code is meaningless, because the v does not have any effects here. The OP inserted this exactly as posted into his code, such that v=10 is performed in every case.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by