Calculation of a sum with variable values from textbox prompt
Ältere Kommentare anzeigen
Hi,
I'm looking to get an user input on amount of Resistors, then make an array with that number. Then make a prompt with an input for each resistor value, to be added to the array.
My concrete question is in regards to the prompting, how do i get multiple edit fields in the promt, and connect them to the array,
also accept suggestions for the summing too.
Formula i wish to calculate:
Code so far:
clc, clear, close all;
prompt = {'Enter number of resistors:'};
dlgtitle = 'Number of resistors';
dims = [1 35];
definput = {'1'};
Resistors = inputdlg(prompt,dlgtitle,dims,definput);
R_array = zeros(1,str2double(Resistors(1)))
3 Kommentare
Mario Malic
am 4 Sep. 2023
Use the uitable component.
Dyuman Joshi
am 4 Sep. 2023
"how do i get multiple edit fields in the promt"
You will get the inputs in the form of a cell array, manipulate them according to your requirements.
sverre Kvist
am 4 Sep. 2023
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
