フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Return a structure kind output from a programmatic UI and then use this output to modify a settings parameters m-file

1 回表示 (過去 30 日間)
Christian Guitart
Christian Guitart 2016 年 2 月 22 日
閉鎖済み: Christian Guitart 2016 年 2 月 25 日
Hi everybody,
I am developing a programmatic UI that returns a structure kind output and then I want the output to be imported to a m-file in order to modify a m-file settings parameters.
function selpar
%SELPAR Summary of this function goes here
% Define struct
data = struct('chanBW', 1, 'modType', 1);
% Construct the components
f = figure('Visible','on','Name','selpar','Position',[360,200,450,285]);
%guidata(f,struct('chanBW',1.4,'modType',1));
pmchanBw = uicontrol(f,'Style','popupmenu', 'Callback', @select_chanBW,'String',{'1.4','3','5','10','15','20'},...
'Position',[30 80 130 20],'Tag','popumpmenu1');
pmod = uicontrol(f,'Style', 'popupmenu', 'Callback', @select_modulation, 'String', {'QPSK', '16QAM', '64QAM'},...
'Position',[30 120 130 20],'Tag','popupmenu2');
push = uicontrol(f, 'Style', 'pushbutton', 'Callback', @start_simulation, 'String', {'Start'},...
'Position',[250 60 40 20]);
%Write Callbacks
function select_chanBW(hObject, callbackdata)
chanString = hObject.String;
chanValue = hObject.Value;
switch chanString{chanValue}
case '1.4'
data.chanBW = 1;
case '3'
data.chanBW = 2;
case '5'
data.chanBW = 3;
case '10'
data.chanBW = 4;
case '15'
data.chanBW = 5;
case '20'
data.chanBW = 6;
end
end
function select_modulation(hObject, callbackdata)
modString = hObject.String;
modValue = hObject.Value;
switch modString{modValue}
case 'QPSK'
data.modType = 1;
case '16QAM'
data.modType = 2;
case '64QAM'
data.modType = 3;
end
end
function start_simulation(hObject, callbackdata)
display([data.chanBW data.modType]);
%Here has to be placed the code referred to export the structure data
%Call the main code (which reads the settings parameters m-file)
end
end
Thanks in advance.

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by