Create an app using app designer in MATLAB. The app is used to collecting data and storing the data.

4 Ansichten (letzte 30 Tage)
I'm Creating an app for Collecting a data. For example: If we enter some numeric value for how many election boxes edit field, we should get that many election boxes and each election box have a serial number where the value should be entered. The each election box is filled with number of political party and for each political party how many people based on age('N' number of boxes and ask to upload excel files). Inside election box we should be able to write political party name and number of people for each political party should be in excel format.

Antworten (1)

Cris LaPierre
Cris LaPierre am 27 Mär. 2024
Bearbeitet: Cris LaPierre am 29 Mär. 2024
You will likely find the App Building Onramp extremely helpful in getting started with this project. It's free, interactive, and takes about 1 hour to complete.
  3 Kommentare
Vaibhavi Pallavaneni
Vaibhavi Pallavaneni am 29 Mär. 2024
Very sorry for the delayed relpy Cris. Here is the code. Please help
function EnterButtonPushed(app, event)
numElectionBoxes = app.NumberofElectionBoxesEditField.Value;
app.ElectionBoxes = zeros(1, numElectionBoxes);
app.Party = cell(1, numElectionBoxes);
app.People = cell(numElectionBoxes, 1);
% Get temperature values
for i = 1:numElectionBoxes
prompt = sprintf('Enter ElectionBox %d (K):', i);
app.ElectionBoxes(i) = str2double(inputdlg(prompt));
% Get number of SOC values for each temperature
numParty = str2double(inputdlg(sprintf('Enter number of Party values for ElectionBox %d:', i)));
app.PartyValues{i} = zeros(1, numParty);
app.NumPeople{i} = zeros(1, numParty);
% Get SOC values and number of cells for each SOC
for j = 1:numParty
app.PartyValues{i}(j) = str2double(inputdlg(sprintf('Enter Party value %d for ElectionBox %d (%%):', j, i)));
app.NumPeople{i}(j) = str2double(inputdlg(sprintf('Enter number of People for ElectionBox %d and Party %d:', i, j)));
end
end
% Update table
app.data = {};
for i = 1:numElectionBoxes
for j = 1:length(app.PartyValues{i})
app.data{end+1, 1} = app.ElectionBoxes(i);
app.data{end, 2} = app.PartyValues{i}(j);
app.data{end, 3} = app.NumPeople{i}(j);
end
end
app.UITable.ColumnEditable = true;
app.UITable.Data = app.data;
end
% Button pushed function: AddtotableButton
function AddtotableButtonPushed(app, event)
Temperature = app.TemperatureEditField.Value;
SOC = app.SOCEditField.Value;
Cell = app.CellEditField.Value;
nr = {Temperature SOC Cell};
app.UITable.Data = [app.data;nr];
app.data = app.UITable.Data;
end

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by