How do I make a string that is inputed into something I can use. I am using uigetfile then uiimport to import an incomplete table, I want to be able to call on the table that was chosen to remove and add things, but the variable is a string.
Show older comments
x=uigetfile('.txt');
uiimport(x);
y= x(1,2)
5 Comments
Bob Thompson
on 5 Sep 2018
What are you hoping to call with x(1,2)? All that is going to do is call part of the name of the file you selected.
Alberto Morales
on 5 Sep 2018
Edited: Alberto Morales
on 5 Sep 2018
Bob Thompson
on 5 Sep 2018
Hmm, my importing gave me a number of variables which contained the data, so maybe double check that you are looking at the right variable? I don't really use uiimport ever.
I'm not entirely sure what you mean by "incomplete table." If you are saying that you only want to import a certain range of the values then you might look into textscan or textread. I believe both of those allow you to select ranges, or at least define a number of initial columns and rows to ignore.
Alberto Morales
on 6 Sep 2018
Bob Thompson
on 6 Sep 2018
What do you mean by, "But in the rest of the code I can't call on the data?" Does it give you an error? If so, what kind of error?
Answers (0)
Categories
Find more on Tables 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!