i want to create an array (like Profit(n1) and Sale(n1)), when push button is pressed, but the problem is when button is pressed only current value is store at 'n1' but the previous values remove from array and become zero. plz help in this regard..
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
function PB1_Callback(hObject, eventdata, handles)
% hObject handle to PB1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clc;
handles.counter = handles.counter + 1; % Counter
n1 = handles.counter;
% get the string data from the three edit controls
str1 = str2num(get(handles.ET2,'String')); % Code
str2 = str2num(get(handles.ET3,'String')); % Price
str3 = str2num(get(handles.ET4,'String')); % Count
% do some work
Profit(n1) = (str2 - (str1 - 203)) * str3; % Calculate Profit
Sale(n1) = str2; %calculate Sale
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!