Using uigetfile to read in MATLAB array - index exceeds number of array elements
Mostrar comentarios más antiguos
Hi, I'm trying to do somthing that should be quite simple :)
I just want to read in a *.mat file which contains an array using uigetfile and then plot two of the columns of the array against each other.
This is the code:
function ReadDataButtonPushed(app, event)
[file, path] = uigetfile;
if isequal(file,0)
msgbox('Please input data')
else
Data = load(fullfile(path, file));
X = Data(:,2);
Y = Data(:,3);
plot(app.UIAxes, X, Y);
end
I get the error message 'Index exceeds the number of array elements (1).'
Can someone tell me what I am doing wrong? Many thanks.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!