Open data in File as per user input
Hello, I am trying to get input from user to load a file and then ask which variable from the file would they like to plot. The input file will be a .mat file and it is a 1×1 struct file with various 2 double series data in it.
When I run this, the error says: Unrecognized field name "x"
Here is my code:
filename=input(‘Input File Name n’,’s’);
file = load(filename);
x=string(input(‘Variable? n’,’s’));
plot(file.x)Hello, I am trying to get input from user to load a file and then ask which variable from the file would they like to plot. The input file will be a .mat file and it is a 1×1 struct file with various 2 double series data in it.
When I run this, the error says: Unrecognized field name "x"
Here is my code:
filename=input(‘Input File Name n’,’s’);
file = load(filename);
x=string(input(‘Variable? n’,’s’));
plot(file.x) Hello, I am trying to get input from user to load a file and then ask which variable from the file would they like to plot. The input file will be a .mat file and it is a 1×1 struct file with various 2 double series data in it.
When I run this, the error says: Unrecognized field name "x"
Here is my code:
filename=input(‘Input File Name n’,’s’);
file = load(filename);
x=string(input(‘Variable? n’,’s’));
plot(file.x) file, user input MATLAB Answers — New Questions