How do I declare a multiline array?

조회 수: 37 (최근 30일)
Agnieszka Konstantynowicz
Agnieszka Konstantynowicz 2018년 6월 4일
편집: Stephen23 2018년 6월 4일
Hello, I have a following problem:
I have to declare an array that is very long and splits into multiple lines. How can I divide it, so that Matlab knows it's one array? Are there any separators I can use at the end of the line?
if true
y = [180 183 188 191 195 199 201 195 207 210 212 216 220 221 224
221 225 229 234 237 239 242 242 244 245 244 246 245 246 247 249
251 252 257 260 263 268 271 272 275 277 279 283 286 291 296 302
306 311 316]
end

답변 (1개)

Stephen23
Stephen23 2018년 6월 4일
편집: Stephen23 2018년 6월 4일
y = [180,183,188,191,195,199,201,195,207,210,212,216,220,221,224,...
221,225,229,234,237,239,242,242,244,245,244,246,245,246,247,249,...
251,252,257,260,263,268,271,272,275,277,279,283,286,291,296,302,...
306,311,316]

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by