multidimension array

  • Follow


I want to copy an array to another array, the coding that i have written is 
for ss=1:length(start2)
    segment2(ss,i)=x(start2(ss):stop2(ss));
end
then it shows error
??? Subscripted assignment dimension mismatch.

for example
x=
   1
   2
   3
   4
   5
   6
   7
   8
   9
   0

start2=
   1
   5
stop2=
   4
   9
I want to store the value into array segment:
segment=
   1      5
   2      6
   3      7
   4      8
           9
So, what should i write for the coding. Hopefully someone can provide me the answer. Thank you.
0
Reply Ng 3/4/2010 3:59:26 PM

You are telling MATLAB to put 5 elements into the second column of a 4x2 matrix.  You cannot have a blank element in a MATLAB array.  
0
Reply Matt 3/4/2010 4:35:20 PM


1 Replies
165 Views

(page loaded in 0.015 seconds)

Similiar Articles:













7/23/2012 1:20:45 AM


Reply: