xx=linspace(-1,1,1001); m=9; B=badknotssites(m); plot(xx,spval(B,xx)) plot(xx,spval(B,xx),xx,abs(xx).^(1/2)) m=101; B=badknotssites(m);,plot(xx,spval(B,xx)) m=501; B=badknotssites(m);,plot(xx,spval(B,xx)) Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 7.656734e-18. > In slvblk at 107 In spapi>spapi1 at 193 In spapi at 151 In badknotssites at 9 Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 9.202947e-18. > In slvblk at 107 In spapi>spapi1 at 193 In spapi at 151 In badknotssites at 9 help spapi SPAPI Spline interpolation. SPAPI(KNOTS,X,Y) (with both KNOTS and X vectors) returns the spline f (if any) of order k := length(KNOTS) - length(X) with knot sequence KNOTS for which Y(:,j) equals f(X(j)) , all j. This is taken in the osculatory sense in case some data sites are repeated, i.e., in the sense that D^m(j) f(X(j)) = Y(:,j) with m(j) := #{ ispaps, spap2. Reference page in Help browser doc spapi uiopen('/home/accounts/personale/clrmrc90/aa1213/advanced_numerical_analysis/decasteljau.m', true); t=linspace(0,1); b=[0,0,1,1,1/2,1/2;0,1,1,0,0,1/2]; plot(b(1,:),b(2,:),'o') b b = Columns 1 through 5 0 0 1.0000 1.0000 0.5000 0 1.0000 1.0000 0 0 Column 6 0.5000 0.5000 decasteljau(b,t) y = Columns 1 through 5 0 0 0 0 0 0 0 0 0 0 Columns 6 through 10 0 0 0 0 0 0 0 0 0 0 Columns 11 through 15 0 0 0 0 0 0 0 0 0 0 Columns 16 through 20 0 0 0 0 0 0 0 0 0 0 Columns 21 through 25 0 0 0 0 0 0 0 0 0 0 Columns 26 through 30 0 0 0 0 0 0 0 0 0 0 Columns 31 through 35 0 0 0 0 0 0 0 0 0 0 Columns 36 through 40 0 0 0 0 0 0 0 0 0 0 Columns 41 through 45 0 0 0 0 0 0 0 0 0 0 Columns 46 through 50 0 0 0 0 0 0 0 0 0 0 Columns 51 through 55 0 0 0 0 0 0 0 0 0 0 Columns 56 through 60 0 0 0 0 0 0 0 0 0 0 Columns 61 through 65 0 0 0 0 0 0 0 0 0 0 Columns 66 through 70 0 0 0 0 0 0 0 0 0 0 Columns 71 through 75 0 0 0 0 0 0 0 0 0 0 Columns 76 through 80 0 0 0 0 0 0 0 0 0 0 Columns 81 through 85 0 0 0 0 0 0 0 0 0 0 Columns 86 through 90 0 0 0 0 0 0 0 0 0 0 Columns 91 through 95 0 0 0 0 0 0 0 0 0 0 Columns 96 through 100 0 0 0 0 0 0 0 0 0 0 Columns 101 through 105 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 106 through 110 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 111 through 115 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 116 through 120 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 121 through 125 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 126 through 130 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 131 through 135 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 136 through 140 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 141 through 145 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 146 through 150 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 151 through 155 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 156 through 160 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 161 through 165 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 166 through 170 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 171 through 175 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 176 through 180 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 181 through 185 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 186 through 190 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 191 through 195 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 196 through 200 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 201 through 205 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 206 through 210 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 211 through 215 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 216 through 220 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 221 through 225 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 226 through 230 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 231 through 235 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 236 through 240 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 241 through 245 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 246 through 250 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 251 through 255 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 256 through 260 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 261 through 265 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 266 through 270 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 271 through 275 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 276 through 280 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 281 through 285 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 286 through 290 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 291 through 295 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 296 through 300 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 301 through 305 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 306 through 310 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 311 through 315 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 316 through 320 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 321 through 325 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 326 through 330 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 331 through 335 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 336 through 340 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 341 through 345 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 346 through 350 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 351 through 355 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 356 through 360 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 361 through 365 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 366 through 370 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 371 through 375 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 376 through 380 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 381 through 385 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 386 through 390 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 391 through 395 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 396 through 400 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 401 through 405 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 406 through 410 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 411 through 415 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 416 through 420 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 421 through 425 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 426 through 430 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 431 through 435 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 436 through 440 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 441 through 445 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 446 through 450 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 451 through 455 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 456 through 460 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 461 through 465 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 466 through 470 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 471 through 475 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 476 through 480 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 481 through 485 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 486 through 490 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 491 through 495 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 496 through 500 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 501 through 505 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 506 through 510 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 511 through 515 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 516 through 520 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 521 through 525 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 526 through 530 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 531 through 535 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 536 through 540 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 541 through 545 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 546 through 550 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 551 through 555 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 556 through 560 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 561 through 565 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 566 through 570 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 571 through 575 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 576 through 580 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 581 through 585 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 586 through 590 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 591 through 595 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 Columns 596 through 600 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 y = Columns 1 through 2 [2x100 double] [2x100 double] Columns 3 through 4 [2x100 double] [2x100 double] Columns 5 through 6 [2x100 double] [2x100 double] ans = Columns 1 through 2 [2x100 double] [2x100 double] Columns 3 through 4 [2x100 double] [2x100 double] Columns 5 through 6 [2x100 double] [2x100 double] t=linspace(0,1,5); decasteljau(b,t) y = Columns 1 through 5 0 0 0 0 0 0 0 0 0 0 Columns 6 through 10 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 11 through 15 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 Columns 16 through 20 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 Columns 21 through 25 0.5000 0.5000 0.5000 0.5000 0.5000 0 0 0 0 0 Columns 26 through 30 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 y = Columns 1 through 3 [2x5 double] [2x5 double] [2x5 double] Columns 4 through 6 [2x5 double] [2x5 double] [2x5 double] ans = Columns 1 through 3 [2x5 double] [2x5 double] [2x5 double] Columns 4 through 6 [2x5 double] [2x5 double] [2x5 double] t=linspace(0,1,101); y=decasteljau(b,t); y y = Columns 1 through 2 [2x101 double] [2x101 double] Columns 3 through 4 [2x101 double] [2x101 double] Columns 5 through 6 [2x101 double] [2x101 double] y{1} ans = Columns 1 through 5 0 0.0010 0.0038 0.0085 0.0148 0 0.0490 0.0960 0.1410 0.1840 Columns 6 through 10 0.0226 0.0318 0.0424 0.0543 0.0672 0.2251 0.2641 0.3012 0.3364 0.3696 Columns 11 through 15 0.0812 0.0962 0.1120 0.1286 0.1458 0.4010 0.4304 0.4580 0.4837 0.5076 Columns 16 through 20 0.1637 0.1821 0.2009 0.2201 0.2396 0.5297 0.5501 0.5687 0.5856 0.6009 Columns 21 through 25 0.2594 0.2793 0.2993 0.3194 0.3394 0.6146 0.6266 0.6371 0.6461 0.6536 Columns 26 through 30 0.3594 0.3792 0.3989 0.4183 0.4375 0.6597 0.6644 0.6677 0.6697 0.6705 Columns 31 through 35 0.4564 0.4749 0.4930 0.5107 0.5279 0.6701 0.6685 0.6658 0.6620 0.6572 Columns 36 through 40 0.5446 0.5607 0.5763 0.5914 0.6058 0.6514 0.6448 0.6372 0.6289 0.6197 Columns 41 through 45 0.6195 0.6326 0.6451 0.6568 0.6678 0.6099 0.5994 0.5884 0.5767 0.5646 Columns 46 through 50 0.6782 0.6878 0.6966 0.7048 0.7121 0.5520 0.5391 0.5258 0.5122 0.4984 Columns 51 through 55 0.7188 0.7246 0.7298 0.7341 0.7378 0.4844 0.4703 0.4561 0.4419 0.4277 Columns 56 through 60 0.7407 0.7428 0.7443 0.7451 0.7451 0.4136 0.3996 0.3858 0.3723 0.3590 Columns 61 through 65 0.7445 0.7432 0.7413 0.7387 0.7355 0.3461 0.3335 0.3214 0.3097 0.2985 Columns 66 through 70 0.7318 0.7275 0.7226 0.7172 0.7114 0.2879 0.2779 0.2686 0.2599 0.2519 Columns 71 through 75 0.7051 0.6984 0.6913 0.6838 0.6760 0.2447 0.2383 0.2327 0.2279 0.2241 Columns 76 through 80 0.6680 0.6596 0.6511 0.6424 0.6336 0.2212 0.2192 0.2183 0.2183 0.2193 Columns 81 through 85 0.6246 0.6157 0.6067 0.5977 0.5889 0.2214 0.2246 0.2289 0.2343 0.2408 Columns 86 through 90 0.5802 0.5716 0.5633 0.5553 0.5476 0.2484 0.2572 0.2671 0.2782 0.2904 Columns 91 through 95 0.5403 0.5334 0.5270 0.5211 0.5159 0.3038 0.3184 0.3341 0.3509 0.3689 Columns 96 through 100 0.5113 0.5074 0.5042 0.5019 0.5005 0.3880 0.4083 0.4296 0.4520 0.4755 Column 101 0.5000 0.5000 plot(y{1}(1,:),y{1}(2,:)) plot(b(1,:),b(2,:),'o',y{1}(1,:),y{1}(2,:)) bhat=degreeelevation(b); yhat=decasteljau(bhat,t); plot(b(1,:),b(2,:),'o',y{1}(1,:),y{1}(2,:),bhat(1,:),bhat(2,:),'x',yhat{1}(1,:),yhat{1}(2,:)) theta=pi/2; R=[cos(theta),sin(theta);-sin(theta),cos(theta)]; R R = 0.0000 1.0000 -1.0000 0.0000 curve=y{1}; size(curve) ans = 2 101 Rcurve=R*curve; plot(Rcurve(1,:),Rcurve(2,:)) Rb=R*b; Ry=decasteljau(Rb,t); plot(Rcurve(1,:),Rcurve(2,:),Ry{1}(1,:),Ry{1}(2,:),'o') b b = Columns 1 through 5 0 0 1.0000 1.0000 0.5000 0 1.0000 1.0000 0 0 Column 6 0.5000 0.5000 [c,d]=decasteljausplit(b,0.5) c = Columns 1 through 5 0 0 0.2500 0.5000 0.6562 0 0.5000 0.7500 0.7500 0.6250 Column 6 0.7188 0.4844 d = Columns 1 through 5 0.7188 0.7812 0.7500 0.6250 0.5000 0.4844 0.3438 0.1875 0.1250 0.2500 Column 6 0.5000 0.5000 y{1} ans = Columns 1 through 5 0 0.0010 0.0038 0.0085 0.0148 0 0.0490 0.0960 0.1410 0.1840 Columns 6 through 10 0.0226 0.0318 0.0424 0.0543 0.0672 0.2251 0.2641 0.3012 0.3364 0.3696 Columns 11 through 15 0.0812 0.0962 0.1120 0.1286 0.1458 0.4010 0.4304 0.4580 0.4837 0.5076 Columns 16 through 20 0.1637 0.1821 0.2009 0.2201 0.2396 0.5297 0.5501 0.5687 0.5856 0.6009 Columns 21 through 25 0.2594 0.2793 0.2993 0.3194 0.3394 0.6146 0.6266 0.6371 0.6461 0.6536 Columns 26 through 30 0.3594 0.3792 0.3989 0.4183 0.4375 0.6597 0.6644 0.6677 0.6697 0.6705 Columns 31 through 35 0.4564 0.4749 0.4930 0.5107 0.5279 0.6701 0.6685 0.6658 0.6620 0.6572 Columns 36 through 40 0.5446 0.5607 0.5763 0.5914 0.6058 0.6514 0.6448 0.6372 0.6289 0.6197 Columns 41 through 45 0.6195 0.6326 0.6451 0.6568 0.6678 0.6099 0.5994 0.5884 0.5767 0.5646 Columns 46 through 50 0.6782 0.6878 0.6966 0.7048 0.7121 0.5520 0.5391 0.5258 0.5122 0.4984 Columns 51 through 55 0.7188 0.7246 0.7298 0.7341 0.7378 0.4844 0.4703 0.4561 0.4419 0.4277 Columns 56 through 60 0.7407 0.7428 0.7443 0.7451 0.7451 0.4136 0.3996 0.3858 0.3723 0.3590 Columns 61 through 65 0.7445 0.7432 0.7413 0.7387 0.7355 0.3461 0.3335 0.3214 0.3097 0.2985 Columns 66 through 70 0.7318 0.7275 0.7226 0.7172 0.7114 0.2879 0.2779 0.2686 0.2599 0.2519 Columns 71 through 75 0.7051 0.6984 0.6913 0.6838 0.6760 0.2447 0.2383 0.2327 0.2279 0.2241 Columns 76 through 80 0.6680 0.6596 0.6511 0.6424 0.6336 0.2212 0.2192 0.2183 0.2183 0.2193 Columns 81 through 85 0.6246 0.6157 0.6067 0.5977 0.5889 0.2214 0.2246 0.2289 0.2343 0.2408 Columns 86 through 90 0.5802 0.5716 0.5633 0.5553 0.5476 0.2484 0.2572 0.2671 0.2782 0.2904 Columns 91 through 95 0.5403 0.5334 0.5270 0.5211 0.5159 0.3038 0.3184 0.3341 0.3509 0.3689 Columns 96 through 100 0.5113 0.5074 0.5042 0.5019 0.5005 0.3880 0.4083 0.4296 0.4520 0.4755 Column 101 0.5000 0.5000 yc=decasteljau(c,t); yd=decasteljau(d,t); plot(y{1}(1,:),y{1}(2,:),yc{1}(1,:),yc{1}(2,:),yd{1}(1,:),yd{1}(2,:)) plot(y{1}(1,:),y{1}(2,:),yc{1}(1,:),yc{1}(2,:),'o',yd{1}(1,:),yd{1}(2,:),'o') yc=decasteljau(c,linspace(0.5,1,100)); plot(y{1}(1,:),y{1}(2,:),yc{1}(1,:),yc{1}(2,:),'o',yd{1}(1,:),yd{1}(2,:),'o') yc=decasteljau(c,linspace(0,1,100)); plot(y{1}(1,:),y{1}(2,:),yc{1}(1,:),yc{1}(2,:),'o',yd{1}(1,:),yd{1}(2,:),'o') diary off