how do I create Matraix with same elements for several rows
조회 수: 1 (최근 30일)
이전 댓글 표시
I have No of turbines = [25,35,45,55,65];
I want No_of_turbines=25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
'' '' '' '' ''
and so on...
In essence, I have to copy the row vector several times into columns...please help
Thanks in advance
댓글 수: 0
채택된 답변
Stephan
2019년 10월 21일
편집: Stephan
2019년 10월 21일
turbines = [25,35,45,55,65];
how_often = 10;
No_of_turbines = repmat(turbines,how_often,1)
to get it ten times:
No_of_turbines =
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
25 35 45 55 65
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!