What I've sometimes done is created an input and signal straight to an output simply for a signal that's in the Test Vector (such as expected output), so that I can use it in a check as is appropriate. It's the easiest access I've normally found to it.
Can I access what's in the test vector in MatLab code during Main Test?
조회 수: 2 (최근 30일)
이전 댓글 표시
I saw a matlab page that talked about a getValue method, but I get an error saying "Attempt to reference field of non-structure array".
I don't think I understand what TestVector is, so that I can access its contents. The help really focuses on how to create them using the wizard.
Thanks
채택된 답변
Bart Addis
2011년 8월 29일
If you create a MATLAB element in the Main Test, you'll be able to access the test vector directly by name. It will contain the value for the current iteration.
If you create a test vector T with values [1:1:10], then in iteration 3, T will have the value 3.
댓글 수: 3
Bart Addis
2011년 8월 29일
Are you using the Excel Test Vector to create these, or are you using xlsread?
추가 답변 (1개)
Fangjun Jiang
2011년 8월 26일
Is your test vector data a structure? The function to get its field is called getfield(). getvalue() seems to be a different function.
댓글 수: 12
Fangjun Jiang
2011년 8월 29일
Your TestVector1 is an ordinary 2-D double array. To access it, just type TestVector1 in Command Window and you'll see the value. To access individual element, use TestVector1(3,2) for example.
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!