How to create an interactive menu in the command window?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone! I need to make this code smarter and more interactive. In particular, I would like the user to select the presence or absence of panels in the command window; for example in the following code in addition to the body of the object (a cube so 6 facets) there are two panels (each of these two panels has 2 planes, therefore 4 total planes and therefore a matrix u_normale_panels 4x3 ). Each of these panels has an area of 20 m^2 and a reflectivity of 0.8. I would like the user to choose IN THE COMMAND WINDOW whether or not there are additional panels(and consequently the total number of facets), their area (area panels) and their reflectivity (rho_panels)in order to obtain the elements that I have defined as u_normale, rho and area in the code.
1 Kommentar
Rik
am 31 Okt. 2021
Why did you edit away your code?
%% Geometric characteristics of the spacecraft
height = 600000; % m
number_facets = 10; %object + panels
u_normale_body = [1,0,0; ...
-1,0,0; ...
0,1,0; ...
0,-1,0; ...
0,0,1; ...
0,0,-1];
u_normale_panels = [1,0,0; ...
-1,0,0; ...
1,0,0; ...
-1,0,0];
u_normale = [u_normale_body; u_normale_panels];
rho_body = [0.5,0.5,0.5,0.5,0.5,0.5];
rho_panels = [0.8,0.8,0.8,0.8];
rho = [rho_body,rho_panels];
area_facets = [9,9,9,9,9,9]; %m^2
area_panels = [20,20,20,20]; % m^2
area = [area_facets,area_panels];
Antworten (1)
Rik
am 30 Okt. 2021
doc input
Although in general a GUI will be nicer for your user. For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.
2 Kommentare
Rik
am 31 Okt. 2021
Have you read the linked page? GUI is short for graphical user interface, so it is a way to give your user a visual way to interact with the functions you created.
Siehe auch
Kategorien
Mehr zu MATLAB Coder 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!