# How to write an equation with time dependent parameters in MATLAB?

5 views (last 30 days)
Haya Ali on 26 May 2021
Answered: Jan on 26 May 2021
Hello, I'm quite new to MATLAB and I'm having a problem when trying to solve the equation r1 for the case when X1 and X2 vary with time. The equation of r1 is
r1 (tn+1)-r1 (tn )=C1+d11 X1(tn)+d11 X2(tn).
Where n=1,2,3……
And the given initial condition is r1(t0)=m.
Where X1 and X2 are vectors defined by the set of data points given. Please help me to write this equation in MATLAB with tn.
clear all; close all; clc;
c1=1;
d11=-0.0167
d12=-3.8358
X1=[11500.2 11477.9 11417.3 11426.4 11413 11382.9 11375.1 11347.9 11351.1 11329.3 11318.9 11343.4 11360.7 11378.4 11414.2 11408.2 11413.6 11449.4 11444.1 11421.4 11388.5 11429.3 11438.1 11432.9 11408.2 11434.3 11444.8 11443.5 11491.8 11503.8 11581.8 11525.9 11529.5 11557.6 11523 11516 11504.1 11492.9 11480.3 11495.9 11445.1 11437.7 11468.5 11463 11488.5 11470.3 11491.1 11480.2 11488.9 11453.8 11456 11434.5 11460.6 11456.1 11454 11468.3 11464.4 11501 11453.8 11474.2 11458.2 11452.8 11434.6 11447.3 11379.5 11396.4 11409.9 11405.6 11433.3 11435.6 11434.2 11415.5 11483.6 11434.6 11452.2 11471.5 11445 11462.6 11433.3 11440.2 11442.3 11456 11408.6 11399.7 11369.8 11372.6 11401.4 11405 11426.6 11430.3 11405.6 11409.8 11405 11399.7 11381.2 11392.5 11383.6 11365.8 11362.4 11347.8 ...
11324.9 11353 11330.8 11319.6 11313.2 11322.2 11294.4 11341 11345.3 11325.8 11359.3 11353.1 11330.7 11344.4 11361.9 11375.6 11338.2 11366.3 11349.5 11354.3 11373.5 11396.7 11387.6 11402 11415.8 11401.3 11416.9 11408.7 11371.5 11403.5 11437.4 11438.5 11452.5 11468.8 11428.4 11418.4 11395.3 11437.6 11409 11428.3 11375.6 11361.3 11343.6 11350.5 11357.6 11354.6 11394.5 11404.6 11449.5 11423 11451.8 11455.4 11472.9 11431.5 11453.7 11438.5 11433.6 11425.8 11413.5 11418.7 11395 11404.8 11367.5 11365.8 11351.3 11340.4 11374.3 11365 11397.8 11404 11387.6 11361.9 11354.5 11348.3 11297.2 11284.1 11308.6 11339.1 11354.3 11350.4 11350.6 11353.5 11353.7 11295.5 11303.3 11267.1 11333.3 11351.6 11330.9 11330.8 11336.9 11359.3 11361.6 11382.9 11339.5 11346 11403.5 11371.2 11381.8 11340.7...
11374.2 11360.8 11329.8 11361.6 11346.2 11343.8 11313.9 11294.8 11277.7 11289.3 11295 11302.2 11329.8 11339.1 11352.2 11348.7 11353.5 11354.6 11356.4 11336.3 11327 11366.5 11362.4 11372.7 11367 11353.1 11390.2 11391.7 11400.2 11387.9 11371.3 11377.6 11390 11442.7 11429 11445.1 11449.3 11452 11385.5 11395.6 11387.1 11355.4 11334.4 11346.1 11317.3 11337.9 11330.4 11339.2 11351.5 11336.3 11362.8 11342.8 11357.4 11355.3 11364.1 11333.1 11345.1 11355 11349.8 11376.7 11367.7 11394.9 11421.2 11434.2 11459.5 11448.3 11446.3 11432.8 11441.2 11380.6 11395.9 11394.5 11380.9 11364.8 11336.5 11346.2 11376.7 11392.8 11330.1 11361.6 11334.2 11341.4 11327.7 11315.8 11344.8 11328.6 11341.5 11350.6 11363.7 11383.3 11375 11398 11381.4 11411.2 11426.3 11440 11432.5 11438 11436.1 11467.1...
11506.6 11461.1 11493.6 11487.1 11461.8 11417.7 11429.3 11406.7 11400.5 11401 11387.3 11399.4 11395.1 11401.3 11379.5 11400.8 11408.7 11447.4 11460.4 11458.7 11432.9 11454.1 11480.8 11474.9 11504.1 11463.2 11530 11539 11531.9 11524.3 11484.2 11521.7 11490 11498.9 11451.1 11461.9 11486.6 11459.8 11463.9 11464.4 11513.1 11529 11534.2 11547.4 11564.6 11566.9 11485.5 11502.6 11471.7 11501.8 11466.6 11410.4 11426.5 11390.9 11426.5 11363.5 11366.3 11389.5 11368.3 11329.5 11315.5 11329.6 11310.7 11318.2 11272.7 11320.9 11320.9 11326.6 11351.1 11330.3 11391.4 11390.9 11388.4 11364.3 11354.7 11374.6 11355 11357.8 11332.7 11376.9 11348.4 11339.5 11382 11370 11343.6 11335.1 11321 11327.7 11294 11302.5 11302.6 11304.3 11299.9 11294.7 11298.9 11305.2 11341 11363.8 11384.5 11389.7...
11371.8 11390.4 11402.2 11387.3 11387.6 11387.3 11394.4 11447.1 11465 11431.5 11457.1 11460.6 11485.7 11491 11458.5 11440.9 11434.8 11454.9 11453.5 11463 11446.3 11475.9 11482.5 11457.3 11454.8 11445 11442.8 11440.9 11386.9 11412.6 11387.1 11402 11376.8 11425.7 11426 11426.7 11421.5 11438.4 11455.1 11423 11450 11429.3 11486 11504.3 11494.1 11510.8 11527.5 11562.5 11570.8 11520.7 11496.2 11508.6 11514.3 11457.7 11457.8 11435.8 11465 11475.5 11459.7 11462.8 11452.2 11499.4 11508 11478.9 11483.9 11479.6 11493.1 11451.4 11421.4 11366.3 11389.8 11385 11339.1 11322.4 11336.5 11346.9 11315.2 11328.6 11323 11348.3 11351.3 11346.5 11369.6 11400.5 11426.4 11432.4 11404.5 11415 11428.9 11446.8 11408.2 11417.9 11379.6 11379.4 11411 11383.2 11409.2 11443.8 11453.7 11455.9...
11420.4 11392.9 11395.4 11389.9 11358.4 11370.3 11404.4 11406 11418.9 11404.7 11460.1 11472.4 11510.2 11472 11457.3 11493.7 11507.3 11512.8 11489.1 11481.3 11481.6 11451.9 11423.8 11336.1 11413.5 11412.1 11376.1 11368.6 11371.8 11361.7 11320.5 11294.2 11268.4 11302.5 11344.5 11320.8 11345.4 11308.4 11327.4 11337.9 11340 11354.1 11355.1 11376.6 11406.4 11422.9 11434.4 11441.6 11457.7 11474.1 11487.9 11489.5 11461.2 11477.4 11464.9 11506.4 11484.7 11476.8 11466.2 11746 11060.5 11805 11714 11676.6 11674.9 11609.2 11516.9 11505 11534.9 11527.1 11514.4 11513.6 11535.7 11450 11435.1 11390.1 11426.6 11406 11385.3 11359.2 11332.5 11327.7 11302.2 11296.2 11267 11269.5 11246.4 11260.3 11284.6 11268.1 11257.5 11258.9 11252.8 11259.1 11304.2 11286.2 11319.8 11441.8 11558.1 11648.4...
11671.6 11658.8 11612.9 11656.8 11823 11659.9 11559.5 11550 11601.1 11528.9 11489.8 11456.9 11447 11441.3 11456.1 11463.4 11443.9 11408.3 11414.5 11406.2 11408.4 11438.5 11427.3 11461.3 11444.7 11421.3 11413.1 11407.6 11421.8 11395 11379.2 11344.8 11333.3 11299 11296.6 11275.3 11275.4 11275.3 11268.8 11279.5 11304.4 11335.2 11284.6 11261.9 11256.3 11237.6 11242.8 11250.3 11298.5 11313.5 11262.5 11254.6 11256.5 11259.6 11258.3 11257.5 11269.6 11321.6 11369.7 11379.5 11356.1 11311.4 11309.1 11296.4 11322.4 11369.7 11398.9 11419.5 11399.9 11398.2 11425.6 11452.6 11476 11492 11438 11413.4 11441.6 11498.6 11481.6 11469.9 11448.4 11434.1 11452.9 11483.7 11463 11470.8 11447.8 11445.5 11446.8 11424.1 11438.2 11465.9 11454.2 11446.3 11448.6 11431.1 11428.8 11416.1 11407.1 11412.1...
11448.8 11449.7 11442.1 11424.9 11409.3 11402.4 11386.8 11413.2 11434.9 11447.9 11441.4 11434.9 11405.2 11414.3 11416.5 11437.9 11455.2 11404.8 11422.6 11435.6 11424.7 11457.5 11439 11442.2 11398.3 11381 11424.2 11421.2 11391 11390.9 11384.8 11402 11396.7 11382.7 11388.9 11357.5 11377.2 11353.7 11334.6 11346.5 11335.4 11330.6 11321 11329.2 11354.6 11369.8 11361 11363 11355.9 11399.1 11394 11410.7 11394 11405.1 11407.4 11399.2 11438 11435.8 11429.7 11419.8 11387.2 11375.3 11381.1 11381.3 11397.8 11383.4 11364.6 11332.7 11317 11345.3 11322 11359.8 11337.2 11331.4 11319.2 11321.3 11325 11334.7 11360.3 11356 11337.7 11343.6 11353.7 11379.3 11436.6 11428.2 11437.8 11411.4 11438.8 11461.5 11468.5 11489.3 11459.3 11437.7 11415.6 11398.6 11418.8 11415.6 11394.3 11380 ...
11365.9 11366.6 11369.4 11386.2 11405.7 11349 11372.3 11370.5 11370.2 11402.6 11385 11401.8 11382.5 11362.5 11353.6 11368.9 11365.3 11377.3 11375.3 11385.2 11364.7 11357 11366.8 11337.1 11348.1 11316.3 11308.3 11322.2 11311 11341.8 11350.1 11340.1 11348.3 11338.4 11379.9 11395.1 11368.1 11363.4 11342.3 11329.5 11317.9 11318.7 11304.5 11256.4 11277.6 11247.3 11264.2 11247.9 11245.6 11243.5 11257.1 11289.5 11250.5 11252.9 11243.2 11278.9 11323.5 11299.4 11328.1 11306.9 11311.5 11317.8 11308.3 11302.3 11276.2 11295.2 11252.7 11267.4 11268.3 11265.8 11271.8 11266.6 11280.2 11273.3 11300.6 11280.5 11298.7 11341.9 11336.2 11354.5 11351 11344.7 11346.5 11321.8 11358.6 11340.5 11352.6 11333.3 11347.1 11369.5 11352.9 11359.9 11335.2 11308.9 11331.4 11319.5 11344.5 11337.1 11352.8 11371.9 ...
11359.4 11373.2 11339.4 11340.5 11343.4 11326.3 11332 11300.9 11335.2 11319.5 11327 11353.4 11358.1 11376.5 11356.3 11369.2 11381.7 11364.1 11392.4 11363.8 11376.8 11371.5 11366 11401 11366 11374.2 11347.6 11350.8 11354.1 11348.3 11377.9 11350.9 11384.9 11370.2 11378.9 11410.1 11399.8 11422.8 11390.8 11410.8 11377.9 11365.6 11390 11363 11373.6 11358.8 11350.5 11370.1 11377.4 11421.5 11392.7 11429.5 11429.2 11440.5 11469.2 11415.8 11402.9 11349.8 11338.3 11312.8 11319.9 11323.2 11316.9 11320.3 11304.7 11311 11360.6 11354.3 11396.2 11376.8 11390.6 11404.5 11413.7 11394.7 11377.3 11346.3 11358.1 11339.4 11379.6 11358.9 11372.3 11377.1 11367.6 11389.9 11360 11408.8 11376 11373.3 11344.2 11342.9 11355.1 11328.9 11348.1 11348.7 11350.8 11371.7 11362.2 11360.3 11338.7 11319.6 ...
11306.7 11320.4 11350.3 11314.6 11356.8 11356.7 11398.8 11377.8 11368 11365.7 11357.6 11368.1 11362.3 11385.3 11380.3 11398.1 11368.4 11390.9 11410.7 11371.2 11386.2 11375.6 11370.2 11401.5 11394.5 11388.7 11370.1 11391.7 11399.6 11393.8 11398.6 11417.7 11413.5 11397 11432.9 11415.3 11423.2 11402.4 11399.1 11402.7 11390.5 11421.6 11378.3 11409.1 11408.5 11408.3 11442.2 11410.2 11449.1 11428.1 11444.5 11461.2 11437.1 11380 11384.3 11380.8 11356.6 11371.3 11360.7 11384.6 11389.7 11364.9 11370.7 11354 11356.8 11380.4 11371.1 11396.3 11370 11392.6 11369.9 11382.5 11372.3 11359.6 11335 11324.7 11337.8 11338.7 11345 11321.7 11350.4 11345.6 11366.6 11346 11325 11331.1 11336.8 11337.5 11323.5 11337.6 11310.2 11316.2 11367.4 11346.4 11372 11379.5 11389.3 11374.4 11372.5 11371.7 ...
11356 11354.2 11335.5 11372.6 11370.7 11386.8 11363.4 11358.3 11397.9 11383.7 11396.8 11397.8 11385.2 11401.2 11395.9 11398.1 11394 11399.5 11373.6 11388.2 11377.5 11394.6 11414 11393.3 11406.4 11405.6 11410.5 11434.6 11413.3 11453.9 11439.2 11457.6 11458.4 11446.7 11439.1 11433.6 11441.8 11414.7 11436.4 11403.5 11450.9 11432.5 11439.6 11473.3 11449.6 11463.1 11452.3 11427.2 11401.4 11405.6 11360.7 11366.5 11336.1 11317.6 11289.2 11306.6 11306.7 11302.1 11350.6 11343.2 11368.7 11370 11365.4 11334.1 11317.6 11336 11305.5 11330.4 11306.5 11317.9 11321.9 11313.5 11344.5 11307.2 11335.5 11316.7 11334.7 11313.4 11326.3 11313.2 11307.2 11334.8 11321 11323.6 11317.9 11338.3 11330.7 11314.4 11334.7 11335.3 11353.3 11341.7 11366.5 11351.7 11353.6 11364.3 11361 11351.9 11337.9 11372.8];
X2=[8226.06 8234.99 8233.64 8237.88 8202.31 8221.06 8227.42 8218.15 8178.23 8171.49 8207.95 8185.35 8154.1 8199.58 8194.86 8208.41 8203.65 8196.02 8235.77 8223.88 8192.7 8193.73 8205.27 8226.7 8245.66 8220.71 8259.15 8248.48 8284.57 8286.82 8345.18 8279.08 8295.97 8273.65 8227.77 8205.47 8232.83 8167.27 8200.45 8236.65 8232.63 8247.13 8227.22 8217.31 8227.13 8180.41 8208.76 8228.25 8210.96 8174.71 8182.5 8209.88 8238.14 8245.51 8164.65 8192.09 8194.78 8194.36 8182.32 8236.12 8245.47 8207.3 8236.39 8282.31 8224.89 8218.68 8257.62 8215.52 8209.64 8223.77 8218.69 8213.66 8234.17 8229.77 8280.65 8237.61 8207.93 8193.78 8189.68 8167.78 8194.1 8190.04 8150.79 8217.72 8188.27 8214.29 8213.34 8212.68 8174.67 8190.03 8209.92 8188.18 8216.35 8200.95 8222.81 8246.59 8238.99 8249.34 8204.24 8217.16 ...
8210.35 8259.64 8197.23 8239.03 8207.05 8191.05 8203.94 8173.72 8176.97 8153.52 8160.5 8168.8 8185.04 8150.22 8158.93 8151.52 8111.29 8151.1 8097.85 8144.03 8140.46 8167.53 8159.25 8155.44 8156.78 8196.64 8143.66 8132.19 8138.97 8156.91 8170.51 8192.67 8218.02 8195.44 8208.8 8179.59 8183 8191.11 8233.25 8245.36 8194.83 8223.01 8201.91 8205.51 8212.19 8204.03 8204.12 8259.89 8242.94 8233.19 8258.76 8231.33 8235.68 8245.22 8247.8 8178.53 8219.02 8223.28 8158.23 8194.95 8202.36 8142.87 8163.35 8167.52 8159.81 8149.96 8174.4 8138.32 8128.75 8194.95 8179.86 8134.97 8141.51 8185.25 8128.94 8229.71 8151.01 8178.85 8203.2 8204.22 8216.75 8164.48 8169.25 8178.33 8158.7 8118.04 8094.7 8126.33 8150.82 8124.22 8113.7 8100.81 8135.34 8144.05 8158.51 8143.28 8143.6 8157.47 8208.36 8125.96 ...
8184.93 8145.76 8118.84 8143.85 8165.28 8154.06 8095.53 8138.86 8132.51 8227.04 8174.32 8179.97 8178.91 8169.49 8153.1 8091.13 8128.75 8146.08 8158.38 8146.54 8128.46 8145.7 8192.05 8168.78 8205.85 8151.25 8148.01 8184.38 8235.28 8184.78 8155.77 8158.95 8226.86 8248.3 8177.56 8237.23 8259.58 8283.72 8213.85 8247.76 8183.4 8187.61 8147.93 8130.08 8157.21 8141.87 8171.01 8138.22 8178.59 8178.8 8158.79 8114.83 8158.3 8126.95 8166.15 8149.29 8123.46 8122.4 8117.33 8138.1 8103.22 8104.56 8155.21 8188.46 8155.3 8163.98 8183.57 8195.58 8208.72 8171.84 8267.17 8182.96 8210.8 8191.56 8194.98 8204.95 8217.08 8284.39 8220.24 8200.02 8204.13 8198.1 8197.04 8195.33 8189.5 8190.71 8148.71 8134.98 8128.35 8139.34 8143.13 8153.06 8091.77 8128.33 8142.83 8163.67 8163.1 8135.13 8176.21 8175.64 ...
8181.47 8168.13 8189.35 8197.6 8208.93 8200.52 8196.93 8193.2 8233.31 8234.92 8210.2 8193.42 8191.09 8215.66 8191.28 8212.44 8166.89 8216.44 8189.97 8191.01 8189.85 8157.7 8186.43 8174.04 8199.55 8198.6 8193.82 8199.8 8225.71 8201.33 8179.32 8170.41 8181.38 8134.94 8122.67 8156.68 8110.73 8136.2 8120.86 8122.11 8123.78 8144.84 8157.86 8175.18 8188.47 8196.97 8249.58 8261.08 8218.11 8250.34 8248.6 8185.38 8211.3 8227.51 8203.39 8149.58 8187.58 8188.2 8200.56 8185.1 8192.67 8195.14 8215.06 8228.09 8194.95 8213.62 8207.75 8188.46 8191.82 8212.62 8180.37 8194.81 8196.28 8187.95 8141.25 8181.44 8154.69 8147.96 8129.54 8164.59 8148.13 8157.71 8144.59 8158.57 8146.95 8134.73 8081.59 8145.51 8122.86 8138.05 8151.14 8160.5 8176.72 8125.97 8117.96 8149.18 8139.71 8141.78 8144.03 8129.55 ...
8141.69 8161.22 8157.12 8235.79 8135.21 8161.28 8147.74 8191.95 8188.21 8196.57 8197.03 8222.23 8231.91 8237.34 8220.23 8265.16 8235.43 8243.56 8242.54 8251.76 8214.05 8231.24 8228.96 8209.11 8239.69 8255.56 8269.95 8229.03 8221.82 8263.55 8257.82 8214.61 8212.84 8213.05 8214.64 8150.89 8211.17 8175.03 8174.12 8193.35 8156.33 8162.19 8183.34 8183.74 8170.88 8180.07 8200.52 8250.46 8255.95 8202.63 8241.97 8215.22 8265.55 8203.03 8185.81 8169.04 8173.59 8159.21 8168.48 8164.32 8137.08 8118.61 8130.79 8118.49 8122.24 8145.2 8188.26 8192.85 8208.43 8165.7 8172.7 8212.71 8171.72 8183.29 8148.84 8197.59 8196.6 8171.99 8186.46 8172.19 8172.17 8135.82 8157.03 8147.96 8163.17 8188.74 8181.54 8193.91 8146.06 8144.29 8110.13 8133.68 8173.07 8159.61 8163.3 8135.27 8162.31 8144.74 8171.05 8226.62 ...
8224.07 8191.43 8198.75 8163.76 8131.72 8203.09 8092.84 8151.76 8123.07 8097.64 8132.75 8136.5 8195.33 8173.59 8151.37 8209.01 8188.89 8242.88 8155.55 8163.37 8194.16 8210.89 8197.51 8181.66 8201.93 8214.67 8171.52 8211.69 8164.74 8170.11 8162.67 8104.15 8140.16 8125.53 8142.41 8177.69 8174.64 8188.59 8202.09 8173.13 8171.76 8222.42 8122.13 8176.4 8202.41 8182.53 8214.41 8178.4 8210.24 8182.03 8195.21 8158.78 8146.4 8158.43 8106.62 8211.37 8188.66 8167.18 8195.58 8366.68 8319.86 8310.06 8294.43 8317.98 8282.51 8249.23 8227.91 8201.78 8202.2 8176.52 8206.58 8166.68 8214.91 8240.37 8203.23 8177.94 8192.38 8196.43 8184.06 8153.42 8146.81 8144.01 8108.88 8163.16 8142.94 8145.61 8151.11 8124.6 8128.91 8115.84 8134.59 8111.93 8120.73 8138.34 8211.09 8189.52 8189.86 8273.64 8297.49 8321.74 ...
8293.43 8260.55 8303.06 8299.15 8360.77 8329.79 8240.11 8230.51 8259.6 8197.68 8188.38 8183.48 8196.92 8166.36 8198.73 8164.93 8170.27 8147.03 8223 8138.94 8156.16 8164.39 8155.72 8178.98 8180.28 8190.69 8154.97 8193.14 8184.99 8172.17 8130.69 8142.55 8144.31 8115.72 8048.83 8075.45 8071.34 8064.61 8101.05 8090.44 8102.85 8126.25 8105.01 8092.98 8078.35 8087.25 8096.54 8073.06 8105.47 8121.79 8119.24 8101.02 8096.27 8079.21 8076.95 8089.91 8113.59 8098.24 8126.3 8169.81 8175.77 8134.34 8119.94 8136.28 8101.22 8150.51 8192.13 8179.82 8132.55 8133.62 8165.13 8183.43 8161.3 8179.33 8184.36 8154.11 8212.01 8205.37 8239.04 8146.78 8149.4 8168.6 8178.65 8165.64 8173.29 8172.32 8176.92 8195.25 8220.96 8175.41 8185.29 8170.03 8215.18 8204.93 8201.34 8173.33 8160.7 8176.72 8156.83 8165.31 ...
8157.87 8235.67 8181.53 8168.73 8136.67 8147.75 8177.77 8188.51 8160.16 8177.3 8149.09 8185.77 8144.27 8180.51 8175.4 8181.48 8137.63 8161.6 8181.94 8210.2 8182.66 8188.52 8129.08 8144.88 8178.94 8148.39 8182.95 8169.34 8139.76 8158.55 8118.04 8125.63 8171.23 8127.28 8145.29 8109.62 8124.71 8132.45 8112.67 8114.06 8113.31 8125.73 8096.24 8135.03 8092.65 8113.73 8124.21 8127.3 8135.47 8127.17 8168.6 8147.48 8169.64 8184.63 8198.8 8161.45 8217.57 8182.82 8160.87 8146.89 8117.93 8128.79 8151.23 8147.52 8122.01 8139.14 8106 8131.7 8134.35 8100.27 8145.79 8162.82 8108.69 8104.47 8125.88 8125.97 8116.38 8146.79 8088.69 8120.03 8097.53 8096.71 8119.56 8154.06 8118.71 8127.13 8133.21 8148.94 8178.64 8135.35 8159.48 8158.53 8146.53 8171.51 8103.67 8145.47 8122.18 8127.55 8088.76 8097.06 ...
8140.57 8146.75 8142.37 8100.94 8168.08 8124.65 8149.88 8151.18 8178.86 8147.66 8162.08 8142.38 8160.36 8163.35 8178.91 8143.07 8172.75 8161.33 8170.84 8145.67 8128.92 8114.74 8113.86 8125.33 8068.41 8051.2 8068.07 8052.68 8078.77 8075.73 8100.76 8058.76 8109.85 8123.14 8107.2 8125.7 8142.1 8130.18 8095.56 8108.59 8054.82 8080.38 8062.9 8032.11 8070.62 8039.36 8056.49 8035.93 8055.74 8019.63 8028.99 8045.89 8019.38 8048.76 8040.76 8053.07 8074.11 8059.87 8117.2 8161.72 8108.11 8085.76 8089.66 8101.81 8048.68 8129.06 8062.77 8089.87 8054.9 8055.97 8084.91 8078.51 8068.41 8048.12 8102.91 8068.5 8078.21 8127.31 8079.43 8093.2 8095.91 8100.71 8130.1 8121.39 8093.77 8089.13 8109.9 8113.07 8090.48 8111.66 8090.89 8073.06 8097.39 8068.79 8066.23 8067.98 8055.01 8101.63 8099.27 8086.71 ...
8096.21 8103.9 8095.26 8135.33 8104.26 8132.46 8109.49 8081.2 8098.03 8079.94 8066.3 8067.42 8065.8 8083.46 8075.46 8110.65 8114.34 8107.24 8118.53 8092.35 8142.23 8133.19 8135.77 8158.4 8118.01 8117.44 8102 8171.49 8115.86 8130.59 8167.56 8128.97 8106.85 8142.38 8128.23 8133.61 8138.02 8134.63 8122.41 8101.85 8158.21 8121.87 8118.53 8137.31 8151.02 8096.74 8083.79 8128.28 8101.16 8076.28 8083.05 8125.28 8160.46 8148.92 8127.4 8101.59 8116.55 8053.23 8075.39 8086.22 8066.48 8115.32 8058.08 8071.73 8096.91 8114.18 8089.15 8056.28 8096.87 8093.09 8107.67 8140.53 8097.82 8107.7 8092.29 8094.87 8112.63 8078.54 8112.22 8096.67 8084.19 8110.17 8081.21 8101.03 8156.31 8140.44 8144.85 8132.06 8146.75 8120.13 8078.95 8074.2 8047.28 8025.38 8087.44 8083.25 8073.98 8054.69 8078.66 8049.1 ...
8027.08 8030.48 8051.84 8053.14 8071.29 8055.21 8125.14 8078.12 8088.66 8066.28 8088.23 8122.83 8119.01 8168.8 8083.11 8138.18 8117.55 8118.47 8156.2 8148.97 8155.71 8142.36 8129.72 8174.38 8113.69 8155.96 8139.88 8125.8 8133.05 8095.7 8105.87 8135.92 8120.28 8146.81 8140.25 8140.91 8182.18 8138.57 8128.1 8136.92 8142.25 8109.74 8099.96 8165.19 8121.77 8155.19 8186.47 8150.21 8202.03 8156 8184.23 8207.17 8176.85 8150.14 8147.66 8163.57 8138.2 8124.88 8108.13 8109.92 8110.96 8119.05 8118.48 8109.66 8100.23 8113.92 8109.18 8094.58 8089.38 8102.25 8059.51 8090 8029.77 8051.08 8019.46 8028.62 8052.78 8020.07 8051.89 8061.86 8066.2 8055.71 8118.32 8088.48 8098.7 8057.77 8043.16 8069.36 8040.45 8082.19 8074.03 8096.58 8117.07 8063.68 8120.58 8057.13 8132.22 8084.16 8083.35 8096.31 ...
8103.3 8072.6 8083.32 8107.48 8072.39 8100.95 8128.31 8117.24 8107.33 8092.41 8152.53 8129.08 8119.26 8153.58 8090.23 8157.32 8144.45 8152.48 8136.19 8063.26 8086.34 8101.85 8123.43 8137.33 8113.49 8169.88 8099.16 8130.6 8148.71 8160.27 8144.55 8182.11 8121.19 8108.79 8150.1 8104.59 8176.42 8124.78 8148.67 8105.99 8153.15 8095.56 8153.23 8160.81 8116.26 8148.82 8121.18 8111.05 8110.94 8127.07 8102.71 8127.74 8089.68 8053.29 8050.64 8022.83 8046.84 8093.44 8050.45 8064 8103.42 8082.64 8090.93 8057.3 8030.26 8082.04 7999.1 8071.33 8021.39 8087.05 8045.42 8043.16 8052.49 8024.77 8083.58 8060.55 8067.42 8041.29 8080.22 8048.17 8047.75 8042.99 8056.78 8037.14 8051.18 8044.52 8044.64 8015.56 8065.05 8063.33 8075.15 8059.23 8073.28 8073.56 8024.31 8086.03 8069.31 8118.26 8079.33 8080];
r1=c1+x1*d11+x2*d12;

Jan on 26 May 2021
Start with omitting the brute clearing header: clear all; close all; clc; This is a waste of time. USe functions to keep your workspaces clean.
Never store such a pile of data in an M-file. Write them to a MAT file and import them by load().
r = zeros(size(X1));
r(1) = m;
for k = 1:numel(X1) - 1
r1(k + 1) = r(k) + c1 + d11 * X1(k) + d11 * X2(k);
end
Maybe this defines r as you need it. But it is not clear, what you want to achieve.

### Categories

Find more on Clocks and Timers 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!

Translated by