hi ,I have deta of experiment (x,f(x)) and wold like to clous it to f(x)=a+b*(​exp(-x/c))​*(sin(d*pi​+x/(e*pi)) ^2 . wher :a,b,c,d,e are paraneter and x,f(x) chengs

2 views (last 30 days)
i used eye maching for exampel :
the vectores X=[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 ];
Y=[ 24 21.726 22.632 22.079 22.76 22.933 23.344 22.433 22.114 22.396 22.657 23.433 22.4 22.973 23.002 23.394 22.128 24.496 22.978 22.587 22.537 23.146 22.911 22.515 22.446 22.646 23.15 22.67 23.805 22.629 22.617 21.384 23.315 23.244 23.488 22.903 22.252 22.942 23.573 24.597 23.946 22.625 22.476 24.354 23.878 24.793 23.124 23.925 23.278 23.448 23.341 23.378 23.443 22.719 23.391 23.703 24.255 22.935 24.144 23.01 23.571 23.037 23.488 23.076 23.017 22.892 23.109 22.937 22.236 22.789 23.497 23.434 23.992 24.924 24.599 24.03 23.725 25.056 24.421 24.812 23.666 23.707 24.5 25.232 24.544 23.018 23.829 23.214 24.499 22.06 23.563 22.601 22.195 22.501 24.273 23.501 23.024 23.052 23.427 23.502 23.268 24 23.938 23.141 23.996 24.525 24.095 25.24 24.169 24.836 24.686 25.532 25.212 25.292 25 24.927 25.142 24.227 25.876 24.192 24.333 24.538 25.475 24.188 23.807 23.403 23.691 23.889 23.224 23.833 22.963 23 23.214 25.341 23.019 23.818 23.082 25.541 24.73 25.662 25.512 25.068 25.041 26.444 28.06 26.945 26.744 25.496 26.872 25.613 27.807 25.933 26.122 25.98 25.336 25.366 25.349 24.098 23.058 24.066 23.301 24.656 24.038 24.511 22 24.274 24.097 24.656 24.443 24.201 24.191 25.336 26.415 26.159 26.27 26.296 27.317 27.805 28.844 27.01 28.153 27.339 28.367 29.074 29.463 27.343 27.179 28.211 27.634 27.992 26.864 26.152 25.253 27.268 24.829 24.848 23.634 24.701 24.114 24.033 24.748 24.737 25.098 24.054 25.364 26.688 27.435 25.762 27.187 27.371 28.923 28.922 30.923 29.317 29.94 30.164 30.547 31.998 31.65 31.263 30.355 30.823 30.285 32.214 29.459 29.105 29.097 29.515 27.829 27.512 26.792 25.651 25.983 25.823 25.512 24.457 23.927 23.573 26.585 26.012 26.561 25.713 26.644 27.251 29.119 30.78 31 31.506 31.446 31.982 31.388 32.701 32.601 34.988 34.415 36.53 36.057 36.305 34.352 34.277 34.504 34.454 33.573 32.778 31.446 30.335 30.316 27.945 27.561 26.268 26.239 26.591 26.036 24.227 24.943 24.993 25.293 25.652 26.337 26.363 26.868 29.017 28.575 30.637 31.935 33.299 32.472 33.688 35.143 37.438 37.825 37.793 38.394 39.982 42.167 41.302 39.315 37.372 38.207 38.567 39.869 37.108 37.218 36.315 35.634 33.253 31.911 31.511 30.133 29.616 28.317 27.744 26.811 26.788 26.004 26.267 25.418 26.61 24.991 26.049 26.991 27.683 29.402 30.471 32.26 31.884 35.817 39.621 39 36.153 38.84 39.989 44.858 48.195 48.619 47.688 47.236 46.618 46.979 50.119 46.854 44.8 43.166 44.395 42.428 43.62 41.146 38.713 36.091 35.065 33.342 31.687 30.279 29.002 29.082 27.68 28.942 27.984 26.639 26.305 28.732 27.686 28.504 30.838 32.854 33.942 36.224 38.609 38.707 40.875 45.838 48.354 48.147 53.523 51.899 54.294 59.894 62.439 61.712 62.89 60.777 59.231 59.061 55.902 54.756 54.352 54.829 50.945 54.317 47.795 45.012 43.301 41.544 37.768 35.891 34.894 33.374 31.784 31.051 31.653 31.073 31.06 29.378 29.018 29.341 31.372 33.522 36.104 37.634 39.214 40 40.751 44.032 47.181 49.967 50.825 55.426 57.182 62.416 64.246 65.145 66.612 70.922 70.179 69.284 71.523 73.536 72.232 70.498 70.676 65.221 62.681 60.297 55.462 49.465 50.152 48.634 45.457 42.351 41.518 38.766 37.786 37.931 35.713 34.722 34.388 34.347 29.393 30.617 30.3 30.143 29.875 33.681 35.012 35.549 37.146 39.789 40.829 44.382 46.869 50.216 56.006 62.256 64.613 60.466 64.228 68.69 68.667 68.917 70.624 69.402 68.156 72.096 72.726 72.632 76.577 81.098 72.36 68.109 65.102 66.732 67.792 65.72 61.946 58.611 54.609 52.931 53.059 47.59 41.957 41.013 44.006 38 41.494 40.57 40.609 39.183 39.134 36.83 38.677 41.227 39.97 38.928 40.296 41.317 42.875 52.435 57.968 54.044 56.638 67.086 72.003 75.49 76.525 79.142 87.312 91.198 89.045 89.575 96.2 98.725 104.552 95.158 85.922 92.874 103.838 99.264 91.875 80.699 81.044 94.59 99.093 93.054 88.812 88.836 85.661 85.537 80.77 72.76 70.07 70.488 71.893 69.114 61.214 57.31 58.365 58.297 51.17 43.961 45.809 51.754 59.219 56.151 46.339 46.258 52.75 59.976 67.654 67.684 65.004 70.513 82.096 89.538 86.071 84.852 96.495 107.973 104.198 104.089 104.518 118.202 140.314 140.507 124.179 126.5 141.195 149.979 152.175 138.858 128.457 151.877 168.568 155.084 164.592 158.202 159.332 181.352 164.101 130.307 133.769 140.074 143.852 160.051 134.794 111.561 157.659 149.98 137.778 167.316 125.349 129.589 176.598 149.112 132.013 154.679 141.764 151.768 201.759 163.451 133.219 186.366 153.439 172.468 247.516 197.845 203.062 247.947 223.727 231.537 255 233.53 227.084 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 ];
i used :
x=X;y=Y; x = flip(x); plot (x,y) %% %x = flip(x); y2=70+240.*exp(-x./120).*(sin((1.1.*pi)+x./(6.*pi))).^2 ; yp=22+240.*exp(-x./120).*(sin((-0.7).*pi+x./(4.5*pi))).^2 ;
plot (x,y,'k -',x,y2,'r -',x,yp,'m -')
%% Tp=22/75; teta_in=22; %% teta_out=0:(1./exp(10)):2*pi; teta_in=(teta_in./360).*2*pi; target_zero_point=-Tp+((sin(2.*teta_in).*sin(2.*teta_out))./((sin(teta_out+teta_in)).^2)); figure; plot(teta_out,target_zero_point,'r -'); target_zero_point_sigment=target_zero_point; for i=1:length(teta_out); if (target_zero_point_sigment(i)>0) ; target_zero_point_sigment(i)=1; else target_zero_point_sigment(i)=0; end end figure; plot(teta_out,target_zero_point_sigment,'g -'); diff_flip_sigment_index=diff(target_zero_point_sigment); flip_sigment_index=find(diff_flip_sigment_index); teta_out_zero=teta_out(flip_sigment_index);
sin_teta_out=sin(teta_out_zero); sin_teta_in=sin(teta_in);
teta_out_to_ungel=((teta_out_zero)./(2*pi)).*360;
*i wold be thencfoul for a efective and prodoktiv unser , ageain thenks' *
  1 Comment
dpb
dpb on 12 Nov 2018
Redit the question to put the question itself in the text and a short, descriptive title.
Attach the data as a .mat file instead and format the code to be legible.
Help us to help you by taking the time to present it so it can be read.
If the m-file is more than 20 lines or so, also attach it as an .m file

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!