A list,

1 Project Description



2. Subject modeling process

A) First, obtain various parameters of the weapon, and calculate the common error of the response of the weapon in the direction and height by these parameters;

B) Second, the deviation in direction and height during firing is normally distributed. In MATLAB, the norMRnd function is used to realize the modification function (where, the standard deviation is the common calculation error).

C) Third, according to the calculated value, make the hit point on the target: the radius of the 10th ring of the target is 0.75m, the radius of the 9th ring is 1.75m, and so on, the radius of the 6th ring is 4.75m, all outside the 6th ring are recorded as 0 rings, output the result of each shooting;

D) Fourth, calculate the total number of rounds, the average number of rounds, and the percentage of 10 shots with a hit rate of more than 6 rounds.

Third, the key difficulties in the realization of the subject

A) It’s hard to get started

As I was not serious in class, to be honest, I couldn’t start with the program at the beginning, and I didn’t know how to progress.

In this case, I first bought a reference book and experimented with the only example in the reference book. Although it is completely copied, there are also a lot of troubles in the process. Several objects in the book have inconsistent tags, which makes the program unable to run. Read a book, carefully consider, modify the program, and successfully run. In the process, you begin to understand the program.

After reading the chapter on GUI, I basically began to have a clue. Then I started to select a topic, design the interface, and conduct functional analysis.

When I was choosing a topic, I struggled for a while, and finally chose a 4-star topic. It was really due to the problem of time arrangement, because I had to take double-degree courses on weekends, so I would not skip any classes in ordinary times.

B) Procedural problems encountered

Because the topic is pretty simple, do off the program has been very well, was working as a graphic review the graphic section in the book, write a callback function when the brush up on some characteristics on the matlab, because learned c language, feel in addition to the use of the matlab have some special, like a script file, function, and several control-flow statements, Everything else is very similar. Procedurally, it’s very easy to get started.

Among them encountered a few want to achieve the function, such as hidden axis, pop-up dialog box and other functions, are the Internet search, after the test, and finally wrote the program.

C) Addition of sound

I thought I was very creative when I added it. Later, I found that some students also added that function, but I did encounter great trouble in this process.

When I first had this idea, I searched online whether background music could be added, and found that wavread function could be used. Then I found a section of ak47 gunfire on the Internet, but I didn’t expect that it took me a long time.

Of course, I knew I could only add a.WAv audio file, as did the downloaded gunshot, but I couldn’t add it. When debugging, into the wavread function, found the error out of the place, but also do not understand. After I copied and pasted that paragraph, I found a question on Baidu about it. It is mentioned that some. Wav format is not a standard format and may not be input to MATLAB. I googled.wav, confirmed the idea, downloaded the conversion software, and replayed the audio a dozen times but it still didn’t work.

Finally, and coincidentally, I was looking at the web and found out that the Windows recorder produced the standard.WAV format, which became my last hope. If this doesn’t work, I think I’m done with loading sounds. In the end, of course, it worked.

Ii. Source code

Insert the code slice hereCopy the code

3. Operation results

Fourth, note

Version: 2014 a

Complete code or ghostwrite plus 1564658423