tailieunhanh - A Guide to MATLAB for Beginners and Experienced Users phần 8

Chúng ta thấy rằng lợi nhuận ròng có thể dao động đáng kể từ một tập hợp các 100 trò chơi, và có một xác suất khá lớn các sòng bạc đã bị mất tiền sau 100 trận. Để có được một ý tưởng về lợi nhuận ròng có thể được phân phối nói chung, chúng ta có thể | Common Problems 209 SOLUTION When you encounter a syntax error review your input line carefully for mistakes in typing. EXAMPLE If the user intending to compute 2 times 4 inadvertently switches the symbols the result is 2 - 4 2 - 4 I Error Missing variable or function. Here the vertical bar highlights the place where MATLAB believes the error is located. In this case the actual error is earlier in the input line. Spelling Error CAUSE Using uppercase instead of lowercase letters in MATLAB commands or misspelling the command. SOLUTION Fix the spelling. Consider the following accidental misspellings. EXAMPLE Sin pi 2 Undefined command function Sin . ffzero @ x x 2 - 3 1 Undefined command function ffzero . fzero @ x x 2 - 3 1 ans Error or Warning Messages When Plotting CAUSE There are several possible explanations but usually the problem is the wrong type of input for the plotting command chosen. SOLUTION Carefully follow the examples in the help lines of the plotting command and pay attention to the error and warning messages. EXAMPLE X -3 3 plot X X. 1 3 Warning imaginary parts of complex X and or Y arguments ignored. 210 Chapterll. Troubleshooting Figure . A Spurious Graph of y x1 3. Figure is not the graph of y x on the interval 3 x 3. Actually the graph to the right of the origin looks correct but to the left of the origin the graph is certainly not right. The warning message provides a clue. What has happened is that MATLAB is plotting the real part of x1 3 but for a different branch of the multivalued function than the one we want. MATLAB is interpreting x1 3 for x negative as meaning 1 3i 2 x 1 3. In order to fix the problem we must specify the function in MATLAB more carefully. The correct graph in Figure results from plot X sign X . abs X . 1 3 Figure . Correct Graph of y x1 3. A Previously Saved M-File Evaluates Differently One of the most frustrating problems you may encounter occurs when a previously saved M-file which you are

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.