Can you add a prompt that asks how many unknowns are in the simultaneous equations and selects a section from the code to answer the specific problem?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Obed James
am 4 Mai 2021
Kommentiert: Obed James
am 7 Mai 2021
I got an idea for an assignment. Involving the use of matlab to find unknown values x and y, basic simultaneous equation. But also with in that same program i want add the option to find x,y and z and have the option to select if i just want to find x,y (a normal simultaneous equation problem) or x,y and z (a more complex simultaneous equation problem). Can that be done? And what code would i have to use to select which section to run and which one to not run?
0 Kommentare
Akzeptierte Antwort
Scott MacKenzie
am 4 Mai 2021
Your question suggests an arrangement something like this:
n = input('Enter number of unknowns: ');
switch n
case 1
disp('One');
% put code here for 1 unknown
case 2
disp('Two');
% put code here for 2 unknown
case 3
disp('Three');
% put code here for 3 unknown
end
disp('Bye');
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!