Tag Archives: matlab
How to do ‘cos’ curve fitting for data obtained.
Hello everyone,
I have been trying to do curve fit for the data given below.
I want to implement ‘cosine square’ curve fitting for the data obtained and later find the peak. I have already written a program for it and obtained the graph below as attached. But I am unsure if I am correct in implementing it, so that I can find a peak.
Can someone please check my programme if it is correctly implemented and latter how can I find the peak?
The program and also the data is attached.
I request to please help in setting the cosine square curve fitting and also how can I find peak from it please.
Thanking you in advance.
Kind regards
x_axis = [linspace(0, 360, 360)’];
y_axis =
[3.7560368
3.8085489
3.7661638
3.7799058
3.8907118
3.6859937
3.8746176
3.8137977
3.8134153
4.0203352
4.1017566
4.0970173
3.9302003
4.1788678
4.2053556
4.1945562
4.2701845
4.2767544
4.4449506
4.2852941
4.3978033
4.4853888
4.6127644
4.7098279
4.8618488
5.1263094
5.3121061
5.2374048
5.4019165
5.3228474
5.7068501
5.8063822
5.6671882
6.0611329
6.3209352
6.3571095
6.3894024
6.3625441
6.7195029
6.9633155
7.1388698
7.1086278
7.3036475
7.7009292
7.5671926
7.8018169
7.8800983
7.9435253
8.2067919
8.0853844
8.4278364
8.5053186
8.7994070
8.8510847
8.8690329
9.1009340
9.0523500
9.2792454
9.1106558
9.3377943
9.3589869
9.5377388
9.5682468
9.6855421
9.9991894
10.101757
10.096369
10.156980
10.274252
10.360273
10.509270
10.480047
10.654547
10.673642
10.609531
10.812882
10.907791
10.918486
11.225864
11.290207
11.172333
11.488586
11.520347
11.551353
11.549279
11.526500
11.671359
11.850876
12.058664
12.165114
12.094005
12.211543
12.288712
12.303370
12.436886
12.596936
12.663608
12.708924
12.855083
12.925530
13.090031
13.018736
13.070112
13.107990
13.310437
13.422553
13.567563
13.744937
13.490406
13.864213
13.847771
13.847562
14.041366
14.147572
14.082581
13.991263
14.123412
14.369276
14.390491
14.520578
14.327042
14.693224
14.133552
14.292513
14.025004
14.026464
13.991936
13.935472
13.823612
13.694707
13.577332
13.184267
13.157513
12.778562
12.687349
12.503510
12.076763
11.935090
11.697372
11.518528
11.050751
10.501066
10.570576
10.255017
10.040149
9.6180134
9.4150209
9.1862717
9.1615105
8.8085833
8.4177094
8.1676283
7.9493303
7.8774567
7.4021716
7.2626643
7.0130467
6.8367281
6.5165462
6.2733707
6.0217953
5.8303905
5.7666621
5.5948973
5.3705506
5.0788374
4.8748956
4.9039559
4.7801609
4.5220037
4.4644861
4.3326731
4.1139574
4.0280752
4.0393724
3.9195518
3.8203096
3.9346380
3.9120667
3.9352870
3.7858152
3.7302327
3.8530660
3.8764021
4.0210533
3.8053162
3.7861629
4.0157118
3.8974786
4.0198369
3.8873518
4.0392332
4.1915207
4.2629776
4.1356020
4.2647386
4.4922714
4.5622220
4.4029360
4.5087366
4.6259847
4.6793890
5.0826612
4.8744206
5.1262283
5.2914929
5.4136310
5.5176930
5.6838617
5.7043476
6.1272130
6.2987809
6.3886957
6.7363043
6.4276047
6.7431059
6.8973627
7.0461044
7.4170375
7.5335674
7.6382785
7.5001392
7.8367167
7.8627295
8.1570034
8.2677975
8.3691025
8.3157787
8.6507921
8.5380859
8.7457590
8.8766565
8.9957819
9.4086370
9.2976923
9.1666203
9.5562086
9.4445915
9.5937271
9.5391989
9.7914810
9.7707987
10.014866
9.8694038
10.086926
10.070402
10.140689
10.358998
10.547773
10.397189
10.616878
10.850748
10.820518
10.890109
10.967093
10.936852
10.996153
11.312604
11.382068
11.275920
11.237150
11.464695
11.733998
11.555235
11.594063
11.750486
11.719097
11.809939
12.001703
12.123749
12.068143
12.305802
12.398463
12.620493
12.616426
12.758910
12.791411
12.814006
12.958403
13.033417
12.982018
13.097528
13.326486
13.099764
13.440501
13.762190
13.757254
13.685774
13.790647
13.996119
13.993882
14.195066
14.017554
13.993523
14.137665
14.068213
13.908880
14.126356
14.090123
13.816242
13.845986
13.771297
14.081943
13.869555
13.688763
13.756604
13.374838
13.495052
13.327528
13.196979
12.910977
12.892890
12.608303
12.453722
12.261135
11.895277
11.831989
11.474671
11.331120
11.078547
10.780775
10.553984
10.312628
10.234334
9.8746061
9.6202841
9.2517500
8.9077330
8.5553513
8.2447739
8.2016010
8.0945034
7.6051397
7.3414907
7.1926098
6.7445426
6.6355791
6.5867977
6.2250996
6.1827264
5.7160850
5.7975760
5.6851592
5.3907700
5.2925820
5.1095896
4.7592812
4.7868695
4.6418242
4.3699365
4.3055477
4.3884525
4.1613369
4.0429530
3.8451636
4.0363250
4.0363483
3.7999976
3.8972006
3.9059372]Hello everyone,
I have been trying to do curve fit for the data given below.
I want to implement ‘cosine square’ curve fitting for the data obtained and later find the peak. I have already written a program for it and obtained the graph below as attached. But I am unsure if I am correct in implementing it, so that I can find a peak.
Can someone please check my programme if it is correctly implemented and latter how can I find the peak?
The program and also the data is attached.
I request to please help in setting the cosine square curve fitting and also how can I find peak from it please.
Thanking you in advance.
Kind regards
x_axis = [linspace(0, 360, 360)’];
y_axis =
[3.7560368
3.8085489
3.7661638
3.7799058
3.8907118
3.6859937
3.8746176
3.8137977
3.8134153
4.0203352
4.1017566
4.0970173
3.9302003
4.1788678
4.2053556
4.1945562
4.2701845
4.2767544
4.4449506
4.2852941
4.3978033
4.4853888
4.6127644
4.7098279
4.8618488
5.1263094
5.3121061
5.2374048
5.4019165
5.3228474
5.7068501
5.8063822
5.6671882
6.0611329
6.3209352
6.3571095
6.3894024
6.3625441
6.7195029
6.9633155
7.1388698
7.1086278
7.3036475
7.7009292
7.5671926
7.8018169
7.8800983
7.9435253
8.2067919
8.0853844
8.4278364
8.5053186
8.7994070
8.8510847
8.8690329
9.1009340
9.0523500
9.2792454
9.1106558
9.3377943
9.3589869
9.5377388
9.5682468
9.6855421
9.9991894
10.101757
10.096369
10.156980
10.274252
10.360273
10.509270
10.480047
10.654547
10.673642
10.609531
10.812882
10.907791
10.918486
11.225864
11.290207
11.172333
11.488586
11.520347
11.551353
11.549279
11.526500
11.671359
11.850876
12.058664
12.165114
12.094005
12.211543
12.288712
12.303370
12.436886
12.596936
12.663608
12.708924
12.855083
12.925530
13.090031
13.018736
13.070112
13.107990
13.310437
13.422553
13.567563
13.744937
13.490406
13.864213
13.847771
13.847562
14.041366
14.147572
14.082581
13.991263
14.123412
14.369276
14.390491
14.520578
14.327042
14.693224
14.133552
14.292513
14.025004
14.026464
13.991936
13.935472
13.823612
13.694707
13.577332
13.184267
13.157513
12.778562
12.687349
12.503510
12.076763
11.935090
11.697372
11.518528
11.050751
10.501066
10.570576
10.255017
10.040149
9.6180134
9.4150209
9.1862717
9.1615105
8.8085833
8.4177094
8.1676283
7.9493303
7.8774567
7.4021716
7.2626643
7.0130467
6.8367281
6.5165462
6.2733707
6.0217953
5.8303905
5.7666621
5.5948973
5.3705506
5.0788374
4.8748956
4.9039559
4.7801609
4.5220037
4.4644861
4.3326731
4.1139574
4.0280752
4.0393724
3.9195518
3.8203096
3.9346380
3.9120667
3.9352870
3.7858152
3.7302327
3.8530660
3.8764021
4.0210533
3.8053162
3.7861629
4.0157118
3.8974786
4.0198369
3.8873518
4.0392332
4.1915207
4.2629776
4.1356020
4.2647386
4.4922714
4.5622220
4.4029360
4.5087366
4.6259847
4.6793890
5.0826612
4.8744206
5.1262283
5.2914929
5.4136310
5.5176930
5.6838617
5.7043476
6.1272130
6.2987809
6.3886957
6.7363043
6.4276047
6.7431059
6.8973627
7.0461044
7.4170375
7.5335674
7.6382785
7.5001392
7.8367167
7.8627295
8.1570034
8.2677975
8.3691025
8.3157787
8.6507921
8.5380859
8.7457590
8.8766565
8.9957819
9.4086370
9.2976923
9.1666203
9.5562086
9.4445915
9.5937271
9.5391989
9.7914810
9.7707987
10.014866
9.8694038
10.086926
10.070402
10.140689
10.358998
10.547773
10.397189
10.616878
10.850748
10.820518
10.890109
10.967093
10.936852
10.996153
11.312604
11.382068
11.275920
11.237150
11.464695
11.733998
11.555235
11.594063
11.750486
11.719097
11.809939
12.001703
12.123749
12.068143
12.305802
12.398463
12.620493
12.616426
12.758910
12.791411
12.814006
12.958403
13.033417
12.982018
13.097528
13.326486
13.099764
13.440501
13.762190
13.757254
13.685774
13.790647
13.996119
13.993882
14.195066
14.017554
13.993523
14.137665
14.068213
13.908880
14.126356
14.090123
13.816242
13.845986
13.771297
14.081943
13.869555
13.688763
13.756604
13.374838
13.495052
13.327528
13.196979
12.910977
12.892890
12.608303
12.453722
12.261135
11.895277
11.831989
11.474671
11.331120
11.078547
10.780775
10.553984
10.312628
10.234334
9.8746061
9.6202841
9.2517500
8.9077330
8.5553513
8.2447739
8.2016010
8.0945034
7.6051397
7.3414907
7.1926098
6.7445426
6.6355791
6.5867977
6.2250996
6.1827264
5.7160850
5.7975760
5.6851592
5.3907700
5.2925820
5.1095896
4.7592812
4.7868695
4.6418242
4.3699365
4.3055477
4.3884525
4.1613369
4.0429530
3.8451636
4.0363250
4.0363483
3.7999976
3.8972006
3.9059372] Hello everyone,
I have been trying to do curve fit for the data given below.
I want to implement ‘cosine square’ curve fitting for the data obtained and later find the peak. I have already written a program for it and obtained the graph below as attached. But I am unsure if I am correct in implementing it, so that I can find a peak.
Can someone please check my programme if it is correctly implemented and latter how can I find the peak?
The program and also the data is attached.
I request to please help in setting the cosine square curve fitting and also how can I find peak from it please.
Thanking you in advance.
Kind regards
x_axis = [linspace(0, 360, 360)’];
y_axis =
[3.7560368
3.8085489
3.7661638
3.7799058
3.8907118
3.6859937
3.8746176
3.8137977
3.8134153
4.0203352
4.1017566
4.0970173
3.9302003
4.1788678
4.2053556
4.1945562
4.2701845
4.2767544
4.4449506
4.2852941
4.3978033
4.4853888
4.6127644
4.7098279
4.8618488
5.1263094
5.3121061
5.2374048
5.4019165
5.3228474
5.7068501
5.8063822
5.6671882
6.0611329
6.3209352
6.3571095
6.3894024
6.3625441
6.7195029
6.9633155
7.1388698
7.1086278
7.3036475
7.7009292
7.5671926
7.8018169
7.8800983
7.9435253
8.2067919
8.0853844
8.4278364
8.5053186
8.7994070
8.8510847
8.8690329
9.1009340
9.0523500
9.2792454
9.1106558
9.3377943
9.3589869
9.5377388
9.5682468
9.6855421
9.9991894
10.101757
10.096369
10.156980
10.274252
10.360273
10.509270
10.480047
10.654547
10.673642
10.609531
10.812882
10.907791
10.918486
11.225864
11.290207
11.172333
11.488586
11.520347
11.551353
11.549279
11.526500
11.671359
11.850876
12.058664
12.165114
12.094005
12.211543
12.288712
12.303370
12.436886
12.596936
12.663608
12.708924
12.855083
12.925530
13.090031
13.018736
13.070112
13.107990
13.310437
13.422553
13.567563
13.744937
13.490406
13.864213
13.847771
13.847562
14.041366
14.147572
14.082581
13.991263
14.123412
14.369276
14.390491
14.520578
14.327042
14.693224
14.133552
14.292513
14.025004
14.026464
13.991936
13.935472
13.823612
13.694707
13.577332
13.184267
13.157513
12.778562
12.687349
12.503510
12.076763
11.935090
11.697372
11.518528
11.050751
10.501066
10.570576
10.255017
10.040149
9.6180134
9.4150209
9.1862717
9.1615105
8.8085833
8.4177094
8.1676283
7.9493303
7.8774567
7.4021716
7.2626643
7.0130467
6.8367281
6.5165462
6.2733707
6.0217953
5.8303905
5.7666621
5.5948973
5.3705506
5.0788374
4.8748956
4.9039559
4.7801609
4.5220037
4.4644861
4.3326731
4.1139574
4.0280752
4.0393724
3.9195518
3.8203096
3.9346380
3.9120667
3.9352870
3.7858152
3.7302327
3.8530660
3.8764021
4.0210533
3.8053162
3.7861629
4.0157118
3.8974786
4.0198369
3.8873518
4.0392332
4.1915207
4.2629776
4.1356020
4.2647386
4.4922714
4.5622220
4.4029360
4.5087366
4.6259847
4.6793890
5.0826612
4.8744206
5.1262283
5.2914929
5.4136310
5.5176930
5.6838617
5.7043476
6.1272130
6.2987809
6.3886957
6.7363043
6.4276047
6.7431059
6.8973627
7.0461044
7.4170375
7.5335674
7.6382785
7.5001392
7.8367167
7.8627295
8.1570034
8.2677975
8.3691025
8.3157787
8.6507921
8.5380859
8.7457590
8.8766565
8.9957819
9.4086370
9.2976923
9.1666203
9.5562086
9.4445915
9.5937271
9.5391989
9.7914810
9.7707987
10.014866
9.8694038
10.086926
10.070402
10.140689
10.358998
10.547773
10.397189
10.616878
10.850748
10.820518
10.890109
10.967093
10.936852
10.996153
11.312604
11.382068
11.275920
11.237150
11.464695
11.733998
11.555235
11.594063
11.750486
11.719097
11.809939
12.001703
12.123749
12.068143
12.305802
12.398463
12.620493
12.616426
12.758910
12.791411
12.814006
12.958403
13.033417
12.982018
13.097528
13.326486
13.099764
13.440501
13.762190
13.757254
13.685774
13.790647
13.996119
13.993882
14.195066
14.017554
13.993523
14.137665
14.068213
13.908880
14.126356
14.090123
13.816242
13.845986
13.771297
14.081943
13.869555
13.688763
13.756604
13.374838
13.495052
13.327528
13.196979
12.910977
12.892890
12.608303
12.453722
12.261135
11.895277
11.831989
11.474671
11.331120
11.078547
10.780775
10.553984
10.312628
10.234334
9.8746061
9.6202841
9.2517500
8.9077330
8.5553513
8.2447739
8.2016010
8.0945034
7.6051397
7.3414907
7.1926098
6.7445426
6.6355791
6.5867977
6.2250996
6.1827264
5.7160850
5.7975760
5.6851592
5.3907700
5.2925820
5.1095896
4.7592812
4.7868695
4.6418242
4.3699365
4.3055477
4.3884525
4.1613369
4.0429530
3.8451636
4.0363250
4.0363483
3.7999976
3.8972006
3.9059372] curve fitting, cosine MATLAB Answers — New Questions
Why I can only choose Xilinx Vivado as the Synthesis tool?
Hello
I’m working with Deep Learning Toolbox, following a guide, just trying to change the FPGA.
hPC = dlhdl.ProcessorConfig;
hPC.SynthesisTool = ‘Altera Quartus II’;
hPC.SynthesisToolChipFamily = ‘Arria 10’ ;
hPC.TargetPlatform = ‘Intel Arria 10 SoC development kit’;
hPC.TargetFrequency = 200;
The code is pretty simple, but I get the following errors:
Error using dnnfpga.config.ProcessorConfigBase/set.SynthesisTool
Value must be a member of this set:
‘Xilinx Vivado’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
I tried installing many Add-ons hopping for a fix but still the same result…
I would like some help.
Thanks in advance!Hello
I’m working with Deep Learning Toolbox, following a guide, just trying to change the FPGA.
hPC = dlhdl.ProcessorConfig;
hPC.SynthesisTool = ‘Altera Quartus II’;
hPC.SynthesisToolChipFamily = ‘Arria 10’ ;
hPC.TargetPlatform = ‘Intel Arria 10 SoC development kit’;
hPC.TargetFrequency = 200;
The code is pretty simple, but I get the following errors:
Error using dnnfpga.config.ProcessorConfigBase/set.SynthesisTool
Value must be a member of this set:
‘Xilinx Vivado’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
I tried installing many Add-ons hopping for a fix but still the same result…
I would like some help.
Thanks in advance! Hello
I’m working with Deep Learning Toolbox, following a guide, just trying to change the FPGA.
hPC = dlhdl.ProcessorConfig;
hPC.SynthesisTool = ‘Altera Quartus II’;
hPC.SynthesisToolChipFamily = ‘Arria 10’ ;
hPC.TargetPlatform = ‘Intel Arria 10 SoC development kit’;
hPC.TargetFrequency = 200;
The code is pretty simple, but I get the following errors:
Error using dnnfpga.config.ProcessorConfigBase/set.SynthesisTool
Value must be a member of this set:
‘Xilinx Vivado’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
Error using dnnfpga.config.ProcessorConfigBase/set.TargetPlatform
Value must be a member of this set:
‘Generic Deep Learning Processor’
‘Xilinx Kintex-Ultrascale KCU105 evaluation board’
‘Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit’
‘Xilinx Zynq ZC706 evaluation kit’
I tried installing many Add-ons hopping for a fix but still the same result…
I would like some help.
Thanks in advance! deep learning, matlab, error, image processing MATLAB Answers — New Questions
How do I uninstall and reinstall MathWorks Service Host?
How do I uninstall and reinstall MathWorks Service Host?How do I uninstall and reinstall MathWorks Service Host? How do I uninstall and reinstall MathWorks Service Host? MATLAB Answers — New Questions
Why I am not able to open openExample(‘simscapefluids/ElectricVehicleThermalManagementExample’) ?
Getting error
openExample(‘simscapefluids/ElectricVehicleThermalManagementExample’)
Error using matlab.internal.examples.componentExamplesDir (line 16)
Invalid argument "simscapefluids".
Error in findExample (line 11)
componentExamplesDir = matlab.internal.examples.componentExamplesDir(component);
Error in openExample (line 30)
metadata = findExample(exampleId);Getting error
openExample(‘simscapefluids/ElectricVehicleThermalManagementExample’)
Error using matlab.internal.examples.componentExamplesDir (line 16)
Invalid argument "simscapefluids".
Error in findExample (line 11)
componentExamplesDir = matlab.internal.examples.componentExamplesDir(component);
Error in openExample (line 30)
metadata = findExample(exampleId); Getting error
openExample(‘simscapefluids/ElectricVehicleThermalManagementExample’)
Error using matlab.internal.examples.componentExamplesDir (line 16)
Invalid argument "simscapefluids".
Error in findExample (line 11)
componentExamplesDir = matlab.internal.examples.componentExamplesDir(component);
Error in openExample (line 30)
metadata = findExample(exampleId); simscape MATLAB Answers — New Questions
How to Cluster Dataset and remove outlier in MATLAB
Hello, I have the following dataset, In which i have four features in each column.
I want to cluster Dataset. I have go through K-means it required Number of clusters as input.Hello, I have the following dataset, In which i have four features in each column.
I want to cluster Dataset. I have go through K-means it required Number of clusters as input. Hello, I have the following dataset, In which i have four features in each column.
I want to cluster Dataset. I have go through K-means it required Number of clusters as input. array, machine learning, matlab, deep learning, arrays, cell array, cell arrays, matrix array, image processing, digital image processing, variable, statistics MATLAB Answers — New Questions
I’m new
Can anyone help me to solve out some problem that i faced in matlab bluetooth configuration:
t = instrhwinfo(‘Bluetooth’);
t.RemoteNames;
t.RemoteIDs;
instrhwinfo(‘Bluetooth’,’ASUS-PC’);
bt = Bluetooth(‘ASUS-PC’, 1)
fopen(bt)
I got error in fopen(bt) because Bluetooth status is still closed. I have Bluetooth built in my pc but i used USB dongle version 4.0. My pc is 64 bit OS and R2016b Matlab installed with 64 bit. Kindly appreciate for your help. Thank you.Can anyone help me to solve out some problem that i faced in matlab bluetooth configuration:
t = instrhwinfo(‘Bluetooth’);
t.RemoteNames;
t.RemoteIDs;
instrhwinfo(‘Bluetooth’,’ASUS-PC’);
bt = Bluetooth(‘ASUS-PC’, 1)
fopen(bt)
I got error in fopen(bt) because Bluetooth status is still closed. I have Bluetooth built in my pc but i used USB dongle version 4.0. My pc is 64 bit OS and R2016b Matlab installed with 64 bit. Kindly appreciate for your help. Thank you. Can anyone help me to solve out some problem that i faced in matlab bluetooth configuration:
t = instrhwinfo(‘Bluetooth’);
t.RemoteNames;
t.RemoteIDs;
instrhwinfo(‘Bluetooth’,’ASUS-PC’);
bt = Bluetooth(‘ASUS-PC’, 1)
fopen(bt)
I got error in fopen(bt) because Bluetooth status is still closed. I have Bluetooth built in my pc but i used USB dongle version 4.0. My pc is 64 bit OS and R2016b Matlab installed with 64 bit. Kindly appreciate for your help. Thank you. bluetooth MATLAB Answers — New Questions
Export Model from Matlab To ONNX
I am currently working on a multi-label image classification project in MATLAB and python.
I have developed a custom binary cross entropy loss layer. To extend the functionality of my model i use Python and try to export model with the ONNX framework.
However, I have encountered a notable discrepancy between the results obtained from MATLAB and ONNX. Despite my efforts to ensure proper conversion and preservation of model integrity, the outputs obtained through ONNX differ from the ones achieved within MATLAB.
the below example is what exactly i try to export.
a multi-label image classification using deep learning tutorial found at the following link: https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html
i think the diffrences between Matlab and ONNX rised from the CustomBinaryCrossEntropyLossLayer.
Thank you in advance for any guidance to solve this problem.I am currently working on a multi-label image classification project in MATLAB and python.
I have developed a custom binary cross entropy loss layer. To extend the functionality of my model i use Python and try to export model with the ONNX framework.
However, I have encountered a notable discrepancy between the results obtained from MATLAB and ONNX. Despite my efforts to ensure proper conversion and preservation of model integrity, the outputs obtained through ONNX differ from the ones achieved within MATLAB.
the below example is what exactly i try to export.
a multi-label image classification using deep learning tutorial found at the following link: https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html
i think the diffrences between Matlab and ONNX rised from the CustomBinaryCrossEntropyLossLayer.
Thank you in advance for any guidance to solve this problem. I am currently working on a multi-label image classification project in MATLAB and python.
I have developed a custom binary cross entropy loss layer. To extend the functionality of my model i use Python and try to export model with the ONNX framework.
However, I have encountered a notable discrepancy between the results obtained from MATLAB and ONNX. Despite my efforts to ensure proper conversion and preservation of model integrity, the outputs obtained through ONNX differ from the ones achieved within MATLAB.
the below example is what exactly i try to export.
a multi-label image classification using deep learning tutorial found at the following link: https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html
i think the diffrences between Matlab and ONNX rised from the CustomBinaryCrossEntropyLossLayer.
Thank you in advance for any guidance to solve this problem. deep learning, machine learning, multi label classification, custom layer, custom loss, multilabel image classification, gpu, resnet50, deploy MATLAB Answers — New Questions
Finding values within a 3D Array
The problem I have is that I have a 3D array with the dimension of 181x361x1931. If I was to simulate a line at any point through the 3D array, is there a way to retrieve all the data that the simulated line would penetrate through and store them within a new array.
I have seen various answers that deals with a 2D array, but haven’t seen anybody answer a question regarding a 3D array. I have also seen that there are various packages on Matlab that deals with Bresenham Line Algorithm in 3D matrix, but like I said the line is imaginary thus, i don;t have much of an idea of how to go about it. I was purely wondering if there is an easier way of doing such calculations.The problem I have is that I have a 3D array with the dimension of 181x361x1931. If I was to simulate a line at any point through the 3D array, is there a way to retrieve all the data that the simulated line would penetrate through and store them within a new array.
I have seen various answers that deals with a 2D array, but haven’t seen anybody answer a question regarding a 3D array. I have also seen that there are various packages on Matlab that deals with Bresenham Line Algorithm in 3D matrix, but like I said the line is imaginary thus, i don;t have much of an idea of how to go about it. I was purely wondering if there is an easier way of doing such calculations. The problem I have is that I have a 3D array with the dimension of 181x361x1931. If I was to simulate a line at any point through the 3D array, is there a way to retrieve all the data that the simulated line would penetrate through and store them within a new array.
I have seen various answers that deals with a 2D array, but haven’t seen anybody answer a question regarding a 3D array. I have also seen that there are various packages on Matlab that deals with Bresenham Line Algorithm in 3D matrix, but like I said the line is imaginary thus, i don;t have much of an idea of how to go about it. I was purely wondering if there is an easier way of doing such calculations. 3d matrix MATLAB Answers — New Questions
How to solve Simulink error: The path does not exist for Ti texas microcontroller
Post Content Post Content ti texas, microcontroller, simulink, embedded coder MATLAB Answers — New Questions
Error while multiplying 2 SISO transfer functions.
I have a script that reads transfer functions from .mat files, and I have what it looks like to be tf([-0.5 0],[0 1]) (I will note this with C1) and tf([0 1],[0.5 1]) (I will note this with C2). When I do the operation C1 * C2, I get the error:
"Error using *
First argument must be single or double."
I have also tried series(C1,C2), but I get the same error. (Both of them are tf type variables.)
Why I can not multiply those 2 transfer functions? Since I can not include my code (because I use multiple classes and the reader would need a repository to understand what those classes do) I am satisfied with theoretical scenarios regarding the nature of the error like "the number of inputs of C1 is not the same as the number of outputs of C2" (but this is not the case, since both are SISO tf).
Edit: tf is not overriden and it is the same tf as Transfer function model – MATLAB (mathworks.com).I have a script that reads transfer functions from .mat files, and I have what it looks like to be tf([-0.5 0],[0 1]) (I will note this with C1) and tf([0 1],[0.5 1]) (I will note this with C2). When I do the operation C1 * C2, I get the error:
"Error using *
First argument must be single or double."
I have also tried series(C1,C2), but I get the same error. (Both of them are tf type variables.)
Why I can not multiply those 2 transfer functions? Since I can not include my code (because I use multiple classes and the reader would need a repository to understand what those classes do) I am satisfied with theoretical scenarios regarding the nature of the error like "the number of inputs of C1 is not the same as the number of outputs of C2" (but this is not the case, since both are SISO tf).
Edit: tf is not overriden and it is the same tf as Transfer function model – MATLAB (mathworks.com). I have a script that reads transfer functions from .mat files, and I have what it looks like to be tf([-0.5 0],[0 1]) (I will note this with C1) and tf([0 1],[0.5 1]) (I will note this with C2). When I do the operation C1 * C2, I get the error:
"Error using *
First argument must be single or double."
I have also tried series(C1,C2), but I get the same error. (Both of them are tf type variables.)
Why I can not multiply those 2 transfer functions? Since I can not include my code (because I use multiple classes and the reader would need a repository to understand what those classes do) I am satisfied with theoretical scenarios regarding the nature of the error like "the number of inputs of C1 is not the same as the number of outputs of C2" (but this is not the case, since both are SISO tf).
Edit: tf is not overriden and it is the same tf as Transfer function model – MATLAB (mathworks.com). control, transfer function, mathematics MATLAB Answers — New Questions
Variable Frequency Ruining Signal in Simulink
I have a Simulink model. In some conditions i need to increase/decrease the frequency of the system by using ramps. Im using a Rate limiter to achieve this. Although when i try to change the frequency, actual frequency of signal gets more faster than my input. After frequency meets the desired level (when rate limiter gives constant value) signal turns to normal. I prepared an example to show my problem visually:
Here i used an sin block and changed its frequency from 1 to 2 (sec. 15). Slew rate of the Rate Limiter is set to 1. This is the scope:
Signal turns to normal frequency after about 6 seconds.This problem may be about solver options. My simulation operates on ode1 solver with 1e-4 step size. Is there any way to overcome this problem preferably without changing the step size ?I have a Simulink model. In some conditions i need to increase/decrease the frequency of the system by using ramps. Im using a Rate limiter to achieve this. Although when i try to change the frequency, actual frequency of signal gets more faster than my input. After frequency meets the desired level (when rate limiter gives constant value) signal turns to normal. I prepared an example to show my problem visually:
Here i used an sin block and changed its frequency from 1 to 2 (sec. 15). Slew rate of the Rate Limiter is set to 1. This is the scope:
Signal turns to normal frequency after about 6 seconds.This problem may be about solver options. My simulation operates on ode1 solver with 1e-4 step size. Is there any way to overcome this problem preferably without changing the step size ? I have a Simulink model. In some conditions i need to increase/decrease the frequency of the system by using ramps. Im using a Rate limiter to achieve this. Although when i try to change the frequency, actual frequency of signal gets more faster than my input. After frequency meets the desired level (when rate limiter gives constant value) signal turns to normal. I prepared an example to show my problem visually:
Here i used an sin block and changed its frequency from 1 to 2 (sec. 15). Slew rate of the Rate Limiter is set to 1. This is the scope:
Signal turns to normal frequency after about 6 seconds.This problem may be about solver options. My simulation operates on ode1 solver with 1e-4 step size. Is there any way to overcome this problem preferably without changing the step size ? variable, signal processing, frequency, simulink MATLAB Answers — New Questions
How do I set a read-only class to a specific value
Hello!
I was wondering is there a way to set the NumBytesAvailiable property of tcpclient to a specific value, to act in a way that the InputBufferSize functionality worked in previous versions of Matlab?
Thanks in advance!Hello!
I was wondering is there a way to set the NumBytesAvailiable property of tcpclient to a specific value, to act in a way that the InputBufferSize functionality worked in previous versions of Matlab?
Thanks in advance! Hello!
I was wondering is there a way to set the NumBytesAvailiable property of tcpclient to a specific value, to act in a way that the InputBufferSize functionality worked in previous versions of Matlab?
Thanks in advance! tcpclient, read-only, numbytesavailiable MATLAB Answers — New Questions
System Composer not Visible After Installation
Hello!
I’ve been trying to install and use the System Composer application. When I go to the add-on/app tab "Get More Apps" and search System Composer it says it’s installed. However whenever I go in MATLAB or Simulink for the app, I cannot find it. I’ve uninstalled it and reinstalled it multiple times (even reinstalled MATLAB) and restarted MATLAB and my computer. I’ve checked the documentation for System Composer and it says it is compatible with MATLAB R2022b (which is what I’m using).
Is there something I’m missing?
Thank you!Hello!
I’ve been trying to install and use the System Composer application. When I go to the add-on/app tab "Get More Apps" and search System Composer it says it’s installed. However whenever I go in MATLAB or Simulink for the app, I cannot find it. I’ve uninstalled it and reinstalled it multiple times (even reinstalled MATLAB) and restarted MATLAB and my computer. I’ve checked the documentation for System Composer and it says it is compatible with MATLAB R2022b (which is what I’m using).
Is there something I’m missing?
Thank you! Hello!
I’ve been trying to install and use the System Composer application. When I go to the add-on/app tab "Get More Apps" and search System Composer it says it’s installed. However whenever I go in MATLAB or Simulink for the app, I cannot find it. I’ve uninstalled it and reinstalled it multiple times (even reinstalled MATLAB) and restarted MATLAB and my computer. I’ve checked the documentation for System Composer and it says it is compatible with MATLAB R2022b (which is what I’m using).
Is there something I’m missing?
Thank you! system composer, installation MATLAB Answers — New Questions
How do variables work in Matlab App Designer?
Something that I’ve noticed about Matlab App Designer is that the majoirty of the code is within functions. Does this mean that if I define variables in the function, I can’t call upon those same variables in other parts of the code?Something that I’ve noticed about Matlab App Designer is that the majoirty of the code is within functions. Does this mean that if I define variables in the function, I can’t call upon those same variables in other parts of the code? Something that I’ve noticed about Matlab App Designer is that the majoirty of the code is within functions. Does this mean that if I define variables in the function, I can’t call upon those same variables in other parts of the code? matlab code MATLAB Answers — New Questions
problem with genetic algorithm
my 6 variables optimization problem always shows this error.
"Optimization terminated: average change in the fitness value less than options. FunctionTolerance and constraint violation is less than options.ConstraintTolerance."
I’ve tried smaller Constraint Tolerance, increasing population and increasing stall generation but still the same error appears.
and one more thing
Every time I try to run the code this message appears several times and it takes me around five times pressing “run” button.my 6 variables optimization problem always shows this error.
"Optimization terminated: average change in the fitness value less than options. FunctionTolerance and constraint violation is less than options.ConstraintTolerance."
I’ve tried smaller Constraint Tolerance, increasing population and increasing stall generation but still the same error appears.
and one more thing
Every time I try to run the code this message appears several times and it takes me around five times pressing “run” button. my 6 variables optimization problem always shows this error.
"Optimization terminated: average change in the fitness value less than options. FunctionTolerance and constraint violation is less than options.ConstraintTolerance."
I’ve tried smaller Constraint Tolerance, increasing population and increasing stall generation but still the same error appears.
and one more thing
Every time I try to run the code this message appears several times and it takes me around five times pressing “run” button. genetic algorithm, optimization, matlab MATLAB Answers — New Questions
Using a Single Event Function to Account for Multiple Events
Hi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun KimHi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun Kim Hi All,
I have been using event functions in my simulation and they are great. Just ran into a case where I would like to stop the numerical integration after two of my event functions trigger… Can I cherry pick event functions and make a single event function to take care of all?
I am assuming that the event value starts positive and crosses zero at some point. Then, I could probably call another event function inside my current event function, correct? And then, may be I can use max function to choose the largest event value to make sure that all the events are triggered? Will this method work? If so, could this method suffer computationally?
The problem here is that, for the case having multiple events, I do not necessarily know in advance which event would occur first!
Many thanks in advance! 🙂
Sincerely,
Taehun Kim ode, event function MATLAB Answers — New Questions
how to convert numerical dataset to image ?
I have a numeric dataset of 2816 x 2500 doubles. I want to convert it to an image format file for convolutional neural network input and then see some of these images. What command should I use?
the size of my file is too large for upload here…I have a numeric dataset of 2816 x 2500 doubles. I want to convert it to an image format file for convolutional neural network input and then see some of these images. What command should I use?
the size of my file is too large for upload here… I have a numeric dataset of 2816 x 2500 doubles. I want to convert it to an image format file for convolutional neural network input and then see some of these images. What command should I use?
the size of my file is too large for upload here… matlab code, image MATLAB Answers — New Questions
How do I change and save Check Box name in app designer so that it loads when I restart the app next time?
I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want?I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want? I’m trying to change and save a Check Box name given an input from the user from a Edit Field.
I used some code from Here as a starter.
At the top I have defined some functions that I’m using
methods (Access = public)
function saveState(app)
state.CheckBox.Text= app.InputEditField.Value;
state.CheckBox.Text = app.InputEditField.Value;
save(‘MyAppDefaultValues.mat’,’state’);
end
function loadState(app)
load(‘MyAppDefaultValues.mat’,’state’);
app.CheckBox.Text = state.InputEditField.Value;
app.CheckBox.Text = state.InputEditField.Value;
end
end
After that I have the code to try to load a specific state that has been saved.
function startupFcn(app)
try
app.loadState;
catch
end
end
Then I have the code that changes the name of the check box.
function InputEditFieldValueChanged(app, event)
value = app.InputEditField.Value;
app.CheckBox.Text = value;
end
Finally I have the closing out function that will save the state right before closing.
function UIFigureCloseRequest(app, event)
app.saveStateC;
delete(app)
end
What can I change to attain the results I want? app designer MATLAB Answers — New Questions
How can I find status of my model execution?
Interested in showing progress of the model run to user who kicks-off model using MathWorks Http client. is there any out of the box solution available to achieve this?Interested in showing progress of the model run to user who kicks-off model using MathWorks Http client. is there any out of the box solution available to achieve this? Interested in showing progress of the model run to user who kicks-off model using MathWorks Http client. is there any out of the box solution available to achieve this? modelling execution status, status MATLAB Answers — New Questions
Unable to load MathworksSimulation Plugin in Unreal
Hi,
I have installed "Vehicle Dynamics Blockset Interface for Unreal Engine 4 Projects" and trying to run the Custom method to open the AutoVrtlEnv project in Unreal.
I have followed the procedure https://in.mathworks.com/help/vdynblks/ug/support-package-for-customizing-scenes.html, installed UE4.19 (tried with 4.19.2, 4.19.0, 4.19.2_release tags from Unreal github directories and buiding the executable as EPIC Launcher is having only UE4.24 and UE4.23 versions as of now).
When tried to open the project from Matlab environment, I am getting the following errors:
Missing or incompatible:
2. If I choose No in the above option (step 1) then getting the error as failed to load:
3. If I press OK in step 2, the Epic launcher app is launched which provides only the latest 4.24 version launch option.
4. If I press Yes in step 1, the AutoVrtlEnv project is opened but having the Load errors as below:
5. Also having the MathworksSimulation Plugin disabled:
6. If I try to enable, the Unreal application is asking for a restart and the same sequence continues. Below snapshots are for your reference on the unreal version being used:
Note that the source is built using the Github https://github.com/EpicGames/UnrealEngine/tree/4.19. I also tried with https://github.com/EpicGames/UnrealEngine/tree/4.19.2-release and https://github.com/EpicGames/UnrealEngine/tree/4.19.0-release. But all are providing the same above errors only.
7. I tried opening the AutoVrtlEnv project using the latest UE 4.24.1. But getting the following error:
8. If I provide No, then the project is not loaded. If I press Yes, then getting the following error:
Request your support in adding the MathworksSimulation plugin inside Unreal engine and use the custom mode to edit the scenes in VehicleDynamicsBlockset.Hi,
I have installed "Vehicle Dynamics Blockset Interface for Unreal Engine 4 Projects" and trying to run the Custom method to open the AutoVrtlEnv project in Unreal.
I have followed the procedure https://in.mathworks.com/help/vdynblks/ug/support-package-for-customizing-scenes.html, installed UE4.19 (tried with 4.19.2, 4.19.0, 4.19.2_release tags from Unreal github directories and buiding the executable as EPIC Launcher is having only UE4.24 and UE4.23 versions as of now).
When tried to open the project from Matlab environment, I am getting the following errors:
Missing or incompatible:
2. If I choose No in the above option (step 1) then getting the error as failed to load:
3. If I press OK in step 2, the Epic launcher app is launched which provides only the latest 4.24 version launch option.
4. If I press Yes in step 1, the AutoVrtlEnv project is opened but having the Load errors as below:
5. Also having the MathworksSimulation Plugin disabled:
6. If I try to enable, the Unreal application is asking for a restart and the same sequence continues. Below snapshots are for your reference on the unreal version being used:
Note that the source is built using the Github https://github.com/EpicGames/UnrealEngine/tree/4.19. I also tried with https://github.com/EpicGames/UnrealEngine/tree/4.19.2-release and https://github.com/EpicGames/UnrealEngine/tree/4.19.0-release. But all are providing the same above errors only.
7. I tried opening the AutoVrtlEnv project using the latest UE 4.24.1. But getting the following error:
8. If I provide No, then the project is not loaded. If I press Yes, then getting the following error:
Request your support in adding the MathworksSimulation plugin inside Unreal engine and use the custom mode to edit the scenes in VehicleDynamicsBlockset. Hi,
I have installed "Vehicle Dynamics Blockset Interface for Unreal Engine 4 Projects" and trying to run the Custom method to open the AutoVrtlEnv project in Unreal.
I have followed the procedure https://in.mathworks.com/help/vdynblks/ug/support-package-for-customizing-scenes.html, installed UE4.19 (tried with 4.19.2, 4.19.0, 4.19.2_release tags from Unreal github directories and buiding the executable as EPIC Launcher is having only UE4.24 and UE4.23 versions as of now).
When tried to open the project from Matlab environment, I am getting the following errors:
Missing or incompatible:
2. If I choose No in the above option (step 1) then getting the error as failed to load:
3. If I press OK in step 2, the Epic launcher app is launched which provides only the latest 4.24 version launch option.
4. If I press Yes in step 1, the AutoVrtlEnv project is opened but having the Load errors as below:
5. Also having the MathworksSimulation Plugin disabled:
6. If I try to enable, the Unreal application is asking for a restart and the same sequence continues. Below snapshots are for your reference on the unreal version being used:
Note that the source is built using the Github https://github.com/EpicGames/UnrealEngine/tree/4.19. I also tried with https://github.com/EpicGames/UnrealEngine/tree/4.19.2-release and https://github.com/EpicGames/UnrealEngine/tree/4.19.0-release. But all are providing the same above errors only.
7. I tried opening the AutoVrtlEnv project using the latest UE 4.24.1. But getting the following error:
8. If I provide No, then the project is not loaded. If I press Yes, then getting the following error:
Request your support in adding the MathworksSimulation plugin inside Unreal engine and use the custom mode to edit the scenes in VehicleDynamicsBlockset. matlab, simulink, vehicle dynamics blockset, unreal engine, mathworkssimulation plugin, autovrtlenv MATLAB Answers — New Questions