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
2017년 11월 30일
Duplicates https://www.mathworks.com/matlabcentral/answers/370127-marix-calculation-with-fixed-and-changing-value
답변 (1개)
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!