| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
MATLAB command line
scope_object_vector = getscope(target_object, scope_number) scope_object = target_object.getscope(scope_number)
target_object | Name of a target object. |
scope_number_vector | Vector of existing scope indices listed in the target object property Scopes. The vector can have only one element. |
scope_object | MATLAB variable for a new scope object vector. The vector can have only one scope object. |
getscope returns a scope object vector. If you try to get a nonexistent scope, the result is an error. You can retrieve the list of existing scopes using the method get(target_object, 'scopes') or target_object.scopes.

If your Simulink model has an xPC Target scope block, a scope of type target is created at the time the target application is downloaded to the target PC. To change the number of samples, you need to create a scope object and then change the scope object property NumSamples.
sc1 = getscope(tg,1) or sc1 = tg.getscope(1) sc1.NumSample = 500
The following example gets the properties of all scopes on the target PC and creates a vector of scope objects on the host PC. If the target object has more than one scope, it create a vector of scope objects.
scvector = getscope(tg)
xPC Target target object methods getxpcenv and remscope.
xPC Target M-file demo scripts listed in xPC Target Demos.
![]() | getparamname | getsignal | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |