Doubles Output in Matrix?
Ältere Kommentare anzeigen
New to Matlab so please forgive me. I'm trying to create a matrix, mom, that updates with data from the 4th column of each file that's read:
myDir = uigetdir;
my_mom_Files = dir(fullfile(myDir,'MRFbeam-Mom-*.txt'));
mom = [];
for k = 1:length(my_mom_Files)
baseFileName = my_mom_Files(k).name;
fullFileName = fullfile(myDir, baseFileName);
%fprintf(1, 'Now reading %s\n', fullFileName);
mom_data = load(fullFileName);
mom_col = mom_data(:, 4);
mom = [mom; {mom_col}];
end
The output is as follows:
{ 6181×1 double}
{ 7849×1 double}
{ 3107×1 double}
{ 3107×1 double}
{ 2999×1 double}
{ 2999×1 double}
{ 2000×1 double}
{ 2000×1 double}
{ 2999×1 double}
{ 2999×1 double}
{ 4425×1 double}
{ 6181×1 double}
{ 4425×1 double}
{ 2499×1 double}
{ 2499×1 double}
{11293×1 double}
{11293×1 double}
{29980×1 double}
{29980×1 double}
{ 4825×1 double}
{ 4825×1 double}
{ 1123×1 double}
{ 1123×1 double}
{ 2225×1 double}
{ 2225×1 double}
{ 2221×1 double}
{ 2221×1 double}
{ 7849×1 double}
When I try cell2mat, the size of my matrix changes from 28 x 1 to in the thousands.
Ultimately I would like to print the value found for each file and store it in a matrix. My final goal is to plot these values.
TYIA
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!