My program has checkbox 1 and checkbox 2.
If checkbox 1 is selected and then checkbox 2 is selected, I want to make the message box pop up.
So I have to the call the checkbox1's value in function of checkbox2.
I tried to use 'get' at first, and then 'xlsread'. Because I saved the checkbox1's data to excel. But an error occurred and this code doesn't work.
It says XLSREAD could not open file 'name1.xls'. File xls Not found.
The code I upload now contains only the parts that are not error-prone.
What should I do?
function checkbox2_Callback(hObject, eventdata, handles)if(get(handles.checkbox2,'Value')) t2=clock; DataString2=datestr(t2); minusfine1=floor(((t2(4)-19)*60 + t2(5))/30)*1000; if (minusfine1)>0total1=fine1-minusfine1; %%%I need to call the value of fine1 which is checkbox1's value
f=msgbox({'Todays Total fine is',total1}); else minusfine1=0;total1=fine1-minusfine1; %%%I need to call the value of fine1 which is checkbox1's value f=msgbox({'Todays Total fine is',total1}); endxlswrite('name1.xlsx',minusfine1,'sheet1','B');xlswrite('name1.xlsx',total1,'sheet1','C'); end
Best Answer