Sie sind auf Seite 1von 28

MATLAB desktop keyboard shortcuts, such as Ctrl+S, are now customizable.

In addition, many keyboard shortcuts have changed for improved consistency across the desktop.

To customize keyboard shortcuts, use Preferences. From there, you can also restore previous default settings by selecting "R2009a Windows Default Set" from the "Active settings" drop-down list. For more information, see Help.

Click here if you do not want to see this message again.

Warning: Icon must be 'custom' when specifying icon data in MSGBOX > In msgbox at 112 In deneme6>pushbutton3_Callback at 120 In gui_mainfcn at 96 In deneme6 at 42 In @(hObject,eventdata)deneme6('pushbutton3_Callback',hObject,eventdata,guidata(hObject)) Warning: Input should be a string. > In strcat at 84 In deneme6>pushbutton1_Callback at 88 In gui_mainfcn at 96 In deneme6 at 42 In @(hObject,eventdata)deneme6('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Warning: Input should be a string. > In strcat at 92 In deneme6>pushbutton1_Callback at 88 In gui_mainfcn at 96

In deneme6 at 42 In @(hObject,eventdata)deneme6('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) ??? Error using ==> imread at 363 File "" does not exist.

Error in ==> deneme6>pushbutton1_Callback at 88 im = imread(strcat(PathName,FileName));

Error in ==> gui_mainfcn at 96 feval(varargin{:});

Error in ==> deneme6 at 42 gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)deneme6('pushbutton1_Callback',hObject,eventdata,guidata(hObject))

??? Error while evaluating uicontrol Callback

82 if nargout K>> nargout

ans =

82 if nargout

K>> nargout

ans =

>> help uigetfile UIGETFILE Standard open file dialog box. [FILENAME, PATHNAME, FILTERINDEX] = UIGETFILE(FILTERSPEC, TITLE) displays a dialog box for the user to fill in, and returns the filename and path strings and the index of the selected filter. A successful return occurs only if the file exists. If the user selects a file that does not exist, an error message is displayed, and control returns to the dialog box. The user may then enter another filename, or press the Cancel button.

The FILTERSPEC parameter determines the initial display of files in the dialog box. For example '*.m' lists all the MATLAB M-files. If FILTERSPEC is a cell array, the first column is used as the list of extensions, and the second column is used as the list of descriptions.

When FILTERSPEC is a string or a cell array, "All files" is appended to the list.

When FILTERSPEC is empty the default list of file types is used.

Parameter TITLE is a string containing the title of the dialog box.

The output variable FILENAME is a string containing the name of the file selected in the dialog box. If the user presses Cancel, it is set to 0.

The output variable PATHNAME is a string containing the path of the file selected in the dialog box. If the user presses Cancel, it is set to 0.

The output variable FILTERINDEX returns the index of the filter selected in the dialog box. The indexing starts at 1. If the user presses Cancel, it is set to 0.

[FILENAME, PATHNAME, FILTERINDEX] = UIGETFILE(FILTERSPEC, TITLE, FILE) FILE is a string containing the name to use as the default selection.

[FILENAME, PATHNAME] = UIGETFILE(..., 'MultiSelect', SELECTMODE) specifies if multiple file selection is enabled for the UIGETFILE dialog. Valid values for SELECTMODE are 'on' and 'off'. If the value of 'MultiSelect' is set to 'on', the dialog box supports multiple file selection. 'MultiSelect' is set to 'off' by default.

The output variable FILENAME is a cell array of strings if multiple filenames are selected. Otherwise, it is a string representing the selected filename.

[FILENAME, PATHNAME] = UIGETFILE(..., 'Location', [X Y]) places the

dialog box at screen position [X,Y] in pixel units. This option is supported on UNIX platforms only. NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED

[FILENAME, PATHNAME] = UIGETFILE(..., X, Y) places the dialog box at screen position [X,Y] in pixel units. This option is supported on UNIX platforms only. NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.

Examples:

[filename, pathname, filterindex] = uigetfile('*.m', 'Pick an M-file');

[filename, pathname, filterindex] = uigetfile( ... {'*.m;*.fig;*.mat;*.mdl', 'All MATLAB Files (*.m, *.fig, *.mat, *.mdl)'; '*.m', 'M-files (*.m)'; ... '*.fig','Figures (*.fig)'; ... '*.mat','MAT-files (*.mat)'; ... '*.mdl','Models (*.mdl)'; ... '*.*', 'All Files (*.*)'}, ... 'Pick a file');

[filename, pathname, filterindex] = uigetfile( ... {'*.mat','MAT-files (*.mat)'; ... '*.mdl','Models (*.mdl)'; ... '*.*', 'All Files (*.*)'}, ... 'Pick a file', 'Untitled.mat');

Note, multiple extensions with no descriptions must be separated by semicolons.

[filename, pathname] = uigetfile( ... {'*.m';'*.mdl';'*.mat';'*.*'}, ... 'Pick a file');

Associating multiple extensions with one description:

[filename, pathname] = uigetfile( ... {'*.m;*.fig;*.mat;*.mdl', 'All MATLAB Files (*.m, *.fig, *.mat, *.mdl)'; ... '*.*', 'Pick a file'); 'All Files (*.*)'}, ...

Enabling multiple file selection in the dialog:

[filename, pathname, filterindex] = uigetfile( ... {'*.mat','MAT-files (*.mat)'; ... '*.mdl','Models (*.mdl)'; ... '*.*', 'All Files (*.*)'}, ... 'Pick a file', ... 'MultiSelect', 'on');

This code checks if the user pressed cancel on the dialog.

[filename, pathname] = uigetfile('*.m', 'Pick an M-file');

if isequal(filename,0) || isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) end

See also uigetdir, uiputfile.

Reference page in Help browser doc uigetfile

??? Error using ==> imwrite at 393 Unable to determine the file format from the filename.

Error in ==> deneme6>pushbutton2_Callback at 105 imwrite(im,strcat(PathName,FileName));

Error in ==> gui_mainfcn at 96 feval(varargin{:});

Error in ==> deneme6 at 42 gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)deneme6('pushbutton2_Callback',hObject,eventdata,guidata(hObject))

??? Error while evaluating uicontrol Callback

>> help uiputfile UIPUTFILE Standard save file dialog box. [FILENAME, PATHNAME, FILTERINDEX] = UIPUTFILE(FILTERSPEC, TITLE) displays a dialog box for the user to fill in and returns the filename and path strings and the index of the selected filter. A successful return occurs if a valid filename is specified. If an existing filename is specified or selected, a warning message is displayed. The user may select Yes to use the filename or No to return to the dialog to select another filename.

The FILTERSPEC parameter determines the initial display of files in the dialog box. For example '*.m' lists all the MATLAB M-files. If FILTERSPEC is a cell array, the first column is used as the list of extensions, and the second column is used as the list of descriptions.

When FILTERSPEC is a string or a cell array, "All files" is appended to the list.

When FILTERSPEC is empty the default list of file types is used.

When FILTERSPEC is a filename, it is used as the default filename and the file's extension is used as the default filter.

Parameter TITLE is a string containing the title of the dialog box.

The output variable FILENAME is a string containing the name of the file selected in the dialog box. If the user presses Cancel, it is set to 0.

The output variable PATH is a string containing the name of the path selected in the dialog box. If the user presses Cancel, it is set to 0.

The output variable FILTERINDEX returns the index of the filter selected in the dialog box. The indexing starts at 1. If the user presses Cancel, it is set to 0.

[FILENAME, PATHNAME, FILTERINDEX] = UIPUTFILE(FILTERSPEC, TITLE, FILE) FILE is a string containing the name to use as the default selection.

[FILENAME, PATHNAME] = UIPUTFILE(..., 'Location', [X Y]) places the dialog box at screen position [X,Y] in pixel units. This option is supported on UNIX platforms only. NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.

[FILENAME, PATHNAME] = UIPUTFILE(..., X, Y) places the dialog box at screen position [X,Y] in pixel units. This option is supported on UNIX platforms only. NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.

Examples:

[filename, pathname] = uiputfile('matlab.mat', 'Save Workspace as');

[filename, pathname] = uiputfile('*.mat', 'Save Workspace as');

[filename, pathname, filterindex] = uiputfile( ... {'*.m;*.fig;*.mat;*.mdl', 'All MATLAB Files (*.m, *.fig, *.mat, *.mdl)'; '*.m', 'M-files (*.m)'; ... '*.fig','Figures (*.fig)'; ... '*.mat','MAT-files (*.mat)'; ... '*.mdl','Models (*.mdl)'; ... '*.*', 'All Files (*.*)'}, ... 'Save as');

[filename, pathname, filterindex] = uiputfile( ... {'*.mat','MAT-files (*.mat)'; ... '*.mdl','Models (*.mdl)'; ... '*.*', 'All Files (*.*)'}, ... 'Save as', 'Untitled.mat');

Note, multiple extensions with no descriptions must be separated by semicolons.

[filename, pathname] = uiputfile( ... {'*.m';'*.mdl';'*.mat';'*.*'}, ... 'Save as');

Associate multiple extensions with one description like this:

[filename, pathname] = uiputfile( ... {'*.m;*.fig;*.mat;*.mdl', 'All MATLAB Files (*.m, *.fig, *.mat, *.mdl)'; ... '*.*', 'Save as'); 'All Files (*.*)'}, ...

This code checks if the user pressed cancel on the dialog.

[filename, pathname] = uiputfile('*.m', 'Pick an M-file'); if isequal(filename,0) || isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) end

See also uigetdir, uigetfile.

Reference page in Help browser doc uiputfile

??? Error using ==> rgb2gray>parse_inputs at 82 MAP must be a m x 3 array.

Error in ==> rgb2gray at 35 X = parse_inputs(varargin{:});

Error in ==> deneme6>pushbutton1_Callback at 83

im = rgb2gray(im);

Error in ==> gui_mainfcn at 96 feval(varargin{:});

Error in ==> deneme6 at 42 gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)deneme6('pushbutton1_Callback',hObject,eventdata,guidata(hObject))

??? Error while evaluating uicontrol Callback

Warning: Icon must be 'custom' when specifying icon data in MSGBOX > In msgbox at 112 In deneme6>pushbutton3_Callback at 117 In gui_mainfcn at 96 In deneme6 at 42 In @(hObject,eventdata)deneme6('pushbutton3_Callback',hObject,eventdata,guidata(hObject)) >> help msgbox MSGBOX Message box. msgbox(Message) creates a message box that automatically wraps Message to fit an appropriately sized Figure. Message is a string vector, string matrix or cell array.

msgbox(Message,Title) specifies the title of the message box.

msgbox(Message,Title,Icon) specifies which Icon to display in the message box. Icon is 'none', 'error', 'help', 'warn', or 'custom'. The default is 'none'.

msgbox(Message,Title,'custom',IconData,IconCMap) defines a customized icon. IconData contains image data defining the icon; IconCMap is the colormap used for the image.

msgbox(Message,...,CreateMode) specifies whether a message box is modal or non-modal. Valid values for CreateMode are 'modal', 'non-modal', and 'replace'. If CreateMode is 'modal' or 'replace', the first available message box with the specified title is updated to reflect the new properties of the message box. All other such message boxes are deleted. If CreateMode is 'non-modal', the message-box is not replaced and a new handle is created. The default value for CreateMode is 'non-modal'.

CreateMode may also be a structure with fields WindowStyle and Interpreter. WindowStyle may be any of the values above. Interpreter may be 'tex' or 'none'. The default value for the Interpreter is 'none';

h = msgbox(...) returns the handle of the box in h.

To make msgbox block execution until the user responds, include the string 'modal' in the input argument list and wrap the call to msgbox with UIWAIT.

Examples: %An example which blocks execution until the user responds: uiwait(msgbox('String','Title','modal'));

%An example using a custom Icon is: Data=1:64;Data=(Data'*Data)/64; h=msgbox('String','Title','custom',Data,hot(64))

%An example which reuses the existing msgbox window: CreateStruct.WindowStyle='replace'; CreateStruct.Interpreter='tex'; h=msgbox('X^2 + Y^2','Title','custom',Data,hot(64),CreateStruct);

See also dialog, errordlg, helpdlg, inputdlg, listdlg, questdlg, textwrap, uiwait, warndlg.

Reference page in Help browser doc msgbox

WARNDLG Warning dialog box. HANDLE = WARNDLG(WARNSTRING,DLGNAME) creates an warning dialog box which displays WARNSTRING in a window named DLGNAME. A pushbutton labeled OK must be pressed to make the warning box disappear.

HANDLE = WARNDLG(WARNSTRING,DLGNAME,CREATEMODE) allows CREATEMODE options that are the same as those offered by MSGBOX. The default value for CREATEMODE is 'non-modal'.

WarnString will accept any valid string input but a cell array is preferred.

WARNDLG uses MSGBOX. Please see the help for MSGBOX for a full description of the input arguments to WARNDLG.

Examples: f = warndlg('This is an warning string.', 'My Warn Dialog');

f = warndlg('This is an warning string.', 'My Warn Dialog', 'modal');

See also dialog, errordlg, helpdlg, inputdlg, listdlg, msgbox, questdlg.

Reference page in Help browser doc warndlg

INPUTDLG Input dialog box. ANSWER = INPUTDLG(PROMPT) creates a modal dialog box that returns user input for multiple prompts in the cell array ANSWER. PROMPT is a cell array containing the PROMPT strings.

INPUTDLG uses UIWAIT to suspend execution until the user responds.

ANSWER = INPUTDLG(PROMPT,NAME) specifies the title for the dialog.

ANSWER = INPUTDLG(PROMPT,NAME,NUMLINES) specifies the number of lines for each answer in NUMLINES. NUMLINES may be a constant value or a column vector having one element per PROMPT that specifies how many lines per input field. NUMLINES may also be a matrix where the first column specifies how many rows for the input field and the second column specifies how many columns wide the input field should be.

ANSWER = INPUTDLG(PROMPT,NAME,NUMLINES,DEFAULTANSWER) specifies the default answer to display for each PROMPT. DEFAULTANSWER must contain the same number of elements as PROMPT and must be a cell array of strings.

ANSWER = INPUTDLG(PROMPT,NAME,NUMLINES,DEFAULTANSWER,OPTIONS) specifies additional options. If OPTIONS is the string 'on', the dialog is made resizable. If OPTIONS is a structure, the fields Resize, WindowStyle, and Interpreter are recognized. Resize can be either 'on' or 'off'. WindowStyle can be either 'normal' or 'modal'. Interpreter can be either 'none' or 'tex'. If Interpreter is 'tex', the prompt strings are rendered using LaTeX.

Examples:

prompt={'Enter the matrix size for x^2:','Enter the colormap name:'}; name='Input for Peaks function'; numlines=1; defaultanswer={'20','hsv'};

answer=inputdlg(prompt,name,numlines,defaultanswer);

options.Resize='on'; options.WindowStyle='normal'; options.Interpreter='tex';

answer=inputdlg(prompt,name,numlines,defaultanswer,options);

See also dialog, errordlg, helpdlg, listdlg, msgbox, questdlg, textwrap, uiwait, warndlg .

Reference page in Help browser doc inputdlg

QUESTDLG Question dialog box. ButtonName = QUESTDLG(Question) creates a modal dialog box that automatically wraps the cell array or string (vector or matrix) Question to fit an appropriately sized window. The name of the button that is pressed is returned in ButtonName. The Title of the figure may be specified by adding a second string argument:

ButtonName = questdlg(Question, Title)

Question will be interpreted as a normal string.

QUESTDLG uses UIWAIT to suspend execution until the user responds.

The default set of buttons names for QUESTDLG are 'Yes','No' and 'Cancel'. The default answer for the above calling syntax is 'Yes'. This can be changed by adding a third argument which specifies the default Button:

ButtonName = questdlg(Question, Title, 'No')

Up to 3 custom button names may be specified by entering the button string name(s) as additional arguments to the function call. If custom button names are entered, the default button must be specified by adding an extra argument, DEFAULT, and setting DEFAULT to the same string name as the button you want to use as the default button:

ButtonName = questdlg(Question, Title, Btn1, Btn2, DEFAULT);

where DEFAULT is set to Btn1. This makes Btn1 the default answer. If the DEFAULT string does not match any of the button string names, a warning message is displayed.

To use TeX interpretation for the Question string, a data structure must be used for the last argument, i.e.

ButtonName = questdlg(Question, Title, Btn1, Btn2, OPTIONS);

The OPTIONS structure must include the fields Default and Interpreter. Interpreter may be 'none' or 'tex' and Default is the default button

name to be used.

If the dialog is closed without a valid selection, the return value is empty.

Example:

ButtonName = questdlg('What is your favorite color?', ... 'Color Question', ... 'Red', 'Green', 'Blue', 'Green'); switch ButtonName, case 'Red', disp('Your favorite color is Red'); case 'Blue', disp('Your favorite color is Blue.') case 'Green', disp('Your favorite color is Green.'); end % switch

See also dialog, errordlg, helpdlg, inputdlg, listdlg, msgbox, warndlg, figure, textwrap, uiwait, uiresume.

Reference page in Help browser doc questdlg

>> imagesc(I) >> mymask = roipoly;

>> figure >> imagesc(mymask) >> figure >> imagesc(I.*mymask) ??? Error using ==> times Integers can only be combined with integers of the same class, or scalar doubles.

>> imagesc(I.*double(mymask)) ??? Error using ==> times Integers can only be combined with integers of the same class, or scalar doubles.

>> imagesc(double(I).*double(mymask)) >> mymaskedim = (double(I).*double(mymask)); >> sum(sum(mymaskedim))

ans =

205761

>> a=[1 2 3; 4 5 6; 7 8 9]

a=

1 4 7

2 5 8

3 6 9

>> sum(a)

ans =

12 15 18

>> sum(sum(a))

ans =

45

>> help sum SUM Sum of elements. S = SUM(X) is the sum of the elements of the vector X. If X is a matrix, S is a row vector with the sum over each column. For N-D arrays, SUM(X) operates along the first non-singleton dimension. If X is floating point, that is double or single, S is accumulated natively, that is in the same class as X, and S has the same class as X. If X is not floating point, S is accumulated in double and S has class double.

S = SUM(X,DIM) sums along the dimension DIM.

S = SUM(X,'double') and S = SUM(X,DIM,'double') accumulate S in double and S has class double, even if X is single.

S = SUM(X,'native') and S = SUM(X,DIM,'native') accumulate S natively and S has the same class as X.

Examples: If X = [0 1 2 3 4 5]

then sum(X,1) is [3 5 7] and sum(X,2) is [ 3 12];

If X = int8(1:20) then sum(X) accumulates in double and the result is double(210) while sum(X,'native') accumulates in int8, but overflows and saturates to int8(127).

See also prod, cumsum, diff, accumarray, isfloat.

Overloaded methods: timeseries/sum codistributed/sum umat/sum ndlft/sum

Reference page in Help browser doc sum

>> sum(sum(a))

ans =

45

>> sum(sum(mymaskedim))

ans =

205761

>> sum(sum(mymask))

ans =

1955

>> maskedave = sum(sum(mymaskedim))/sum(sum(mymask))

maskedave =

105.2486

>> [xx,yy] =ginput

xx =

233.6452

yy =

100.8348

>> figure(plot(I(round(yy),:))) ??? Error using ==> figure Requested figure handle in use by another object

>> figure;(plot(I(round(yy),:))) >> myim = zeros(256); >> myim(:, 127:129)=1; >> close all >> imagesc(myim) >> help imrotate IMROTATE Rotate image. B = IMROTATE(A,ANGLE) rotates image A by ANGLE degrees in a counterclockwise direction around its center point. To rotate the image clockwise, specify a negative value for ANGLE. IMROTATE makes the output image B large enough to contain the entire rotated image. IMROTATE uses nearest neighbor interpolation, setting the values of pixels in B that are outside the rotated image to 0 (zero).

B = IMROTATE(A,ANGLE,METHOD) rotates image A, using the interpolation method specified by METHOD. METHOD is a string that can have one of the

following values. The default value is enclosed in braces ({}).

{'nearest'} Nearest neighbor interpolation

'bilinear' Bilinear interpolation

'bicubic' Bicubic interpolation. Note: This interpolation method can produce pixel values outside the original range.

B = IMROTATE(A,ANGLE,METHOD,BBOX) rotates image A, where BBOX specifies the size of the output image B. BBOX is a text string that can have either of the following values. The default value is enclosed in braces ({}).

{'loose'} Make output image B large enough to contain the entire rotated image. B is generally larger than A.

'crop'

Make output image B the same size as the input image A, cropping the rotated image to fit.

Class Support ------------The input image can be numeric or logical. The output image is of the same class as the input image.

Performance Note

---------------This function may take advantage of hardware optimization for datatypes uint8, uint16, and single to run faster.

Example ------% This example brings image I into horizontal alignment by % rotating the image by -1 degree.

I = fitsread('solarspectra.fts'); I = mat2gray(I); J = imrotate(I,-1,'bilinear','crop'); figure, imshow(I), figure, imshow(J)

See also imcrop, imresize, imtransform, tformarray.

Reference page in Help browser doc imrotate

>> imb = imrotate(im, 6,'crop'); ??? Undefined function or variable 'im'.

>> imb = imrotate(myim, 6,'crop'); >> imagesc(imb) >> imnoise = randn(256); >> >> hist(imnoise)

??? >> hist(imnoise) | Error: Unexpected MATLAB operator.

>> hist(imnoise) >> imnoise = 0,1*randn(256);

imnoise =

>> imnoise = 0.1*randn(256); >> hist(imnoise) >> noisyim = imb + imnoise; >> imagesc(noisyim) >> [xx,yy] =ginput

xx =

127.0253

yy =

120.6404

>> figure;(plot(noisyim(round(yy),:)))

>>