필터 지우기
필터 지우기

using checkboxes to select planets used in planetary motion code

조회 수: 1 (최근 30일)
Bob Freeman
Bob Freeman 2013년 11월 7일
댓글: Bob Freeman 2013년 11월 7일
I want to create a GUI with check boxes so that the user can select which planets (for example the sun, earth and jupiter) to run through the code. I have my masses and other values for each planet stored in arrays in my code.
  댓글 수: 2
Simon
Simon 2013년 11월 7일
And the question is?
What did you try so far?
Bob Freeman
Bob Freeman 2013년 11월 7일
I have simply created a GUI with a list of checkboxes for the planets. I now want to program it so that when i run the GUI, I can choose which planets to include when I run the code, and so only the chosen planets will interact with each other. Is this possible? I have never used a GUI before...

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

답변 (2개)

Image Analyst
Image Analyst 2013년 11월 7일
You might try this framework:
to make your GUI development easier.

Simon
Simon 2013년 11월 7일
Hi!
Let's say you have 9 planets and 9 checkboxes. You need a logical vector of length 9. For each checkbox you define a callback function that sets the corrsponding value in your logical vector to 1 (if selected) or 0. When running your code you build your planetary matrix only with values of the selected planets.
  댓글 수: 1
Bob Freeman
Bob Freeman 2013년 11월 7일
This sounds confusing but also good, i'll see what I can do, Thanks!

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

카테고리

Help CenterFile Exchange에서 Earth and Planetary Science에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by