replacing matrix rows in a loop
이전 댓글 표시
Hi,
I am trying to build a n*k matrix but each row are produced by a function which has a 1*k output. How can I build that? I tried to build a n*k matrix of zeros and replace rows in a loop but since the dimensions are not same, I can't replace rows!
Thanks
댓글 수: 2
Azzi Abdelmalek
2013년 2월 11일
Provide a short example
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2013년 2월 11일
k=10;
n=20;
X=rand(1,n)
out=cell2mat(arrayfun(@(y) he_polynomial(1,k,X(y)),(1:n)','un',0))
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!