Hello, I'm working on a gui and I need to have a dynamique Matrix that will allow me to store the user values, I will have a button and 4 text box the user should write 4 values on the textbox and each time he will push a button, I should store my 4 value on the next raw of my matrice so i'll have 4 column and M raw, so my M row will be dynamic.
if you have some exemples that would be perfect . thank's in advance

 Akzeptierte Antwort

Guillaume
Guillaume am 16 Jul. 2018
Bearbeitet: Guillaume am 16 Jul. 2018

0 Stimmen

A = [1 2 3;
4 5 6]
newrow = [7 8 9];
%add a row to existing matrix:
A = [A; newrow]
%or
%A(end+1, :) = newrow

3 Kommentare

omar Benamiar Messari
omar Benamiar Messari am 16 Jul. 2018
Bearbeitet: omar Benamiar Messari am 16 Jul. 2018
yeh it's working even if i'm not satisfied because i don't have a start matrix, but perhaps i can create a 0 array and i can add my resutlts for the first button click than i'll use your method next click
A = [];
newrow = [7 8 9];
%add a row:
A = [A; newrow]
omar Benamiar Messari
omar Benamiar Messari am 16 Jul. 2018
ow thank you so much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Vector Fields finden Sie in Hilfe-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