MATLAB Examples

Contents

convertTextCells.m

Converts non numeric cells to NaN Expects x to be a row of cells Returns a numeric array

function [y] = convertTextCells(x)

[n] = length(x);
y = zeros(n,1);

for i=1:1:n
    if(~ischar(x{i,1}))
        y(i,1) = x{i,1};
    else
        y(i,1) = NaN;
    end
end



end
Error using convertTextCells (line 8)
Not enough input arguments.

Copyright

Stephen Goldrick and Andrei Stefan University of Manchester, Newcastle University and Perceptive Engineering

All rights reserved. Copyright (c) Newcastle University, University of Manchester and Perceptive Engineering.