Skip to content

Commit

Permalink
Added a decoding function.
Browse files Browse the repository at this point in the history
  • Loading branch information
wonsang committed Aug 8, 2017
1 parent b896427 commit ffdd02c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Release Notes

Version 1.4 (08-08-2017)
* Added a function bfn_trim_nonchar.

Version 1.3 (06-17-2017)
* Fixed a minor error.

Version 1.2 (06-07-2017)
* Enabled fractal connectivity.

Expand Down
33 changes: 33 additions & 0 deletions m/bfn_trim_nonchar.m
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

0 comments on commit ffdd02c

Please sign in to comment.