CAT arguments dimensions are not consistent.

% read and show image
M = 30;
S=[]; 
% img matrix
figure();
for i=1:M
    str=strcat(int2str(i),'.jpg');    % concatenates two strings that form the name of the image
    eval('img=imread(str);');
    subplot(ceil(sqrt(M)),ceil(sqrt(M)),i);
    imshow(img);
    [irow icol]=size(img);    % get the number of rows (N1) and columns (N2)
    temp=reshape(img,irow*icol,1);    % creates a (N1*N2)x1 vector
    S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence       
end; 

when i run this code it say:
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> test3 at 13
    S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence

Any help please??
-1
Abhinay
3/2/2011 1:26:04 PM
comp.soft-sys.matlab 207337 articles. 2 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
4154 Views

Similar Articles

[PageSpeed] 11
"Abhinay " <abhilabh12@gmail.com> wrote in message <iklghc$qfm$1@fred.mathworks.com>...
>
> when i run this code it say:
> ??? Error using ==> horzcat
> CAT arguments dimensions are not consistent.
> 
> Error in ==> test3 at 13
>     S=[S temp];    % S is a N1*N2xM matrix after finishing the sequence
===============


In order for the command [S temp] to work S and temp need to have the same number of rows. MATLAB is complaining that they do not.
0
Matt
3/2/2011 2:05:07 PM
Reply:
Similar Artilces:

[News] [Rival] The Cat Out the Bag: Vista 7 is Just Vista Flavour
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Meet the New Windows, Same as the Old Windows ,----[ Quote ] | For all its problems, and Microsoft is facing many on a number of fronts | these days, it still remains a formidable company with huge cash reserves. | This means they can dazzle us with presentations and fancy conferences. They | can trot out the company's stars to mix and mingle with the technology | industry and press glitterai. They can show off new technology in the comfort | of their own playground surrounded by big screens and fancy presentations. | But you can't ...

How to cat None
I found out the hard way that I can not cat None. I get an error. Is there a simple way to cat None without doing some kind of equation ( if this then that). Is there a isNone() somewhere. I am not too sure I know what None really means. I include an example to show what I am talking about in case I am alittle confused. from easygui import * import string msgbox('Starting Program') thisfile = fileopenbox(msg='Choose the correct File', title='Matrix Input File') input = file(thisfile,'r') header = string.split(string.strip(input.readline()),',') ...

Dimension style key-in commands ?
I am searching the way to restore an existing dimension style by type the command in the key-in dialog box. I didn't find it in the help file nor in the command dialog box... If someone knows... Thanks S´┐Żbastien CROES Gaz de France sebastien.croes@ gazdefrance.com (please remove the space in this email address) http://www.askinga.com/tip.asp?TipID=260 By the way, you can ask questions like this on the discussion groups hosted by Bentley. http://discussion.bentley.com -- Best Regards, Inga Morozoff [Bentley] www.askinga.com "S?bastien CROES" <seb...

Passing Arguments into Expect
Hi there- I'm using Expect instead of rcp/remsh commands to run some scripts on another server, since a firewall prevents the rcp/remsh commands from working (keep getting a timeout). I'd like to be able to pass arguments to the Expect script, so when I telnet to the other server it knows which database and readings to grab for data collection. There are two scripts in the method I'm using- the first is running a shell script which does an Expect telnet script (to compress the data), and then runs an Expect ftp script (to grab the data). Basically, it goes like this right now: ...

CAT CATS CATS CATX
I do so love these new functions (goodby "left(trim))", I will miss you). Just a thought, would it be simpler to have just one "cat" function with a parameter indicating what flavor it is? Something like cat('X',' ',var1,var2) Same thing for "lag" ....or would this just complicate things? Cool ...

Closest neighbour in high dimension space (Slightly OT)
Hello Given a set of points Pi in some k dimensional space (where k>>3), can anyone advise me of efficient techniques for finding the nearest point to a given point p. Nearest is wrt to a standard Euclidean distance. Does this problem have a standard name and are there established strategies for solving it - I suspect the answer is yes in both cases. Many thanks for any help Fred Fred <Fred@somewhere.abc> wrote: > Given a set of points Pi in some k dimensional space (where k>>3), can > anyone advise me of efficient techniques for finding the nearest point to a &g...

passing a variable argument list to a function
I'm trying to write a function that accepts a variable number of arguments and passes those arguments to another function. Here is an example: def foo(*args): print "I'm going to call bar with the arguments", args bar(args) This doesn't do quite what I want. For example, if I call foo(1,2,3,4) then it calls bar((1,2,3,4)). It passes a tuple rather than expanding the argument list back out. I suspect there's a simple bit of syntax that I'm missing -- can anyone give me a hand? Thanks Scott Scott wrote: > I suspect there's a simple bit of syntax ...

Question about Cat 7 cable
I'm about to wire up my house, and have decided to run Ethernet cable pretty much everywhere, using it for both data and audio. Was originally going to use cat 5, but have instead settled on Cat 7 (which in the UK only appears to be available from Canford). It will cost quite a lot more, but it's not often I have all my floorboards up, and I'd like to future-proof as much as I can! My plan was to run the cat 7 to deep single- and double-gang metal boxes, to which I'd attach Canford connector plates with holes that will take either XLR, BNC, phono or BNC sockets. This way I ...

parsing C function declarations to generate code to serialize the formal arguments
I am looking for an elegant method to do the following. Are there tools available to help? Have you done something like this that I may also try? I wish to take a C header file consisting of a list of function declarations, parse the function declaration to obtain a representation of the formal parameters from which to generate C code. Each argument must be processable as a tree, since it may be a struct, or pointer to a struct, with further structs/pointer to structs as it's members, or member's members, etc. If it is a simple type, the tree has 1 node, and depth 1. If it is a poi...

Calling a method using an argument
Dear All, I have a simple class class hello: def world(self): return 'hello' def test(self,arg): return self.arg When I want to do is: >hello.test('world') 'hello' i.e. pass the method name as an argument. How should I do this? Thanks Colin def test(self,arg): return getattr(self, arg) -- Regards, Diez B. Roggisch Diez B. Roggisch wrote: > def test(self,arg): > return getattr(self, arg) > Oops, missed the calling: def test(self,arg): return getattr(self, arg)() If you have more args, do this: def test(se...

Dimension Type: Projected vs True
Is there an system or document option that allows the ability to set all new views to use projected dimensions? We are having a problem with named drawing views being set to True, what happens is that the model is created incontext so that it is rotated at an angle not perpendicular to any of the standard planes in the assembly so we create a named view with the model rotated into a position for the drawing then use that named view for our drawing views but it always asks if we want True or Projected dimensions, we always want Projected dimensions. Is there a setting that will default to Proj...

Template argument deduction
I'm having a problem where it would seem like template arguments could be deduced, but in reality the compiler barfs because it can't. Suppose I have this generic functor: struct HeapConvertInserter { template <class Value, class Key> shared_ptr<Value> operator()(const Key& key) { return shared_ptr<Value>(new Value(key)); } }; Now, consider a class which wraps a std::map<Key, shared_ptr<Value>> and some kind of delegate class like HeapConvertInserter. One method which uses the two goes as follows: // table is the std::map<Key...

styles and email readers
I am using phpmailer to output emails. The CSS features work great in OE but a few of the features break down in Yahoo, and Hotmail. Specifically I can't get the underline feature to work on a:hover in yahoo, and the text color for links and the a:hover fails completely in Hotmail readers. A very short list of my link code for all the news readers. OE, Yahoo, Hotmail, haven't tried Yahoo yet. <style type="text/css"> a:visited { color: #FFFFFF; } a:link { color: #FFFFFF; } a:hover { color: #FFFFFF; text-decoration: underline; ba...

Cat
A disc cataloguing utility, version 0.18, is now available from !Store (http://www.plingstore.org.uk ) and via !PackMan. This presents a disc catalogue in a window, showing a tree structure of files and directories. The contents can be saved in several fo rms and the graphical layout can be adjusted to suit. Disc contents can be compared and changed files (by datestamp and/or CRC) identified. _______________________________________________________________ a.m.conroy@argonet.co.uk, Moderator of comp.sys.acorn.announce. Submissions to csaa@owlart.net Related mail to csaa-request@owlar...

CALL CAT
With the new CAT, CATT, CATS and CATX functions you have a accompanied CALL routine for all except for the CAT function. Does anybody know why not? ...

Allow interspersed named and positional arguments?
In Fortran, all arguments in a call after the first named argument must also be named, so that subroutine foo(x1,x2,x3,x4,x5,x6) ! assume all arguments optional .... call foo(a1,x3=a3,a4,x5=a5,x6) is not allowed. I wish it were allowed, with the interpretation that positional arguments after named arguments are presumed to be the successive arguments in the callee, until the next named argument appears, so that the code above would be equivalent to call foo(a1,x3=a3,x4=a4,x5=a5,x6=a6) Making this change would not provide substantial new functionality, but I think it would be convenient,...

installing 2 supervisory engine in a Cat alyst 6509
We have a new Catalyst 6509 switch. It is running CatOS 8.3(4). It came with one 720 supervisory engine and is configured and running fine in slot 5. We ordered a 2nd 720 supervisory engine and attempted to install it hot in slot 6. The switch saw the new supervisory engine as primary and stopped passing traffic (I am assuming because it did not pick-up the config from the 1st supervisory engine before it went primary). Removing the new supervisory card returned the switch to it's previously functioning mode. I have searched Cisco site and Google for instructions on how to properly i...

[tlc] Error Message argument for an [] operation
Hi, I wrote in TLC for example: %assign rtnValues = FEVAL("sin","[1 2]") %assign s1 = rtnValues[0] %assign s2 = rtnValues[1] and get the error: The argument for an [] operation must be a repeated scope symbol, a vector, or a matrix Isn't this the correct syntax? The feval is an example for a self written matlab function which is like: function ret = foo(...) ret = [1 2] Thanks Olaf ...

Is this passing arguments by reference
// get the item, profession and its mats int get_bill_of_materials(map<string, string> &mats_map); map<string, string> crafted_items; int z = get_bill_of_materials(crafted_items); Have I passed by reference or so I need to do this? map<string, string> crafted_items; map<string, string> &crafted_reference = crafted_items; int z = get_bill_of_materials(crafted_reference); Many thanks. * pkirk25: > // get the item, profession and its mats > int get_bill_of_materials(map<string, string> &mats_map); > Presumably the following is mea...

Join command causes dimensions to change
VAR has confirmed a potential problem I encountered using the join command with "force surface contact" option selected. One of two parts used in the join command has a 1.500 dimension that changes to 1.508 (i..e. rounded) when dimensioned in the drawing. VAR took it one step further and unselected "force surface contact" and the drawing dimension then correctly matches the part. The problem has been submitted to SW for a closer look. Has anyone else experienced this problem? Kman > VAR has confirmed a potential problem I encountered using the join command > with...

Cat question
Hello, I wonder if Cat can handle User Authentication? You see my ISP demands User Authentication to send out news messages. Although Newswatch can handle UA it fails with my ISP. Therefore I was using until recently a German free nntp-server (which also required UA but Newswatch had no problem here) to send out message with Newswatch. Alas from 1 april on that German nntp is no longer free. The only Atari newsreader which is sofar able to send out message using my ISP nntp-server is Troll. To be honest I don't like Troll so much. I'm looking for an alternative. Today I t...

[9fans] cat -v is more patentable than cat
Sometimes people wonder: "Why does software suck?" There are many answers. One answer is the growth of needless complexity. Why is needless complexity rewarded? Because it is more easy to patent complex than simple. You probably can't patent "muxing pipes" alone. But you can patent Very Complicated Muxing Pipes. Just a thought from Mycroftiv ...

Re: CAT CATS CATS CATX
Cool <cool_guy@ODDPOST.COM> wrote: > I do so love these new functions (goodby "left(trim))", I will miss > you). Just a thought, would it be simpler to have just one "cat" > function with a parameter indicating what flavor it is? Something like > > cat('X',' ',var1,var2) > > Same thing for "lag" > > ...or would this just complicate things? Well, they did something like this when they built the PDF() and CDF() functions. The CDF() function introduced a keyword as the first parameter, which was the name of the...

netcool omnibus and script arguments
I have a script which takes two arguments and successfully sends SMS and email using the first as a title and the second as a body. (in the case of the SMS these are separated by a dash) When this script is called from netcool omnibus, the arguments are passed in as @node and \'@Summary\'. The stuff around @Summary presumably keeps multiple words together as a single argument. The script itself passes $1 and $2 to various other programs to get stuff done. If I run the script by hand with two parameters, everything happens as expected. If I generate events and netcool omnibus calls ...

Re: 10base-T & POTS in same Cat-5 cable?
DaveC <me@privacy.net> wrote in message news:0001HW.BE9508D6000D9A6AF04075B0@news.sonic.net: > Is it acceptable to use 1 pair in a Cat-5 cable for POTS when 2 pair > are being used for 10base-T? Wondering about cross-talk, etc., > introducing noise between these two. > Thanks, > Please, no "Go Google this" replies. I wouldn't > ask a question here if I hadn't done that already. > DaveC > me@privacy.net > This is an invalid return address > Please reply in the news group No problem if you use 10base-T , usually none on ...