Pre-populate boxes in a prompt window?
조회 수: 8 (최근 30일)
이전 댓글 표시
I have only just in the last month or so learnt how to use MATLAB. I'm currently trying to make a basic GUI for a series of race car dynamics calculations.
I'm using questdlg and inside one case, a prompt. User assigns numbers for variables, and the calculations are completed and results displayed in a msgbox. When button is pressed, user is asked if they want to see results on a line graph, then asked if they want to see some other results on a bar chart.
Finally user is asked if they want to change any values. If yes is selected, code steps back to the start of the while loop where the prompt box is created and opened.
I want the boxes in this prompt to contain the numbers they original input, so changing just one and seeing the change in results is easy.
Can I do this? If so, how? I have avoided GUIDE as I want a very short simple script (240 lines inc. comments currently)
댓글 수: 0
채택된 답변
Star Strider
2015년 11월 25일
I would consider using the listdlg function the second time. It would allow the user to select the variable to be changed, then you could go to perhaps inputdlg to change it, and then continue with your simulation.
There are likely more sophisticated ways to design GUIs to do what you want, but I also generally use the simple ones, since I’m the only one using my applications at present. (If necessary, I would develop a more friendly GUI user interface for anything I submitted to the File Exchange. Just now, none of them need GUIs.)
댓글 수: 11
Star Strider
2015년 11월 27일
No worries. It’s documented in the Help tab at the top of the page, but not obvious unless you look for it. (The ‘Help’ icon above the text window only deals with markup.)
I would like to see your code when you get it working to your satisfaction. We’re all learning here. Please document it extensively with comments so that I and others (and you if you want to modify it later) can easily understand how it works. I can also learn something about vehicle dynamics.
I did. Thank you!
I had one other thought with respect or your prospective employer. If they’re doing everything with Excel and you know and are proficient with MATLAB, you’ll walk on water there! You’ll have to convince them to buy MATLAB and the necessary toolboxes and Simulink, so also have all the information as to what is necessary and the costs and licensing options at hand when you interview. Contact MathWorks directly and ask them for the details.
And explore the xlsread and related functions when you have the opportunity. Looks as though you’ll be using them often!
추가 답변 (1개)
Image Analyst
2015년 11월 25일
Don't be afraid of GUIDE. It's not that hard and can make some things easier. Perhaps you'd like to get started with this easy-to-use generic framework. http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component
Description This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images, select one or more images and display them, to select a series of options, and to individually or batch process one or more images. The user can
댓글 수: 4
Image Analyst
2015년 11월 26일
You haven't shown much - probably not the full code. But what little I see, as an employer, is simple, primitive code. I see someone who just wanted to do something quick and dirty to get an answer but really wasn't interested in writing professional code worthy of selling to the general public or my customers. Could you write a professional program - something with the GUI sophistication of Word, Excel, Powerpoint, or Photoshop? Who know - maybe you can and maybe you can't. I would not be able to determine that from the snippet you gave. I certainly would not be impressed at that code, at least not enough to hire you based on your ability to write robust professional looking software - there's just nothing there to demonstrate that. Graphic designers, artists, and fashion designers have portfolios of their work - illustrations of what they've designed. Do you have that? I'd maybe be impressed if you showed me 20 screenshots of GUIs of different programs that you designed. Or if you could tell me that you have 6,000 users of your application, or that you have 8 applications for sale to the general public - something like that.
When I hired an image processing Ph.D. we looked at dozens of resumes, telephone interviewed about a dozen, and brought in 3 or 4, and ultimately hired one. They all said they knew MATLAB. One even said that he taught MATLAB. So I asked them all a simple question. I said I had a white substrate with dark stain on it and different images had different amounts of stain cleared away, so their area fractions were different. I told them I wanted to know the area fraction of white and dark, and I had good control over the lighting. I asked them how they would do it in MATLAB. This is about as basic as you can get. You'd be surprised how many or them could not solve the problem. Some of them didn't even know about regionprops() - which is THE number one main function of the entire Image Processing Toolbox. Most of them came up with wrong algorithms - nonsense like graythresh(), etc. And these were Ph.D.s who were supposed to be MATLAB experts. Only one got the right answer and that was with me throwing a few hints his way.
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!