Quantcast

Documentation Center

  • Trial Software
  • Product Updates

export2wsdlg

Export variables to workspace

Syntax

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport)
export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title)
export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected)
export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected,helpfunction)
export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected,helpfunction,functionlist)
hdialog = export2wsdlg(...)
[hdialog,ok_pressed] = export2wsdlg(...)

Description

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport)
creates a dialog with a series of check boxes and edit fields. checkboxlabels is a cell array of labels for the check boxes. defaultvariablenames is a cell array of strings that serve as a basis for variable names that appear in the edit fields. itemstoexport is a cell array of the values to be stored in the variables. If there is only one item to export, export2wsdlg creates a text control instead of a check box.

    Note:   By default, the dialog box is modal. A modal dialog box prevents the user from interacting with other windows before responding.

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title)
creates the dialog with title as its title.

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected)
creates the dialog allowing the user to control which check boxes are checked. selected is a logical array whose length is the same as checkboxlabels. True indicates that the check box should initially be checked, false unchecked.

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected,helpfunction)
creates the dialog with a help button. helpfunction is a callback that displays help.

export2wsdlg(checkboxlabels,defaultvariablenames,
itemstoexport,title,selected,helpfunction,functionlist)
creates a dialog that enables the user to pass in functionlist, a cell array of functions and optional arguments that calculate, then return the value to export. functionlist should be the same length as checkboxlabels.

hdialog = export2wsdlg(...) returns the handle of the dialog.

[hdialog,ok_pressed] = export2wsdlg(...) sets ok_pressed to true if the OK button is pressed, or false otherwise. If two return arguments are requested, hdialog is [] and the function does not return until the dialog is closed.

The user can edit the text fields to modify the default variable names. If the same name appears in multiple edit fields, export2wsdlg creates a structure using that name. It then uses the defaultvariablenames as field names for that structure.

The lengths of checkboxlabels, defaultvariablenames, itemstoexport and selected must all be equal.

The strings in defaultvariablenames must be unique.

Examples

This example creates a dialog box that enables the user to save the variables sumA and/or meanA to the workspace. The dialog box title is Save Sums to Workspace.

A = randn(10,1);
checkLabels = {'Save sum of A to variable named:' ...
               'Save mean of A to variable named:'}; 
varNames = {'sumA','meanA'}; 
items = {sum(A),mean(A)};
export2wsdlg(checkLabels,varNames,items,...
             'Save Sums to Workspace');
Was this topic helpful?