Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Matlab Error Message

Asked by James on 29 Jul 2011

Hi

My algorithm is strangely not working. Please help I get the below error:

??? Undefined variable Best_Predicted_Frame_mov.
Error in ==> MotionEstimationV2_salesman at 99
    imwrite((Best_Predicted_Frame_mov(1,c).cdata),filename,'jpg');

0 Comments

James

Products

No products are associated with this question.

3 Answers

Answer by the cyclist on 29 Jul 2011

Sounds like the variable "Best_Predicted_Frame_mov" has not been defined at line 99 of "MotionEstimationV2_salesman". I suggest you breakpoint your code there to see what the workspace looks like.

0 Comments

the cyclist
Answer by James on 29 Jul 2011

When I put a break there it gives...

c: 1x1 double = 1
filename: 1x25 char = Best_Predicted_Frame1.jpg

No other detail - help.

2 Comments

Fangjun Jiang on 29 Jul 2011

check what is the value for the variable "Best_Predicted_Frame_mov"?

the cyclist on 29 Jul 2011

It sounds like that variable has not yet been created. Can you trace back and understand why you thought it would be there, and why it isn't?

James
Answer by Walter Roberson on 29 Jul 2011

Before you first assign to Best_Predicted_Frame_mov add the statement

global Best_Predicted_Frame_mov

Then, just before you try to imwrite() it, again have the statement

global Best_Predicted_Frame_mov

If that solves the problem then either you could just leave it that way, or it would give us useful information towards tracking down why what you had was not working for you.

0 Comments

Walter Roberson

Contact us