-1

I need to subtract from an array the last N values. Specifically, I have an array with labels that represents human postures and I'm able to calculate the amount of labels to subtract (from the queue..)

I write this code:

NUM_POSTURE_TO_SUBTRACT = length(POSTURES_ARRAY)-NUM_POSTURE_MAX;  
 POSTURE_ARRAY = POSTURE_ARRAY(:,1:end-NUM_POSTURE_TO_SUBTRACT);

but I have an eeror: Undefined function or variable "POSTURE_ARRAY".

Please, help me!

1
  • are you sure you have POSTURE_ARRAY and POSTURES_ARRAY sorted out?
    – mnagel
    Dec 22, 2014 at 16:13

2 Answers 2

0

That is because you are using POSTURE_ARRAY` instead of POSTURES_ARRAY - missing S. Try the following should work.

NUM_POSTURE_TO_SUBTRACT = length(POSTURES_ARRAY)-NUM_POSTURE_MAX;  
POSTURE_ARRAYS = POSTURE_ARRAY(:,1:end-NUM_POSTURE_TO_SUBTRACT);
1
  • How does your answer contribute anything new?
    – Schorsch
    Dec 23, 2014 at 12:37
0

You are getting an error that POSTURE_ARRAY doesn't exist as a variable, likely because you used POSTURES_ARRAY in the first line (Note the S before the '_').

try:

POSTURES_ARRAY = POSTURES_ARRAY(:,1:NUM_POSTURE_MAX);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.