Can I access what's in the test vector in MatLab code during Main Test?
Mostrar comentarios más antiguos
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
1 comentario
James
el 26 de Ag. de 2011
Respuesta aceptada
Más respuestas (1)
Fangjun Jiang
el 26 de Ag. de 2011
1 voto
Is your test vector data a structure? The function to get its field is called getfield(). getvalue() seems to be a different function.
12 comentarios
James
el 26 de Ag. de 2011
Fangjun Jiang
el 26 de Ag. de 2011
It's a cell array so type TestVector1{1} in Command Window to see what is the value.
James
el 26 de Ag. de 2011
James
el 26 de Ag. de 2011
Fangjun Jiang
el 26 de Ag. de 2011
All right, go to Command Window, type who or whos, find the variable name for your test vector, type its name and see what you got. There are many other ways to inspect the variable, type workspace, or open('VariabeName')
Walter Roberson
el 26 de Ag. de 2011
What does
class(TestVector)
report?
James
el 29 de Ag. de 2011
James
el 29 de Ag. de 2011
James
el 29 de Ag. de 2011
Fangjun Jiang
el 29 de Ag. de 2011
who give you a list of variables. whos gives more info such as Name, Size, etc. open('TestVector1') will open an Excel like interface for you to view and edit value. class(TestVector1) will return double.
Fangjun Jiang
el 29 de Ag. de 2011
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.
James
el 29 de Ag. de 2011
Categorías
Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!