Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


dpb
Posts:
8,982
Registered:
6/7/07


Re: Matrix
Posted:
Apr 8, 2013 9:39 AM


On 4/8/2013 6:30 AM, Muhammad wrote: > Dear all > I have a matrix I got from the loop; > > for 1:1000 > peakLoc=peakfinder(h1(:,i)) > peak(:,i)=peakLoc(:,1) > end > > I got error state that > "Subscripted assignment dimension mismatch". > > How could I store in the variable in the column i from 1 to 1000 for > matrix that doesn't have similiar row.
What's peakfinder() return? Is it a variable number of peaks, I'm guessing, maybe? If so, here's where a cell array would be useful
peak(i)={peakfinder(h1(:,i));
My crystal ball says will be the same as your intermediary step except for being a cell array
Read the "Getting Started" section on data storage on cell arrays, etc.




