Matlab help! Reading in a file with a variable filename

  1. The problem statement, all variables and given/known data:
    I want to read in a file, and plot the data in matlab. However, I do not like hardwiring filenames into my codes, so I always give the user the option to specify what the filename is. I am pretty inexperienced with matlab, so I have no idea how to do this!

  2. Relevant commands, code, scripts, algorithms:

My algorithm is as such:

Ask for the user to specify the filename they want to open,
have the script open the specified file,
plot the data.

  1. The attempts at a solution (include all code and scripts):

clear,clc;

char file [20];
file = input('What is the filename you would like to read?');

fopen file;

and

clear,clc;

file = input('~~~~')

fopen file;

  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

Iowa State University
Ames, IA usa
Ganesh Rajagopalan
AerE 261

---------- Post updated at 10:49 PM ---------- Previous update was at 09:50 PM ----------

Actually, I discovered a "uigetfile" command, so I got that down.

However, i'm having trouble assigning those values to variables.

I've tried the following:

[a, b, c] =

and

a = filename(:,1);

How do I assign the values in each column to a matrix of values?