nav-left cat-right
cat-right
Matthias Pospiech > Articles by: pospiech

Tulips

Tulips in the living room. The pictures might look like painted, but they were actually looking like...

waitbar with cancel button

The following code is an example for a loop function with a waitbar that allows canceling of the loop with the cancel button: Note however that a waitbar consumes very much time. Depending on the code this can slow down the calculation significantly. if numel(indices) > 1 hWait = waitbar(0,'1', ... 'Name','Exporting Plots ...', ... 'CreateCancelBtn', ... 'setappdata(gcbf,''canceling'',1)'); cleanupWaitbar...

radiobuttons in a buttongroup

In matlab one has to place radiobuttons in a uibuttongroup to make them exclusively selectable. In the startup of the gui one can select the default selection and define a callback function set(handles.uibuttongroupView, 'SelectedObject', handles.radiobuttonPlotROI); set(handles.uibuttongroupView, 'SelectionChangeFcn',@uibuttongroupView_SelectionChangeFcn); The callback function then looks like function...

enable zoom in gui

Matlab provides the function of making axes zoomable in a gui (zoom reference). In a matlab gui this is enable by using this code: hZoom = zoom; setAllowAxesZoom(hZoom,handles.axes,true);...

change extension of filename

Very often I tend to save the results of a file under the same name, but with a modified extension. This code shows how to achieve this % change extension [~, ~, ext] = fileparts(FileName); FileName = strrep(FileName, ext, '-xyz.png'); If the file should be saved under a different folder it needs to be created and the file name changed accordingly [filepath, filename, ext] =...
Seite 4 von 28« Erste...23456...1020...Letzte »