MATLAB POLYSPACE 7 Guida di Installazione Pagina 421

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
Vedere la pagina 420
Debugging Process a nd Features
Toolbar
Button
Debug Menu
Item Description
Function
Alternative
Step Execute the current line of the
M-file.
dbstep
Step In Execute the current line of the M-file
and, if the line is a call to another
function, step into that function.
dbstep in
Step Out After stepp ing in, run t he rest of the
called function or subfunction, leave
the called function, a nd pause.
dbstep out
Continue Running in the Examp le
In the example, collatzplot is paused at line 10. Because the problem
results are correct for
N/n = 1, continue running until N/n =2. Pressthe
Continue button three times to move through the breakpoints at lines 10, 11,
and 12. Now the program is again paused at the breakpoint at line 10.
Stepping In to Called Function in the Example
Now that collatzplot is paused at line 10 during the second iteration, use
the Step In button o r type
dbstep in in the Command Window to step into
collatz and walk through that M-file. Stepping into line 10 of collatzplot
goes to line 9 of collatz.Ifcollatz is not open in the Editor/Debugger, it
automatically opens if you have selected Debug > Open M-Files When
Debugging.
The pause indicator at line 10 of
collatzplot changes to a hollow arrow ,
indicating that MATLAB control is now in a subfunction called from the main
program. The call stack shows that the current function is now
collatz.
In the called function,
collatz in the example, you can do the same things
you can do in the main (calling) function—set breakpoints, run, step through,
and exam i ne values.
6-113
Vedere la pagina 420
1 2 ... 416 417 418 419 420 421 422 423 424 425 426 ... 617 618

Commenti su questo manuale

Nessun commento