How to plot a selected parameter off a list box?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Chamath Vithanawasam
el 30 de Jul. de 2018
Editada: Chamath Vithanawasam
el 31 de Jul. de 2018
I am creating a GUI that collects data from a group of .txt files. These text files have multiple sets of values, where I only need one of them plotted at any given time. So the intention is to select a value, and then press the 'plot' button, and see that value get plotted.
There is a label to the right of the listbox that displays the name of the y-axis value which is selected. This is done using the following coding.
function GUI_for_log_OpeningFcn(hObject, eventdata, handles, varargin)
evalin('base','clear all');
evalin('base','clc');
listString = get(handles.listbox3,'String');
assignin('base','listString',listString);
the listbox code is as shown
function listbox3_Callback(hObject, eventdata, handles)
listValue = get(handles.listbox3,'Value');
assignin('base','listValue',listValue);
listString = evalin('base','listString');
set(handles.text4,'String',listString(listValue,1));
How do I manage to plot the y-axis values after selecting it from the list box? Currently the pushbutton will plot a hardcoded y-axis value, but I wish for that to be changed from the GUI.
function pushbutton1_Callback(hObject, eventdata, handles)
a = getappdata(0,'totData');
axes(handles.axes1);
plot((a{:,1}),(a{:,8}));
Where 'totData' is a table which holds all of the imported file data in one table. I am attaching two of the files where the raw data is obtained from.
3 comentarios
Chamath Vithanawasam
el 31 de Jul. de 2018
Editada: Chamath Vithanawasam
el 31 de Jul. de 2018
Respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!