From: Priya on
Can anybody tell me what is wrong in this line

(concentration,nx,ny,nz)));
From: Wayne King on
"Priya " <priya.biomath(a)gmail.com> wrote in message <hjundt$a4t$1(a)fred.mathworks.com>...
> Can anybody tell me what is wrong in this line
>
> (concentration,nx,ny,nz)));

Hi Priya, I think you will need to give us minimally the error you are receiving. A common error with reshape() is that users attempt to reshape a matrix to a form where the number of elements is different. You'll get an error of the following:

??? Error using ==> reshape
To RESHAPE the number of elements must not change.

But again, you need to give people enough information to help you.

Wayne
From: Priya on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hjuohf$moi$1(a)fred.mathworks.com>...
> "Priya " <priya.biomath(a)gmail.com> wrote in message <hjundt$a4t$1(a)fred.mathworks.com>...
> > Can anybody tell me what is wrong in this line
> >
> > (concentration,nx,ny,nz)));
>
> Hi Priya, I think you will need to give us minimally the error you are receiving. A common error with reshape() is that users attempt to reshape a matrix to a form where the number of elements is different. You'll get an error of the following:
>
> ??? Error using ==> reshape
> To RESHAPE the number of elements must not change.
>
> But again, you need to give people enough information to help you.
>
> Wayne

You are correct so the error is


??? Error using ==> flipud at 19
X must be a 2-D matrix.
From: Steven Lord on

"Priya " <priya.biomath(a)gmail.com> wrote in message
news:hjundt$a4t$1(a)fred.mathworks.com...
> Can anybody tell me what is wrong in this line
>
> (concentration,nx,ny,nz)));

You have one left parenthesis and three right parentheses.

Note: please don't ask half your question in the subject line of the post
and the other half in the body. It's okay (and even recommended) for the
subject to contain a 'teaser', but even if you do that you should put the
entire question in the body.

So assuming your question was "Can anybody tell me what is wrong in this
line

imagesc(flipud(reshape(concentration, nx, ny, nz)));"

the error message you should have received should have made it clear what's
wrong in the line of code you posted above (assuming nz is not equal to 1.)

Use FLIPDIM instead of FLIPUD, and make sure that the reshaped, flipped
concentration array is in a format IMAGESC recognizes (which I believe means
nz must be either 1 or 3.)

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Priya on
"Steven Lord" <slord(a)mathworks.com> wrote in message <hjuoup$jm5$1(a)fred.mathworks.com>...
>
> "Priya " <priya.biomath(a)gmail.com> wrote in message
> news:hjundt$a4t$1(a)fred.mathworks.com...
> > Can anybody tell me what is wrong in this line
> >
> > (concentration,nx,ny,nz)));
>
> You have one left parenthesis and three right parentheses.
>
> Note: please don't ask half your question in the subject line of the post
> and the other half in the body. It's okay (and even recommended) for the
> subject to contain a 'teaser', but even if you do that you should put the
> entire question in the body.
>
> So assuming your question was "Can anybody tell me what is wrong in this
> line
>
> imagesc(flipud(reshape(concentration, nx, ny, nz)));"
>
> the error message you should have received should have made it clear what's
> wrong in the line of code you posted above (assuming nz is not equal to 1.)
>
> Use FLIPDIM instead of FLIPUD, and make sure that the reshaped, flipped
> concentration array is in a format IMAGESC recognizes (which I believe means
> nz must be either 1 or 3.)
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Sorry for my mistake.

imagesc(flipdim(reshape(concentration, nx, ny, nz)))

I use flipdim and now the error says

??? Error using ==> flipdim at 21
Requires two arguments.