Importing Data Using Function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
itend
am 18 Aug. 2017
Kommentiert: Walter Roberson
am 18 Aug. 2017
Hello,
I have a set of data, each file is in .spe format. The function readSPE reads these files and outputs a 3D array.
I would like to write a script which would convert each of the .spe files to a 3D array with variable name = file name.
Please help! Thanks :)
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 18 Aug. 2017
Why do you want to do this unwise thing?
How can you then have code that operates on that array if you don't know what the array will be called until runtime when the data file has been loaded?
I'd recommend you just call it data3d or something and not complicate things by having the variable have a name that changes depending on what data file you read in.
2 Kommentare
Walter Roberson
am 18 Aug. 2017
Yes, that is the wrong approach. Create the data into a temporary variable (that would have a constant name) and insert it into the overall array or structure without having stored it into a variable named after the file. You could always keep around a cell array of names and corresponding offsets if you needed to.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!