![]() %# fileparts splits file_input into name and extension. %# uigetfile reads the name of a file and stores it in file_input, for example 'mydata.dat' I'll comment your code so that you can see what is happening where.Īlso, I suggest adding (for debugging purposes) two more disps as indicated so you'll see what is going on. Some_other_fcn(dataStruct.(fileName)) %# When loaded with UIIMPORT to a struct ![]() If you needed to pass the loaded data to another function, or use it in any other way, you can do the following: some_other_fcn(eval(fileName)) %# When loaded with UIIMPORT to a variable You could also do this using the option to output the data from UIIMPORT as a structure where the data is stored in a field (with the file name as the default field name): dataStruct = uiimport(dataFile) %# Put the data in a structĭataSize = size(dataStruct.(fileName)) %# Get the size of the data = fileparts(dataFile) %# Get the file nameĭataSize = size(eval(fileName)) %# Get the size of the dataĭisp(dataSize(2)) %# Display the columns numbers with no header text), so the following should work if you don't change the name of the variable storing the file data: uiimport(dataFile) %# Load the data By default, the variable name is the name of the file you loaded if your file contains only one kind of data (i.e. Secondly, when you use UIIMPORT you can choose the name for the variable that you want the file data to be loaded into. You can do this with the function FULLFILE: dataFile = fullfile(pathname,file_input) Firstly, you need to combine file_input and pathname together to create the full path to the file you want.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |