CAT arguments dimensions are not consistent.

  • Permalink
  • submit to reddit
  • Email
  • Follow


% 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
Reply Abhinay 3/2/2011 1:26:04 PM

See related articles to this posting


"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
Reply Matt 3/2/2011 2:05:07 PM
comp.soft-sys.matlab 202855 articles. 523 followers. Post

1 Replies
3608 Views

Similar Articles

[PageSpeed] 18


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Fsolve, CAT error : CAT arguments dimensions are not consistent
Hi firends I want to solve the set of non linear set of equitations as follow : (I define them in Function Che1) : function y = Che1(x) R = 8.314; T = 1000; DF_CH4 = 19720; DF_H2O = -192420; DF_CO = -200240; DF_CO2 = -395790; RT = R*T; y = [ DF_CH4/RT + log(x(1)/((x(1)+x(2)+x(3)+x(4)+x(5)))) + x(6)/RT + 4*x(8)/RT; DF_H2O/RT + log(x(5)/((x(1)+x(2)+x(3)+x(4)+x(5)))) + 2*x(8)/RT + x (7)/RT; DF_CO/RT + log(x(3)/((x(1)+x(2)+x(3)+x(4)+x(5)))) + x(6)/RT + x(7)/ RT; DF_CO2/RT + log(x(4)/((x(1)+x(2)+x(3)+x(4)+x(5)))) + x(6)/RT + 2*x (7)/RT; log(x(2)/((x(1)+x(2)+x(3)+x(4)+x(5)))) + x(6)...

CAT arguments dimensions are not consistent
Hello! Suppose I have a cell array C with dimensions 1x23. Each of those 23 entries is a cell array itself with varied dimensions nx1. When I try to use "K = cell2mat(C{p})" for p = 1..23 it works only for one vector showing error "CAT arguments dimensions are not consistent." for the others. I cannot get what the problem is because all of the vectors are essentially the same but the function works for only one of them. Please help. On Jun 18, 5:14=A0am, "Alex " <alesh...@gmail.com> wrote: > Hello! > > Suppose I have a cell array C with dimensions...

ERROR: CAT arguments dimensions are not consistent
I am trying to perform a regression on a bunch of data I have, and this is a portion of my code with the regression in it which my boss gave me to use: %Perform the regression on the size vs. settling data x = [ones(length(sizes),3) log(sizes)]; y = log (ws); [b,bint,r,rint,stats] = regress (y,x, 0.05); when I run my code it gives me this error: ??? Error using ==> horzcat CAT arguments dimensions are not consistent. Error in ==> MINS3_sizesettling_yeardays_new2 at 86 x = [ones(length(sizes),3) log(sizes(:,3))]; Can anyone offer any help? I would appreciate it!! - Amanda &quo...

CAT arguments dimensions are not consistent. #4
I downloaded this file from internet but i get " CAT arguments dimensions are not consistent" when i input the matrix function P = CalibDLT(x, X) noPnt = length(x); %% Compute the Camera Projection Matrix A = [X(1,:)' X(2,:)' X(3,:)' ones(noPnt,1) ... zeros(noPnt,1) zeros(noPnt,1) zeros(noPnt,1) zeros(noPnt,1) ... -x(1,:)'.*X(1,:)' -x(1,:)'.*X(2,:)' -x(1,:)'.*X(3,:)' -x(1,:)'; zeros(noPnt,1) zeros(noPnt,1) zeros(noPnt,1) zeros(noPnt,1) ... X(1,:)' ...

CAT arguments dimensions are not consistent. #2
I've read all the posts and documentation and can't figure out why this error still arises. I have these three vectors that i want to compbine into a matrix: v1= 'ChopinPrel' 'WagnerDiat' 'Christus12' 'WagnerChro' 'YesterdayE' 'Messiaen45' 'WagnerDiat' 'WagnerChro' 'Messiaen45' 'Christus12' 'ChopinPrel' 'YesterdayE' 'Christus12' 'ChopinPrel' 'WagnerDiat' 'YesterdayE' 'Messiaen45' &#...

CAT arguments dimensions are not consistent. #3
Hi, I have two matrices with the following sizes: Name Size Bytes Class classlabels2 500x1 2000 int32 data2 500x15200 60800000 double When I enter the following command: >>data3=[num2cell(data2) classlabels2]; I get the following error: ??? Error using ==> horzcat CAT arguments dimensions are not consistent. Any suggestions on how to get around this? I am using the matlab2weka package and this is the required format of the training/testing data.. Thank you!!! Sincerely, tom theiman...

Error in fsolve: CAT arguments dimensions are not consistent
I try to solve a couple of nonlinear equations with the following function -------------------- function F = SolveNG(x,cx,cy,cz,ax,ay,az,P4,P5,CP) n = cross(P4-CP',P4-P5); n = n(:).'/norm(n) D1 = -n(1,1)*P4(1,1) - n(1,2)*P4(1,2) - n(1,3)*P4(1,3) P1=P4(1,1); P2=P4(1,2); P3=P4(1,3); N1=n(1,1) N2=n(1,2) N3=n(1,3) F = [N1*x(1) + N2*x(2) + N3*x(3) + D1; ((x(1)-cx)/ax)^2 + ((x(2)-cy)/ay)^2 + ((x(3)-cz)/az)^2 -1; ((2*(x(1)-cx))/(ax^2))- x(4); ((2*(x(2)-cy))/(ay^2))- x(5); ((2*(x(3)-cz))/(az^2))- x(6); x(4)*x(1) + x(5)*x(2) + x(6)*x(3)+ x(7); x(4)*...

CAT arguments dimensions are not consistent when using cell2mat
Hi I have a string vector as: A = 'ICS3966100340000' 'ICS3966100340000' '326560000584C00' 'ICS3966100340000' '097560012524C00' I have another numeric string as B = 3 4 2 3 2 I want to put A and B in one matrix and then process the matrix, how can I do that? I do not want them in a cell array. Is there any way to force them to be in one matrix? Thanks a lot! Hua wrote: > Hi I have a string vector as: > A = > 'ICS3966100340000' > 'ICS3966100340000' > '32656000058...

add different matrices
Hi, Ive searched for ways to do this, but nothing is showing up... This code hopefully illustrates what Im trying to do. a = normrnd(0.2,0.6,5,4)' b = normrnd(0.1,0.8,2,3)' % I have a and b, which are different % sized matrices, and I want them in % one 4*7 matrix c=zeros(4,7) c = [a b] % a and b are variables generated each time a loop loops, I want to save each loop's incarnation of a and b outside of the several loops so I can save everything into a text file for future reference. Possibly just as one huge matrix of values which I can decode later if necessary. col...

??? Error using ==> vertcat CAT arguments dimensions are not consistent.
??? Error using ==> vertcat CAT arguments dimensions are not consistent. Error in ==> reaction at 14 rs=[j1 j2 ; 1 1] \[t1 ; t2] Error in ==> project at 4 [r1,r2]=reaction(fl,fs,j1,j2,q,leng) >> clc clear all [fl,fs,q,leng,j1,j2]=kelet [r1,r2]=reaction(fl,fs,j1,j2,q,leng) function [fl,fs,q,leng,j1,j2]=kelet a=0; k=1; leng=input('please enter length: ') j1=input('please enter position of 1st joint: ') j2=input('please enter position of 2nd joint: ') if j1>j2 temp=j1 j1=j2 j2=temp end q=[input('function of force'),'+x.*0...

??? Error using ==> horzcat CAT arguments dimensions are not consistent.
T = []; for i = 1 : Train_Number str = int2str(i); str = strcat('\',str,'.jpg'); str = strcat(TrainDatabasePath,str); img = imread(str); img = rgb2gray(img); img = imresize(img, [200 180]); [irow icol] = size(img); temp = reshape(img',irow*icol,1); % Reshaping 2D images into 1D image vectors T = [T temp]; % 'T' grows after each turn end This works fine only if the Train database contains only rgb images, but not for grayscale images because of the dimensions. Is there a way to...

how to make embedded matlab compliant and remove "non-scalars of class 'function_handle is unsupported","CAT arguments dimension are not consistent|
I have one embedded matlab function in simulink(my.mdl)file which has the following lines of code for j = 1:nInt x = RK4(@FRBwRIG, x, dT/nInt, t,inr, invInr, torque, uRIG, nRWRIG, nBRIG, betaRIG); x(1:4) = QUnit(x(1:4)); t = t + dT/nInt; end the first argument to RK4 is 'FRBwRIG',which is another function defined in my.mdl. all function that are being called in my.mdl are defined inside the my.mdl code file i.e and the matlab code of the rk4 function is as follows. I need to make this RK4 fucntion embedded matlab compliant. Fourth order Runge-Kutt...

CAT arguments
Dear all, I have the following problem with creating 10 different excel sheets, using a loop: for i=1:10 sheetname = num2str(i) %#ok<NOPTS> header1 = {['Payoffs for coalition: ', num2str(i)]}; xlswrite(filename,header1,sheetname,'A1:A1'); header2 = [{'regios'},regnames]; helpdata(1,1:12) = coalpath(i,1,1:12,2); data = num2cell(helpdata); xlswrite(filename,[header2;[{'members=1,singletons=0'},data]],sheetname,'A2'); header3 = num2cell(1:horizon); helpdata(1:horizon,1:12) = coalpath(...

Function with a dimension argument.
Hi everyone. I have written a function which takes a 2-dimensional array and a dimension as arguments. The output of the function is an array whose shape depends on the dimension argument (e.g. if the input array is MxN and the dimension argument is 1, the function returns an (M-1)xN array. If the dimension argument is 2, the function returns an Mx(N-1) array). The only way I have been able to implement this function is by creating two automatic arrays (one for each dimension argument) and then have a pointer pointing at one of these arrays depending on the dimension argument. I would like ...

CAT Arguments #2 405769
I am trying to graph the following data but I can't get it to work >> Po=1000; R=0.08; T=30; P=Po*exp(R*T); T=[0:1:30]; [T', P']; plot(T,P); title('Compounded Interest'); xlabel('Time, Years'); ylabel('Money, Dollars'); grid on ??? Error using ==> horzcat CAT arguments dimensions are not consistent. where did i mess up? "Will Rees" <willrees@yahoo.com> wrote in message <i6o35n$1kt$1@fred.mathworks.com>... > I am trying to graph the following data but I can't get it to work > > >> Po=10...

CAT Arguments #2 960836
I need to fix this... i got this code V1='COMB_LIN[0,0]:='; for k=0:8 for t=0:5 cadena1=sprintf('COMB_LIN[%d,%d]:=',[k t]); V1 =[V1 ; cadena1]; %#ok<AGROW> end end and it works perfect ,but when i change the k=10 or more actually i need 243 it says this ??? Error using ==> vertcat CAT arguments dimensions are not consistent. Error in ==> ExtractOutp at 14 V1 =[V1 ; cadena1]; %#ok<AGROW> and im not using vertcat ... thanks in advice :) "Rubi " <phreakadelik@hotmail.com> wrote in message <gn2bsp$hfn$1@fred.mathwor...

Array Dimensions Change When Passed as Argument
I have been looking at some old fortran code (that someone else wrote) and I noticed that a 1D array (in fact an *element* of a 1D array) is passed to a function as an argument to a parameter that is declared as a 2D array. What does this mean? I admit that I am more used to C so this seems strange. Does fortran see all arguments as addresses? Many thanks in advance, Peter. PeterOut wrote: > I have been looking at some old fortran code (that someone else wrote) > and I noticed that a 1D array (in fact an *element* of a 1D array) is > passed to a function as an argument to a param...

Checking data consistency in the context of from-to-dimensions
Hello, I was analyzing the problem of logic in connection with ranges like a price for a certain article which is valid from a certain date till a certain date. Especially in cases where there is not only one from-to- dimension but several I found some results quite interesting to me. I would like to summarize them here to share my results and to see if I get any feedback from experts, any easier solution than the ones I found. The following examples are based on MySQL 5. A) The simple case If there is only one from-to-dimension like for the price of an article you do not have...

how to concate matrix whose dimensions are not consistent?
hi, all, i have two matrix in this format a=[1 1 1; 2 2 2] b=[1 1 1; 2 2 2; 3 3 3] can i use cat(2, a, b) argument to concate these two matrix, since i need to calculate mean of the column, so i want to get a matrix like c=[1 1 1 1 1 1; 2 2 2 2 2 2; 0 0 0 3 3 3] so that i can use mean(c) to calcualte average of each columne. but how am i able to fill in 0 0 0 to match the two matrix dimension so that i am able to concate the matrix or is there any other function to concate matrix of different dimension? "newbie" <nw@yahoo.com> wrote in message news:ef30164.-1@webx.raydaftYaTP....

FA: ALLEY CAT, DIMENSION X etc.
Hello, for those who might be interested in: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=2737907852 I ship worldwide and I accept PayPal payments. Andre ...

How to break a bash command into an array consisting of the arguments in the command?
Hi, Suppose that I have a bash command in a string, e.g. cmd.sh a 'a b' ' ' I want get an array consisting of "cmd.sh" "a" "a b" "\n". Is there a robust way to do so in perl that can handle all the possible cases? Thanks. Peng Yu <pengyu.ut@gmail.com> wrote: >Suppose that I have a bash command in a string, e.g. > >cmd.sh a 'a b' ' >' > >I want get an array consisting of "cmd.sh" "a" "a b" "\n". Is there a robust way to do so in perl that can ...

Borlands Tasm 4.1 and macro arguments consisting outof more than a single word -- a problem
Hello all, I'm trying to write a bit of DOS assembly, and thought it would be a good idea to use a macro for a certain task. I ran into a problem though : I cannot seem to make TASM 4.1 (Borland) understand that when I use "offset TXT_ERROR" that I mean that as a single argument. It currently thinks that both "offset" as well as "TXT_ERROR" are seperate arguments (nonwithstanding that I'm using comma's to seperate actual arguments from each other). My question : Is there some setting I need to use or another method with which I can make Tasm 4....

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 ...

dimension of a dimension
Greetings. I went through all articles and books but could not find a decent answer to the following warehouse design problem. We are a bank, and we have millions of customers. Some of our customers are firms, and we coordinate paychecks on behalf of them. Their employees are also our customers. You can see that there is a self-reference to the customer dimension. We need to keep an attribute over the customer dimension indicating who his employer is. The problem here is that we need to keep history for this customer dimension, likely to be Kimball Type2. However anytime an...