The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: if not clear memory then the results are wrong
Replies: 4   Last Post: Jul 26, 2013 9:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 338
Registered: 4/17/07
Re: if not clear memory then the results are wrong
Posted: Jul 26, 2013 1:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Friday, July 26, 2013 11:23:48 AM UTC+8, dpb wrote:
> ...

> > I have several row vectors.
> > I tranpose them with
> > A=A';B=B';C=C'; % I want to save them as column vectors
> > But A,B,C are still row one.
> > I run above procedures several times.
> >
> > After I 'clear all', rerun it and they are column vector.
> > Why?
> Something you're not showing...
> --

It is like:
for i=1:nimg
% .... function returns a variable: var
img{m}=img0{i}; % img0 : cell array storing strings

There is an warning about img: "variable appears changing on every loop." and it sugggests to preallocate the variable. I run two times and found first time is img is in column vector and the second time img is in row vector. I thought changing size variable is ok.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.