Hi all,
I have the following code, is there any way to vectorize it?
RMH(1).D=rand(20,4);
RMH(2).D=rand(20,4);
a=zeros(length(RMH),numel(RMH(1).D));
for i=1:length(RMH)
a(i,:)=reshape(RMH(i).D,1,numel(RMH(i).D));
end
Thank you
Regards
Pietro

댓글 수: 2

Matt J
Matt J 2014년 10월 3일
Your code doesn't run, so of course there's no way to vectorize it.
pietro
pietro 2014년 10월 3일
you're on right. I have just fixed.

댓글을 달려면 로그인하십시오.

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 10월 3일
편집: Andrei Bobrov 2014년 10월 3일

0 개 추천

a = reshape([RMH.D],[],numel(RMD))';

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

태그

질문:

2014년 10월 3일

댓글:

2014년 10월 8일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by