new2.m

来自「vTools is a toolbox for Matlab 5.3 devel」· M 代码 · 共 49 行

M
49
字号
function new2
%NEW2 : callback del bottone "SAVE MATRIX" 
% Salvataggio nuova matrice
% 
% Massimo Davini   28/05/99 revised 19/03/00

global stack;

go=1;
matrice=findobj('tag','matrice');

for i=1:length(matrice)
   if isempty(str2num(get(matrice(length(matrice)+1-i),'string')))
      go=0;
   else
      coeff(i)=str2num(get(matrice(length(matrice)+1-i),'string'));
   end;
end;

if go==1  
%-----parametri consistenti
 ind=stack.temp.matrice;       %indice della matrice visualizzata   
 switch ind
 case 1, label='A';
 case 2, label='B';
 case 3, label='C';
 case 4, label='D';
 end;

 eval(sprintf('[row,col]=size(stack.temp.%s);',label));
 matrix=zeros(row,col);
 for i=1:row , for j=1:col
       matrix(i,j)=coeff(j+(i-1)*col);
 end; end;
 eval(sprintf('stack.temp.%s=matrix;',label));
 eval(sprintf('stack.temp.flag%s=1;',label));
   
 set(stack.temp.handles(13+ind),'string',sprintf('[ %s ]',label));
   
 if (stack.temp.flagA)&(stack.temp.flagB)&...
             (stack.temp.flagC)&(stack.temp.flagD)
   stack.general.model='Untitled.mat';
   stack.general.A=stack.temp.A;  stack.general.B=stack.temp.B; 
   stack.general.C=stack.temp.C;  stack.general.D=stack.temp.D;
   stack.general.M_flag=1;          %flag di nuovo sistema
      
   stack.evaluation=[];  stack.simulation=[];
      
   %ind 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?