Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

input with structures

1 Ansicht (letzte 30 Tage)
Özgür Karagülle
Özgür Karagülle am 17 Mai 2012
Beantwortet: Voss am 31 Dez. 2021
Domain.x='xxxxx'; Domain.y='18 May 2012'; Domain.z='zzz'; Domain.t='tttttt';
Hi, i know how i make structure like up. But i dont know how i can use input function and take "x","y","z","t" variables from users with my GUI ?

Antworten (1)

Voss
Voss am 31 Dez. 2021
I don't know what your GUI does, but here's one way to do it using the input() function:
f = {'x' 'y' 'z' 't'};
args = [f; cellfun(@(x)input(sprintf('Enter %s: ',x),'s'),f,'UniformOutput',false)];
Domain = struct(args{:});

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by