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

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.

Answers (1)

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 Comments

Thank u Cris, for your suggestion. I'm able to get the output using pop-ups for this project. The main difficulty is I'm only able to give the data at starting itself. But I want the dynamic output for every input. This is where i'm finding difficulty. And another difficulty is i'm unable to format the app design as similar as the image i sent.
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

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Edited:

on 29 Mar 2024

Community Treasure Hunt

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

Start Hunting!