Custom Vector - make vector x to be [1,1,....]
이전 댓글 표시
Hello Experts,
I want to create a vector x where all n elements are for example c.
I can do this by:
n=5;
x=zeros(1,n);
x(x==0) = 1;
But how to do this in more simple way.
Thanks a lot!
채택된 답변
추가 답변 (1개)
bym
2011년 10월 6일
x = ones(1,5)
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!