필터 지우기
필터 지우기

How to create an interactive menu in the command window?

조회 수: 11 (최근 30일)
Loren99
Loren99 2021년 10월 30일
댓글: Rik 2021년 10월 31일
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
Rik
Rik 2021년 10월 31일
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];

댓글을 달려면 로그인하십시오.

답변 (1개)

Rik
Rik 2021년 10월 30일
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
Loren99
Loren99 2021년 10월 30일
@Rik I don't have familiarity with GUI. Could you explain me how can I adapt it to my code and my requests? Thanks in advance
Rik
Rik 2021년 10월 31일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by