'2013/04/03'에 해당되는 글 4건

  1. 2013.04.03 Button에 Running 표시
  2. 2013.04.03 GUI Compile
  3. 2013.04.03 uigetfile / uiputfile
  4. 2013.04.03 uigetfile
카테고리 없음2013. 4. 3. 22:32

function [] = pb_call(varargin)

h = varargin{1}; % Get the caller's handle.

col = get(h,'backg');  % Get the background color of the figure.

set(h,'str','RUNNING...','backg',[1 .6 .6]) % Change color of button. 

% The pause (or drawnow) is necessary to make button changes appear.

% To see what this means, try doing this with the pause commented out.

pause(.01)  % FLUSH the event queue, drawnow would work too.

% Here is where you put whatever function calls or processes that the

% pushbutton is supposed to activate. 

% Next we simulate some running process.  Here just sort a vector.

A = rand(30000000,1);

A = sort(A); %#ok 

set(h,'str','Push Me','backg',col)  % Now reset the button features.

Posted by 오늘보다 나은 내일
카테고리 없음2013. 4. 3. 11:10

deploytool 을 사용하면 쉽게 standalone file 생성 가능

Posted by 오늘보다 나은 내일
카테고리 없음2013. 4. 3. 00:42

!----------------------------------------------------------

! uigetfile

!----------------------------------------------------------

[file_name,file_path] = uigetfile('*.txt','Select Input File');
if (file_name ~=0)
    full_name=sprintf('%s%s',file_path,file_name);
    fid=fopen(full_name,'rw');
    data=fscanf(fid,'a %g %g %g %g ',[4,inf]);
    data=data';
    fclose(fid);   
else
    return
end

 

!----------------------------------------------------------

! uiputfile

!----------------------------------------------------------

[file_name,file_path] = uiputfile('*.txt','Save data As');
if (file_name ~=0)
    full_name=sprintf('%s%s',file_path,file_name);
    fid=fopen(full_name,'rw');
    fprintf(fid,'%d %d %d \n',data' );
    fclose(fid);   
else
    return
end

 

!----------------------------------------------------------

! multiple file select

!----------------------------------------------------------

[file,path] = uigetfile('*.txt','load data file','Multiselect','on');

 

!----------------------------------------------------------

! data in out

!----------------------------------------------------------

data=load('file_name.txt');

file_name = sprintf('%d.txt',str2double('xxxxxxx'));

 

 

t=linspace(0:100:100); 

f=@(t) 10*exp(-0.25*t).*sin(t-4);

 

Posted by 오늘보다 나은 내일
카테고리 없음2013. 4. 3. 00:17

Syntax

filename = uigetfile
[FileName,PathName,FilterIndex] = uigetfile(FilterSpec)
[FileName,PathName,FilterIndex] = uigetfile(FilterSpec,DialogTitle)
[FileName,PathName,FilterIndex] = uigetfile(FilterSpec,DialogTitle,DefaultName)
[FileName,PathName,FilterIndex] = uigetfile(...,'MultiSelect',selectmode)

Description

filename = uigetfile displays a modal dialog box that lists files in the current folder and enables you to select or enter the name of a file. If the file name is valid and the file exists, uigetfile returns the file name as a string when you click Open. Otherwise uigetfile displays an appropriate error message, after which control returns to the dialog box. You can then enter another file name or click Cancel. If you click Cancel or close the dialog window, uigetfile returns 0.

 
Posted by 오늘보다 나은 내일