MATLAB Answers

How to put a name on each double variable in a cell array"

3 views (last 30 days)
Fan Yang
Fan Yang on 12 Mar 2020
Edited: James Tursa on 12 Mar 2020
Hi guys,
I am trying to load all the data, as a numberic array, into a cell array K, but I wand to be able to identity which file the data came from which require me to name all numeric array in the cell array. How can I do that?

  0 Comments

Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 12 Mar 2020
You could have an associated cell array for the file names. E.g.,
fnames{i,j} = fn;

  2 Comments

Fan Yang
Fan Yang on 12 Mar 2020
Would that require me to create a seperate cell array? It would be great if all the data and associated names are in the same cell array.
Best,
Fan Yang
James Tursa
James Tursa on 12 Mar 2020
K{i,j,1} = t; % although K{i,j} = t will do the same thing
K{i,j,2} = fn;

Sign in to comment.

More Answers (0)