Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

input with structures

조회 수: 2 (최근 30일)
Özgür Karagülle
Özgür Karagülle 2012년 5월 17일
답변: Voss 2021년 12월 31일
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 ?

답변 (1개)

Voss
Voss 2021년 12월 31일
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{:});

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by