-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function [A, B] = bfn_trim_nonchar(C) | ||
% BFN_TRIM_NONCHAR Trimming the beginning non-char elements from a cell. | ||
% | ||
% Syntax: | ||
% [A, B] = bfn_trim_nonchar(C) | ||
% | ||
% Description: | ||
% It separates a cell into both a cell containing successive non-char | ||
% elements and a cell whose first element has the char format. | ||
% | ||
% Input Arguments: | ||
% C - a cell. | ||
% | ||
% Output Arguments: | ||
% A - a cell which contains successive non-char elements | ||
% A - a cell whose first element is formatted as char. | ||
% | ||
%__________________________________________________________________________ | ||
% Wonsang You(wsgyou@gmail.com) | ||
% $ Id: bfn_trim_nonchar.m 0028 2013-03-12 00:13:18 brainfnet $ | ||
% Copyright (c) 2011 Brainfnet. | ||
|
||
A = {}; B = {}; | ||
|
||
N = length(C); | ||
for i = 1:N | ||
if ischar(C{i}) | ||
B = C(i:end); | ||
return | ||
else | ||
A{i} = C{i}; | ||
end | ||
end |