How do i make an array like this?

조회 수: 5 (최근 30일)
Yuan Jun Lim
Yuan Jun Lim 2019년 10월 30일
댓글: Elijah Smith 2019년 10월 30일
Currently i have this variable.
Can i check how do i make the array to become like this? Theres 2 rows of empty spacing for every value.
4
5
5
5
  댓글 수: 3
Yuan Jun Lim
Yuan Jun Lim 2019년 10월 30일
If i were to put NANs in between,
how do i write it?
Sorry , i'm quite new to this.
Elijah Smith
Elijah Smith 2019년 10월 30일
x = [4; NaN; NaN; 5; NaN; NaN; 5; NaN; NaN; 5];
%or
x = {};
x{1,1} = 4;
x{4,1} = 5;
x{7,1} = 5;
x{10,1} = 5;
%or
x = ["4";"";"";"5";"";"";"5";"";"";"5"]

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by