You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Whats wrong with tester_app_3?
8 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3086111
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3086111
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101761
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101761
- I shortened the code so you just have the possibility to choose two types of combination from the listbox in tester_app_3: CaCl2 MgCl2 ZnBr2 and NaCl2 KCl ZnBr2.
- When I start the tester_app_2 that leads me to tester_app_3, I choose the nr of zones to be 3 and the nr of salts to be 3. Then I choose this salt combination CaCl2 MgCl2 ZnBr2 and choose ME.
- As you can see , the program is not accumulating osmotic_table results since I am getting zeros in all rows instead of my results. I am supposed to get three rows as I had chosen nr of zones to be 3.
- Since I have this code in tester_app_3
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101771
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101771
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101966
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3101966
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103076
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103076
- I shortened the code so you just have the possibility to choose two types of combination from the listbox in tester_app_3: CaCl2 MgCl2 ZnBr2 and NaCl2 KCl ZnBr2.
- When I start the tester_app_2 that leads me to tester_app_3, I choose the nr of zones to be 3 and the nr of salts to be 3. Then I choose this salt combination CaCl2 MgCl2 ZnBr2 and choose ME.
- As you can see , the program is not accumulating osmotic_table results since I am getting zeros in all rows instead of my results. I am supposed to get three rows as I had chosen nr of zones to be 3.
- Since I have this code in tester_app_3
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103301
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103301
- Run tester_app2.mlapp
- Enter 3 for Nr of zones and 3 for Nr of salts
- Click Choose salts! button
- Selected CaCl2, MgCl2, and ZnBr2
- Clicked Start_analysis button
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103306
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3103306
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3104151
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3104151
Accepted Answer
- Do not to make a variable an app property unless it's necessary to do so. Generally it's only necessary if that variable needs to be shared among multiple apps (in which case it must be a public property) or multiple functions within one app (in which case it can be a private property). I found that most of your app properties were really only needed in one function, so those have been made into local variables in the function where they are used. You can see the list of app properties now to get an idea of the very few really necessary app properties in each app, and understand why those particular things need to be app properties.
- Error-check and validate a variable value before storing it as an app property. It makes your programming job easier if you know your app properties are always valid (and consistent with each other).
- In general, think about what the program needs to do when the user entered something invalid. Arguably more important than (as least equally as important as) doing the right thing when a good value is entered is not doing the wrong thing (i.e., crashing / generating an uncaught error) when a bad value is entered. In designing GUIs you have to give plenty of thought to all the bad states the program can get into, not only the one good state where everything is fine.
16 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3123766
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3123766
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3123946
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3123946
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3164126
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3164126
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165096
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165096
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165376
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165376
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165656
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3165656
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3193246
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3193246
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3199746
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3199746
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200661
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200661
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200666
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200666
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200696
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200696
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200746
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3200746
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3201716
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3201716
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3201776
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3201776
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3204661
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3204661
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3205436
-
Link
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/2089611-whats-wrong-with-tester_app_3#comment_3205436
More Answers (0)
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)