How to create a calculator?
25 次查看(过去 30 天)
显示 更早的评论
I'm trying to figure out how to program a user-friendly circuit calculator. It will be a basic series circuit (2 windows, with 1 resistor on the top of each window and 1 on each side at a maximum, so up to 4 resistors can be chosen). The user should be able to specify the number of resistors AND each of their values so ultimately the total resistance can be calculated. So far I have: menu('Number of resistors', '1', '2', '3', '4'). Clicking the number of choice indicates the user's number of resistors. Then, he/she would type in the values of those x number of resistors (no more than 4) so they can receive a calculation of the total resistance. The total resistance would be R1+R3+R3+R4 (if the user chooses 4 resistors). If they choose three, it would be R1+R2+R3.
1 个评论
John D'Errico
2014-12-7
So what is your question? That you WANT to do something is good. But there really is no way we can help you from what you have said. START WRITING. If we write something for you, you gain nothing.
You say that so far, you have ONE basic line of code. So spend some time thinking. What is your next step? How would you implement that? Try something. If it does not work, then read the help. Figure out why. It is that effort on your part that gives you a gain.
In the end, the goal is for you to learn programming, so that perhaps eventually you can use that skill to build something useful.
回答(1 个)
Star Strider
2014-12-7
It seems that you want to create a GUI for your calculator. The best way to approach this is to start with guide. Take your time, experiment with it, and have fun!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!