how to form the code with fixed number of values on x axis and variable number of values on y axis.

조회 수: 2 (최근 30일)
x=1, y= 2,3;
x=1, y= 2,3,4;
x=1, y= 2,3,4,5;
x=1, y= 2,3,4,5,6;
x=1, y= 2,3,4,5,6,7;
x=1, y= 2,3,4,5,6,7,8;
x=1, y=2,3,4,5,6,7,8,9;
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 11월 30일
Duplicates https://www.mathworks.com/matlabcentral/answers/370127-marix-calculation-with-fixed-and-changing-value

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

답변 (1개)

Image Analyst
Image Analyst 2017년 11월 30일
How about
x=1, y= [2,3];
x=1, y= [2,3,4];
x=1, y= [2,3,4,5];
x=1, y= [2,3,4,5,6];
x=1, y= [2,3,4,5,6,7];
x=1, y= [2,3,4,5,6,7,8];
x=1, y= [2,3,4,5,6,7,8,9];
or
for k = 1 : 9
x=1
y = 2:k
end
or
x = 1;
y = 2 : randi(9, 1, 1)
Or any number of other ways depending on what your intent is.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by