Multiple inputs using dialog box then inputs are placed into equation to get an output?

1 visualizzazione (ultimi 30 giorni)
I am trying to use the input dialog box to calcuate an equation. I know how to use the single input function and creating a function file that would accept multiple inputs but I don't want to use either of those.
% Ask user to input force, height and length of weld.
dlgtitle = 'Inputs';
prompt = {'Force (lbf)', 'Weld Height (in)', 'Weld Length (in)'};
dims = [1, 35];
[P_bw, h_bw, L_bw] = inputdlg(prompt, dlgtitle, dims);
sigma_bw = P_bw / (h_bw * L_bw);

Risposte (1)

Walter Roberson
Walter Roberson il 18 Gen 2021
sigma_bw = str2double(P_bw) ./ (str2double(h_bw) .* str2double(L_bw));

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by