Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

create a vector with specified entries

조회 수: 3 (최근 30일)
Matheus
Matheus 2014년 11월 29일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello, I need to create the following vectors:
x=[0 0 0 ...0] and y=[h h h...h]
where h is a constant that I declared. Both vectors need to have a length of 100

답변 (1개)

Star Strider
Star Strider 2014년 11월 29일
Use the zeros and ones funcitons, respectively:
x = zeros(1,100);
y = h*ones(1,100);

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by