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.

x=uigetfile('.txt');
uiimport(x);
y= x(1,2)

5 Comments

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.
Yes I know, I was hoping to call a number in the incomplete table I uploaded. Also if you have a better way on how to upload an incomplete table, that would really help.
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.
Yes, it imports the data. But in the rest of the code I can't call on the data in the rest of the code. What I mean by incomplete table is the columns in the first row do not match that of any other row, and therefore I can not use load() to load the data, I must import the data. Also I have not been successful with the import() function as well.
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?

Sign in to comment.

Answers (0)

Categories

Products

Release

R2018a

Asked:

on 5 Sep 2018

Commented:

on 6 Sep 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!