Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Ingrid
Posts:
1
Registered:
6/25/13


Extracting data from cell array
Posted:
Jun 25, 2013 4:29 AM


I'm importing data from a file, and it imports as a nx1 cell array. To use the data, i need to store each row into different variables, and split up the strings into date, number, and so on. Using deal, i can assign different variables [a b c d.....]=deal(sorted_end{:}), but is there a way to make the length of the [a b c d...] vector vary without having to write in each letter for every time the length of the data file changes?
CODE: % Importing the data and analyzing it delimiterIn = '\t'; getfile = uigetfile('C:\Users\franziska\Desktop\Ingrid\MATLAB\\*.*'); data = importdata(getfile,delimiterIn);
%Size of data n = size(data); N = n(1); entry = N/4;
%Size of sorted cell array without header sorted = sort(data); sorted_end = sorted(1:endentry); m = size(sorted_end); M = m(1); [a b c d e f] = deal(sorted_end{:});



