Why do I get this error and is it something to do with my code?
Mostrar comentarios más antiguos
I get this error when I try to run my code
code:
% a.) column vector of last names called last, using curly braces.
last={'Smith'; 'Jones'; 'Webb'; 'Anderson'}
% b.) column vector of first names called first, usinf curly braces.
first={'Fred'; 'Kathy'; 'Milton'; 'John'}
% c.) column vectors for age, height and weight.
age=[6; 22; 92; 45]
Height=[47; 66; 62; 72]
weight=[82; 140; 110; 190]
% d.) display information using the 'table' function.
table(last,first,age,Height,weight)
error:
Warning: Error occurred while executing the listener callback for event POST_REGION defined for class matlab.internal.language.RegionEvaluator:
Undefined function 'power' for input arguments of type 'table'.
)
h=(-(9.8/2).*t.^2)+(125.*t)+500;
tHeight = height(obj);
Error in matlab.internal.editor.VariableOutputPackager.isolatedDisplaying
Error in matlab.internal.editor.VariableOutputPackager.getStringFromVar
Error in matlab.internal.editor.VariableOutputPackager.getTruncatedStringFromVar
Error in matlab.internal.editor.interactiveVariables.InteractiveTabularUtils.getTruncatedStringFromTable
Error in matlab.internal.editor.interactiveVariables.InteractiveTablesPackager.packageVarTable
Error in matlab.internal.editor.interactiveVariables.InteractiveVariablesPackager.packageVarInteractive
Error in matlab.internal.editor.VariableOutputPackager.packageOutput
2 comentarios
If you run as such the lines, it should work:
% a.) column vector of last names called last, using curly braces.
last={'Smith'; 'Jones'; 'Webb'; 'Anderson'}
% b.) column vector of first names called first, usinf curly braces.
first={'Fred'; 'Kathy'; 'Milton'; 'John'}
% c.) column vectors for age, height and weight.
age=[6; 22; 92; 45]
Height=[47; 66; 62; 72]
weight=[82; 140; 110; 190]
% d.) display information using the 'table' function.
table(last,first,age,Height,weight)
It seems you are calling it in a gui...so the error says variable power is not defined. Error might be with someother lines then you mentioned.
Luca Ferro
el 16 de En. de 2023
it runs correctly without any change on my machine as well
Respuestas (1)
Walter Roberson
el 16 de En. de 2023
0 votos
you created your own height.m that is interfering with the Mathworks height function
Categorías
Más información sobre Time Series Objects 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!