?? assign.m
字號:
function assign(dict)% ASSIGN Assigns values to GP variables as given in the input cell array.%% ASSIGN( gp_vars_values ) takes as the input a cell array of% specified GP variables along with their values, and assigns% each of the variables to its value.%% gp_vars_values: n-by-2 cell array of GP variable names and values% % Example: gp_vars_values = {'x' 1; 'y' 2; 'w' ones(25,1)}% then, assign( gp_vars_values ) will transform GP variables% x y w from gpvars into doubles.%sz = size(dict);if( ~isa(dict,'cell') || sz(2) ~= 2 ) error('The input argument should be a cell array with 2 columns.');endfor k = 1:sz(1) assignin('base',dict{k,1},dict{k,2});%% % added support for structures (rasha's patch 01/26/06)%% if ~strcmp(dict{k,1},'') %% disp([dict{k,1} '=' num2str(dict{k,2}) ';']);%% evalin('caller',[dict{k,1} '=' num2str(dict{k,2}) ';']);%% endend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -