필터 지우기
필터 지우기

how to fill in zeros in index not used?

조회 수: 1 (최근 30일)
Aswin Sandirakumaran
Aswin Sandirakumaran 2018년 5월 25일
답변: JAYANTH BHIMAVARAPU 2018년 6월 30일
I need to create a vector B with length = 3;
And i know that B(2) = 5;
Then how to fill B(1) = 0 and B(3) = 0;
Output should be like : B = [0,5,0] ---> CASE 1
EXAMPLE CASE 2:
And i know that B(1) = 5;
Then how to fill B(2) = 0 and B(3) = 0;
Output should be like : B = [5,0,0] ---> CASE 2

답변 (2개)

jonas
jonas 2018년 5월 25일
Not sure I understand the question, but...
B=zeros(1,3);
%Case 1
B(2)=5
%Case 2
B(1)=5

JAYANTH BHIMAVARAPU
JAYANTH BHIMAVARAPU 2018년 6월 30일
B = zeros(1,length); B(2) = 5;
//Just initialize the vector with zeros(m,n) function and then feed the data as you want

카테고리

Help CenterFile Exchange에서 Direction of Arrival Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by