Create a different output for every document that is imported
Show older comments
Hey, I got a function that imports all the text documents from a file and creates a variable with all of them. What I wanted is to get a variable for each document. Here is the code:
dades = [];
for i=0:1:23
%x=sprintf('%00d',i)
fname = '2021030100'+string(sprintf('%00d',i))+'AIS.txt';
temp = importfileAIS(fname)';
dades = [dades', temp]';
end
How could I do it. I know that all the files go to the same variable(dades) because I wrote it, but I do not know how to write what I asked.
3 Comments
flashpode
on 19 Sep 2021
Why don't just create a matrix? Each column is a variable
dades = [dades temp(:)];
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!