I am trying to write a matlab gui code that will load data from CSV file and plot graph. And every time, I will load data by clicking the load data button, the plot should refresh and plot the new data. I was able to load data and plot first graph. However, If I click on the load data button second time and it loads data from different CSV file but it plots on the top of the first graph. I do not know how to refresh that graph every I load data and save it in a file new gui file . Please help me out. This is the first time I am working with Gui interface. I am posting my Load data callback function below. and Gui interface as .jpg attachment. Thank you.
function shiva_Callback(hObject, eventdata, handles)
hold off
% load data
%plot
yyaxis left
loglog(t,a,'b')
hold on
loglog(t,t,'r')
loglog(t,d,'c')
loglog(t,,'m')
ylabel('% Text')
xlabel('T')
yyaxis right
loglog(t,s,'y')
loglog(t,st,'g')
function ma_Callback(hObject, eventdata, handles)
% i tried uisave but not possible to run computer without matlab cause mcr
% does not run uisave
% i tried copyopbj but since i did not put a name on my figure it did not
% work