Info
This question is closed. Reopen it to edit or answer.
How to apply to each sub-set of a vector a different formula?
1 view (last 30 days)
Show older comments
Suppose I have a vector of order 10000*1. I have to apply different formula for each subset of (100*1). how to do it?
0 Comments
Answers (2)
Azzi Abdelmalek
on 19 Apr 2014
Edited: Azzi Abdelmalek
on 19 Apr 2014
A=rand(1,1000) % example
B=reshape(A,100,10)
Then apply your formula to each column of B
Or use a cell array
B=num2cell(reshape(A,100,10),1)
0 Comments
Matt J
on 19 Apr 2014
A=reshape(A,100,[]);
for i=1:100
A(:,i)=func(A(:,i)); %where func() implements the formula
end
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!