From: Steven Lord on 19 May 2010 09:27 "FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message news:ht0oak$r20$1(a)fred.mathworks.com... > Thanks. I have tried , same error repeats Then there's something you haven't told us, as given the example as you wrote it that should work. Execute the following code one line at a time, copy the entire output from running the code, and paste it into your reply to this message. whos q w = [q zeros(1, 1023)]; whos q w -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: FAISAL PEER MOAHMED on 19 May 2010 09:32 Hi The error is due to semicolumn. It is necessary to use semicoulmn in the concatenation Cheers Faisal "Steven Lord" <slord(a)mathworks.com> wrote in message <ht0ovn$bka$1(a)fred.mathworks.com>... > > "FAISAL PEER MOAHMED" <pfaisalbe(a)gmail.com> wrote in message > news:ht0oak$r20$1(a)fred.mathworks.com... > > Thanks. I have tried , same error repeats > > Then there's something you haven't told us, as given the example as you > wrote it that should work. Execute the following code one line at a time, > copy the entire output from running the code, and paste it into your reply > to this message. > > whos q > w = [q zeros(1, 1023)]; > whos q w > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com >
From: SSantos on 19 May 2010 10:25 On 19-05-2010 13:39, FAISAL PEER MOAHMED wrote: > q= ones(1,1966081 ); > w=[q zeros(1023,1)]; Do this way: w=[q zeros(1,1023)]; --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: dpb on 19 May 2010 10:37 FAISAL PEER MOAHMED wrote: .... > The error is due to semicolumn. It is necessary to use semicoulmn in the > concatenation .... Well, that will solve the problem you had but provides a different answer than you stated you wanted in being a column instead of a row vector (array). You don't seem to be paying any attention to what others pointed out that the use of zeros(N,1) is a _column_ vector of length N and you attempted to concatenate that to a row vector. Simply rearranging the arguments to zeros() _WILL_ solve the initial problem posted as would the transpose operator ('). The upshot is you have to have consistent dimensions for the operation; if you want to concatenate by row then the operands must have the same number of rows; if you want by column the same is true in that dimension. By extension, to concatenate planes to a 2D array they would both need to have the same dimensions in both row and column. The only way around this in Matlab is to use cell arrays to hold varying dimensioned articles in cells. --
First
|
Prev
|
Pages: 1 2 Prev: fopen doesn't always open Next: data acquisition using NI 9172 through matlab |