Changeset 881 for trunk/src/plot_field.m
- Timestamp:
- Mar 6, 2015, 9:10:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r880 r881 299 299 300 300 % data need to be displayed in a table 301 if strcmp(get(htext,'Type'),'uitable')% display data in a table302 VarNameCell=cell(1,numel(VarIndex));% prepare list of variable names to display (titles of columns)303 VarLength=zeros(1,numel(VarIndex)); % default number of values for each variable304 for ivar=1:numel(VarIndex)305 VarNameCell{ivar}=FieldData.ListVarName{VarIndex(ivar)};306 VarLength(ivar)=numel(FieldData.(VarNameCell{ivar}));307 end308 set(htext,'ColumnName',VarNameCell)309 Data=cell(max(VarLength),numel(VarIndex));% prepare the table of data display310 311 for ivar=1:numel(VarIndex)312 VarValue=FieldData.(VarNameCell{ivar});313 VarValue=reshape(VarValue,[],1);% reshape values array in a column314 Data(1:numel(VarValue),ivar)=num2cell(VarValue);315 end316 set(htext,'Data',Data)317 end301 % if strcmp(get(htext,'Type'),'uitable')% display data in a table 302 % VarNameCell=cell(1,numel(VarIndex));% prepare list of variable names to display (titles of columns) 303 % VarLength=zeros(1,numel(VarIndex)); % default number of values for each variable 304 % for ivar=1:numel(VarIndex) 305 % VarNameCell{ivar}=FieldData.ListVarName{VarIndex(ivar)}; 306 % VarLength(ivar)=numel(FieldData.(VarNameCell{ivar})); 307 % end 308 % set(htext,'ColumnName',VarNameCell) 309 % Data=cell(max(VarLength),numel(VarIndex));% prepare the table of data display 310 % 311 % for ivar=1:numel(VarIndex) 312 % VarValue=FieldData.(VarNameCell{ivar}); 313 % VarValue=reshape(VarValue,[],1);% reshape values array in a column 314 % Data(1:numel(VarValue),ivar)=num2cell(VarValue); 315 % end 316 % set(htext,'Data',Data) 317 % end 318 318 % if numel(VarValue)>1 && numel(VarValue)<10 % case of a variable with several values 319 319 % for ind=1:numel(VarValue) … … 577 577 %% give statistics for pdf 578 578 %ind_var=find(testplot); 579 TableData={'Variable';'SampleNbr';'bin size';'Mean';'RMS';'Skewness';'Kurtosis'; ' centered ';...579 TableData={'Variable';'SampleNbr';'bin size';'Mean';'RMS';'Skewness';'Kurtosis';... 580 580 'Min';'FirstCentile';'FirstDecile';'Median';'LastDecile';'LastCentile';'Max'}; 581 581 … … 587 587 pdf_val=data.(data.ListVarName{CellInfo{icell}.VarIndex_histo}); 588 588 x=coord_x{icell}; 589 590 Val=pdf2stat(x',pdf_val'); 591 592 Column=mat2cell(Val,ones(13,1),1); 593 Column=[{VarName};Column(1:6);{'stat: --'};Column(7:13)]; 589 if isrow(x) 590 x=x'; 591 end 592 if ~isequal(size(x,1),size(pdf_val,1)) 593 pdf_val=pdf_val'; 594 end 595 Val=pdf2stat(x,pdf_val); 596 Column=mat2cell(Val,ones(13,1),ones(1,size(Val,2))); 597 if size(Val,2)==1%single component 598 TitleBar={VarName}; 599 else 600 TitleBar=cell(1,size(Val,2)); 601 for icomp=1:size(Val,2) 602 TitleBar{icomp}=[VarName '_' num2str(icomp)]; 603 end 604 end 605 Column=[TitleBar;Column]; 594 606 TableData=[TableData Column]; 595 607 end
Note: See TracChangeset
for help on using the changeset viewer.