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 203816 articles. 537 followers. Post

1 Replies
3892 Views

Similar Articles

[PageSpeed] 2


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

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

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

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

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

Re: CAT CATS CATS CATX #2
I blathered on: > > 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 distribution for which > > it would generate the probability. > > > > Perhaps, if you pester Tech Support about this enough, someone > > might write the function. [See the current thread on the IFC() and > > IFN() functions.] Presumably, they would need to keep the current > > four functions as is to avoid breaking everyone's code. > ...

Cat 5 upgrade to Cat 5e or Cat 6?
Hi, In the past month, I have spoken to two people who had been using very old routers (two diffferent brands) with a Cat 5 cable connecting a PC to the router and a Cat 5 cable connecting the router to a dsl or cable modem. When they tried to switch to a Cat 5e (in one case, he switched to a Cat 6) they could not get a connection. Is it possible that the very old router cannot handle Cat 5e or Cat 6? I thought that the newer cables were backward compatible? Appreciate hearing the experts' opinions. Thanks. JR In article <1137847582.203336.9350@g49g2000cwa.googlegroups.com>,...

arguments/dummy arguments
Hello, I have subroutines in a library that have a certain number of dummy arguments. Some of the programs that call those routines have the information required for the dummy arguments in arrays. Is there some way to call those routines using the arrays rather than having to spell out each element of the array. The example below demonstrates what I mean. Thanks Bruce program test implicit none integer, dimension(3):: date=(/2005,10,6/) integer:: i ! this is how I do it now call sub(date(1),date(2),date(3)) ! I prefer to do something like this call sub(date) ! or even something ...

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

Dimension to filter other dimensions
All the dimensions of my cube share the first two levels which indicate the date when the information was loaded into the datawarehouse. For example, our product and provider dimensions are structured this way, respectively: Year > Month > Product Category > Product Name Year > Month > Provider Group > Agent Name This is because we need to keep track of dimension data (as it changes) to be able to generate reports exactly the same as in previous dates. This way, when a product is moved from one category to another, we are able to generate previous reports as they...

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