Got Questions? Get Answers.
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

Thread Subject:
size of a variable dimensions

Subject: size of a variable dimensions

From: Snow White

Date: 18 May, 2009 10:38:02

Message: 1 of 3

hello,

I am getting the following error:

Error using ==> minus
Array dimensions must match for binary array op.

Error in ==> newnew at 191
err=((double(intensityy))-(double(temp_z)));

size(intensityy)

ans =

     1 1 38

although the size should be 1 1 19 as i clear the variable intensity as follows!

clear intensityy

but the size keeps on growing

Subject: size of a variable dimensions

From: Daniel Armyr

Date: 25 May, 2009 09:39:02

Message: 2 of 3

> ans =
>
> 1 1 38
>
> although the size should be 1 1 19 as i clear the variable intensity as follows!

What you do is "clear all". Then you set a breakpoint at the start of your script. go through the script step by step and look at the size of intensityyy. The instant the size is not as expected, you know you just passed your bug.

Subject: size of a variable dimensions

From: Snow White

Date: 25 May, 2009 10:15:03

Message: 3 of 3

Actually i need the variables so i can not clear all!

There was a problem now it has sorted out on its own. Thank you !

"Daniel Armyr" <firstname@lastname.se> wrote in message <gvdovm$i6m$1@fred.mathworks.com>...
> > ans =
> >
> > 1 1 38
> >
> > although the size should be 1 1 19 as i clear the variable intensity as follows!
>
> What you do is "clear all". Then you set a breakpoint at the start of your script. go through the script step by step and look at the size of intensityyy. The instant the size is not as expected, you know you just passed your bug.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us