function fileList = getAllFiles(dirName)


  dirData = dir(dirName);      %# Get the data for the current directory

  dirIndex = [dirData.isdir];  %# Find the index for directories

  fileList = {dirData(~dirIndex).name}';  %'# Get a list of the files

  if ~isempty(fileList)

    fileList = cellfun(@(x) fullfile(dirName,x),...  %# Prepend path to files

                       fileList,'UniformOutput',false);

  end

  subDirs = {dirData(dirIndex).name};  %# Get a list of the subdirectories

  validIndex = ~ismember(subDirs,{'.','..'});  %# Find index of subdirectories

                                               %#   that are not '.' or '..'

  for iDir = find(validIndex)                  %# Loop over valid subdirectories

    nextDir = fullfile(dirName,subDirs{iDir});    %# Get the subdirectory path

    fileList = [fileList; getAllFiles(nextDir)];  %# Recursively call getAllFiles

  end 

end

http://erdinckuruoglu.files.wordpress.com/2011/03/flexible-electronics.pdf

http://www.q-korea.net/popup/popup_02/sub_main.html

x = 0:0.5:10;   y = sin(x);
plot(x,y,'ko-');
hold on
xi = 0:.25:10;
for i=1:size(xi,2)
    yi(i) = interp1(x,y,xi(i)); % default : linear
    % yi(i) = interp1(x,y,xi(i),'spline');
    plot(xi(i),yi(i),'rx');
    pause
end


 

 
다운로드

http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

 
블루스크린 및 기타 원인 확인 

MATLAB Compiler generated exe's can't read/use plain m files.

The only way to have interchangeable data is through a file, e.g. mat file.

 

 

Compiled Applications Do Not Process MATLAB Files at Runtime

The MATLAB Compiler was designed so that you can deploy locked down functionality. Deployable MATLAB files are suspended or frozen at the time MATLAB Compiler encrypts them—they do not change from that point onward. This does not mean that you cannot deploy a flexible application—it means that you must design your application with flexibility in mind. If you want the end user to be able to choose between two different methods, for example, they both must be compiled in.

The MCR only works on MATLAB code that was encrypted when the component was built. Any function or process that dynamically generates new MATLAB code will not work against the MCR.

Some MATLAB toolboxes, such as the Neural Network Toolbox™ product, generate MATLAB code dynamically. Because the MCR only executes encrypted MATLAB files, and the Neural Network Toolbox generates unencrypted MATLAB files, some functions in the Neural Network Toolbox cannot be deployed.

Similarly, functions that need to examine the contents of a MATLAB function file cannot be deployed.HELP, for example, is dynamic and not available in deployed mode. You can use LOADLIBRARY in deployed mode if you provide it with a MATLAB function prototype.

Instead of compiling the function that generates the MATLAB code and attempting to deploy it, perform the following tasks:

  1. Run the code once in MATLAB to obtain your generated function.

  2. Compile the MATLAB code with MATLAB Compiler, including the generated function.

Tip: Another alternative to using EVAL or FEVAL is using anonymous function handles. If you require the ability to create MATLAB code for dynamic run time processing, your end users must have an installed copy of MATLAB.

 

 

 

The only way is using mat file...

 [FileName,PathName] = uigetfile('*.mat','Prepare mat file'); % a is in the .mat file

fullname = fullfile(PathName,FileName);

load(fullname) 

set(handles.text1,'String',num2str(a(1:end)))

 

 

 

clear all clear clc

 

rasio = 0.6; x = [1 7]; delx = [0.1 0.1]; tol = [0.001 0.001]; n=length(x); Fopt=fungsi(x(1),x(2)); xopt=x;F=Fopt; disp([xopt Fopt])


%checking delta


chekdel=strcat('if delx(1)<=tol(1)&delx(2)<=tol(2);','disp([xopt Fopt]);'...

    ,'disp(delx);','else;','del=delx*rasio;','delx=del;','eval(eksplorasi);'...

    ,'end;');


%repeating success step


ulsuk=strcat('while Fopt<F;','disp([xopt Fopt]);','for i=1:n;',... 

    'x(i)=xopt(i)+delx(i)*tanda(i);','end;','F=fungsi(x(1),x(2));',... 

    'if F<=Fopt;','xopt=x;', 'Fopt=F;','else;','break;','end;','end;',... 

    'eval(eksplorasi)');


%exploration:


eksplorasi=strcat('for ep=1:n;','tanda(ep)=0;','x(ep)=xopt(ep)+delx(ep);',... 

    'Fd=fungsi(x(1),x(2));','if Fd<=Fopt;','xopt(ep)=x(ep);','Fopt=Fd;','tanda(ep)=1;',... 

    'else;','x(ep)=xopt(ep)-delx(ep);','Fd=fungsi(x(1),x(2));','if Fd<=Fopt;',... 

    'xopt(ep)=x(ep);','Fopt=Fd;','tanda(ep)=-1;','end;','end;','end;','disp([xopt Fopt]);',... 

    'if abs(tanda(1))>0|abs(tanda(2))>0;','eval(ulsuk);','else;','eval(chekdel);',... 

    'end;'); eval(eksplorasi);




The handle structure for GUI created with GUIDE are stored in the figure object for the main GUI menu.

gui1fig = open('FirstGui.fig');
gui2fig = open('SecondGui.fig');

Then if the first GUI needs to reference a handle that exists in the second GUI,

handles2 = getappdata(gui2fig);

and access handles2.TheHandleName

If need be, the second handles structure can be updated from the first GUI by using

setappdata(gui2fig, handles2)

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.

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

+ Recent posts