mergecellkey: Merge cell by key

Version 1.0.0.0 (7,13 ko) par Renwen Lin
mergecellkey: Merge cell by key
324 téléchargements
Mise à jour 9 nov. 2012

Afficher la licence

function cellB = mergecellskey(varargin)
% PURPOSE: merge cells
% -----------------------------------------------------------------------------
% SYNTAX:
% (1) C = mergecellskey(A,B,{'key1','key2'});
% (2) C = mergecellskey(A1,A2,A3, {'key1'});
% -----------------------------------------------------------------------------
% OUTPUT:
% (1) A new cell contain all columns of the cells
% -----------------------------------------------------------------------
% INPUT:
% (1) cells: NxM --->several cell containing M columns. Each cell
% should contains a colomn with 'key' on the headline
% (2) keys: 1xM ---> a cell containing the keys, it should string cell.
% NB: no string can be include in the file.

% -----------------------------------------------------------------------
% LIBRARY: showcell
% -----------------------------------------------------------------------
% SEE ALSO: join
% -----------------------------------------------------------------------
% REFERENCE: join, eval
% -----------------------------------------------------------------------
% written by:
% Lin Renwen
% <linrenwen@gmail.com>

% Version 1.0 [2012-11-9 11:55:15]

%=============================================
% EXAMPLE:
% A = {'Year', 1979, 1980 1981 1982 ; 'a' ,1,5,2, 4; 'c', '4', '3', '4','9yy'}';
% B = {'Year', 1980 1981 1982 1983; 'a' ,NaN,2,4,7 ; 'c', '3', '4', '677','pp'}';
% C = mergecellskey(A,B,{'Year'});
% showcell(C);
% % END OF EXAMPLE
%=============================================

Citation pour cette source

Renwen Lin (2024). mergecellkey: Merge cell by key (https://www.mathworks.com/matlabcentral/fileexchange/38982-mergecellkey-merge-cell-by-key), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2011a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Characters and Strings dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0.0