Tag Archives: matlab
Asynchronous readwrite via serial port (App designer)
I used serial.
and used func for serial fwrite(app.s, values, ‘uint8’, ‘async’). I could select property ‘async’ to write to serial port.
Matlab tells me: serial will be removed in a future release. Use serialport instead.
How can I use property ‘async’ for serialport? I need to write/read asynchronous via serialport.I used serial.
and used func for serial fwrite(app.s, values, ‘uint8’, ‘async’). I could select property ‘async’ to write to serial port.
Matlab tells me: serial will be removed in a future release. Use serialport instead.
How can I use property ‘async’ for serialport? I need to write/read asynchronous via serialport. I used serial.
and used func for serial fwrite(app.s, values, ‘uint8’, ‘async’). I could select property ‘async’ to write to serial port.
Matlab tells me: serial will be removed in a future release. Use serialport instead.
How can I use property ‘async’ for serialport? I need to write/read asynchronous via serialport. app designer, matlab, serial MATLAB Answers — New Questions
Error when opening a test report related to stateflow
I have several mldatx files which are related to previous test results. Until yesterday, I could open them quite good tho but I today I couldn’t open any because I get the following error on the cmd window:
failed assertion in B:matlabtoolboxstateflowsrcstateflowutilssimutils.cpp at line 261:
SLGlue::isStateflowBlock(block)
[ 0] 0x00007ffcb5d8749d C:Program FilesMATLABR2023bbinwin64stateflow.dll+13857949 SF::mx2str_write_str+00034349
[ 1] 0x00007ffcb59d9a32 C:Program FilesMATLABR2023bbinwin64stateflow.dll+10000946 SF::sf_mexFunction+00002562
[ 2] 0x00007ffcb59d903c C:Program FilesMATLABR2023bbinwin64stateflow.dll+09998396 SF::sf_mexFunction+00000012
[ 3] 0x00007ffd72156f89 C:Program FilesMATLABR2023bbinwin64libmex.dll+00683913 mexfile::Inspector::needs_upgrade+00023257
[ 4] 0x00007ffd7215a002 C:Program FilesMATLABR2023bbinwin64libmex.dll+00696322 MexRetrieveVersion+00009682
[ 5] 0x00007ffd7215a327 C:Program FilesMATLABR2023bbinwin64libmex.dll+00697127 MexRetrieveVersion+00010487
[ 6] 0x00007ffd7213b2ce C:Program FilesMATLABR2023bbinwin64libmex.dll+00570062 mexUnlock+00016942
[ 7] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 8] 0x00007ffd75723802 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01259522 Mfh_error::lookup+00012722
[ 9] 0x00007ffd757244dd C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262813 Mfh_file::dispatch+00000045
[ 10] 0x00007ffd718f705d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00421981 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00313389
[ 11] 0x00007ffd71906c3e C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00486462 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00377870
[ 12] 0x00007ffd47f0a93e C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06072638 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00006318
[ 13] 0x00007ffd47f0ca18 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06081048 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00014728
[ 14] 0x00007ffd47e41438 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05248056 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00212072
[ 15] 0x00007ffd47e5e379 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05366649 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00330665
[ 16] 0x00007ffd47d191c7 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+04035015 MathWorks::lxe::GetTag+00006663
[ 17] 0x00007ffd47d034f8 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03945720 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00041688
[ 18] 0x00007ffd47d078c0 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03963072 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00059040
[ 19] 0x00007ffd719f5790 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01464208 FeatureTestObservableWorkspace+00211120
[ 20] 0x00007ffd718eee3b C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00388667 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00280075
[ 21] 0x00007ffd718eeabc C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00387772 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00279180
[ 22] 0x00007ffd718f14f2 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00398578 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00289986
[ 23] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 24] 0x00007ffd75723228 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01258024 Mfh_error::lookup+00011224
[ 25] 0x00007ffd7572449d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262749 Mfh_file::dispatch+00000045
[ 26] 0x00007ffd31a65ff6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+03825654 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00306918
[ 27] 0x00007ffd31993947 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02963783 mcos::heterogeneous::mcosIsHeterogeneousArray+00051367
[ 28] 0x00007ffd31993af1 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02964209 mcos::heterogeneous::mcosIsHeterogeneousArray+00051793
[ 29] 0x00007ffd31993f8f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02965391 mcos::heterogeneous::mcosIsHeterogeneousArray+00052975
[ 30] 0x00007ffd31997c7c C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02980988 mcos::heterogeneous::mcosIsHeterogeneousArray+00068572
[ 31] 0x00007ffd31aa35e6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+04077030 namedArgsToCell+00000870
[ 32] 0x00007ffd31ba614f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05136719 musBeA+00328719
[ 33] 0x00007ffd31ba4aa6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05130918 musBeA+00322918
[ 34] 0x00007ffd755fc07f C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00049279
[ 35] 0x00007ffd7561d76d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00186221 Mfh_MATLAB_fn_impl::dispatch_with_reuse+00000045
[ 36] 0x00007ffd47f3ac70 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06270064 MathWorks::lxe::CreateUnboundFunctionHandle+00011168
[ 37] 0x00007ffd7193ef8d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00716685 mwboost::archive::detail::pointer_oserializer<mwboost::archive::xml_oarchive,MathWorks::lxe::PreLineExecutionEvent>::save_object_ptr+00086333
[ 38] 0x00007ffd719b952f C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01217839 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00323199
[ 39] 0x00007ffd75357ed5 C:Program FilesMATLABR2023bbinwin64m_interpreter.dll+00753365 inCallFcn+00000069
[ 40] 0x00007ffd45437216 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02585110 slsv::mxw::WarningHandler::operator=+00004918
[ 41] 0x00007ffd4544bcde C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02669790 CMatlabCommand::execute+00000190
[ 42] 0x00007ffd4545c8e4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738404 slsvFEVAL_NoThrow+00000276
[ 43] 0x00007ffd4545c7c4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738116 slsvFEVAL_NoThrow+00000068
[ 44] 0x00007ffca39e5898 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07755928 stm_util::lookup<stm::CoverageMetrics>+00010120
[ 45] 0x00007ffca39ea4ad C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07775405 stm_util::lookup<stm::CoverageMetrics>+00029597
[ 46] 0x00007ffca39ed7a3 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07788451 stm_util::lookup<stm::CoverageMetrics>+00042643
[ 47] 0x00007ffd09c93044 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274500 dmr::ObjectRef::objectID+00003668
[ 48] 0x00007ffd09c92f30 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274224 dmr::ObjectRef::objectID+00003392
[ 49] 0x00007ffcf44891bf C:Program FilesMATLABR2023bbinwin64simulation_data_repository.dll+00823743 sdi::ObjectManager::safeTransaction+00000095
[ 50] 0x00007ffca39eaae9 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07777001 stm_util::lookup<stm::CoverageMetrics>+00031193
[ 51] 0x00007ffca3b6fc4e C:Program FilesMATLABR2023bbinwin64libmwstm.dll+09370702 stm::msgservice::unsubscribeAll+00110030
[ 52] 0x00007ffca3557fe4 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+02981860
[ 53] 0x00007ffca358df00 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+03202816 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00032240
[ 54] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 55] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 56] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 57] 0x00007ffd758acc61 C:Program FilesMATLABR2023bbinwin64iqm.dll+00445537 iqm::Iqm::create+00007745
[ 58] 0x00007ffd71fa3f5e C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081758 ioReadLine+00000430
[ 59] 0x00007ffd71fa3d75 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081269 ioReadLine+00000165
[ 60] 0x00007ffd71fd5fb0 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00286640 mnGetCommandLineBuffer+00000288
[ 61] 0x00007ffd71fd64b2 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00287922 mnParser+00000578
[ 62] 0x00007ffd731ab398 C:Program FilesMATLABR2023bbinwin64mcr.dll+00439192 mcr_initialize_main+00013816
[ 63] 0x00007ffd73158604 C:Program FilesMATLABR2023bbinwin64mcr.dll+00099844 mcrFunctionSignature::set_signature+00078996
[ 64] 0x00007ffd731761a0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00221600 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00017728
[ 65] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 66] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 67] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 68] 0x00007ffd758ade81 C:Program FilesMATLABR2023bbinwin64iqm.dll+00450177 iqm::Iqm::create+00012385
[ 69] 0x00007ffd758ad5c9 C:Program FilesMATLABR2023bbinwin64iqm.dll+00447945 iqm::Iqm::create+00010153
[ 70] 0x00007ffd73191c1c C:Program FilesMATLABR2023bbinwin64mcr.dll+00334876 mcrInstantiationError::operator=+00009948
[ 71] 0x00007ffd73192645 C:Program FilesMATLABR2023bbinwin64mcr.dll+00337477 mcrInstantiationError::operator=+00012549
[ 72] 0x00007ffd7318ffd0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00327632 mcrInstantiationError::operator=+00002704
[ 73] 0x00007ffe069892ea C:Program FilesMATLABR2023bbinwin64mwboost_thread-vc142-mt-x64-1_78.dll+00037610 mwboost::detail::win32::handle_manager::swap+00001642
[ 74] 0x00007ffe22dd9333 C:WINDOWSSystem32ucrtbase.dll+00168755 recalloc+00000163
[ 75] 0x00007ffe240d257d C:WINDOWSSystem32KERNEL32.DLL+00075133 BaseThreadInitThunk+00000029
[ 76] 0x00007ffe251eaf28 C:WINDOWSSYSTEM32ntdll.dll+00372520 RtlUserThreadStart+00000040
MATLAB stack trace:
> In cvi.TopModelCov.updateModelHandles>get_sf_block_instance_handle
In cvi.TopModelCov.updateModelHandles>update_sf_chart_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles
In cvi.ReportUtils.checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoadedForCovdata
In cvi.ReportUtils.loadTopModelAndRefModels
In cvmodelview
In stm.internal.Coverage.safeSlvnv
In stm.internal.Coverage.modelViewI have several mldatx files which are related to previous test results. Until yesterday, I could open them quite good tho but I today I couldn’t open any because I get the following error on the cmd window:
failed assertion in B:matlabtoolboxstateflowsrcstateflowutilssimutils.cpp at line 261:
SLGlue::isStateflowBlock(block)
[ 0] 0x00007ffcb5d8749d C:Program FilesMATLABR2023bbinwin64stateflow.dll+13857949 SF::mx2str_write_str+00034349
[ 1] 0x00007ffcb59d9a32 C:Program FilesMATLABR2023bbinwin64stateflow.dll+10000946 SF::sf_mexFunction+00002562
[ 2] 0x00007ffcb59d903c C:Program FilesMATLABR2023bbinwin64stateflow.dll+09998396 SF::sf_mexFunction+00000012
[ 3] 0x00007ffd72156f89 C:Program FilesMATLABR2023bbinwin64libmex.dll+00683913 mexfile::Inspector::needs_upgrade+00023257
[ 4] 0x00007ffd7215a002 C:Program FilesMATLABR2023bbinwin64libmex.dll+00696322 MexRetrieveVersion+00009682
[ 5] 0x00007ffd7215a327 C:Program FilesMATLABR2023bbinwin64libmex.dll+00697127 MexRetrieveVersion+00010487
[ 6] 0x00007ffd7213b2ce C:Program FilesMATLABR2023bbinwin64libmex.dll+00570062 mexUnlock+00016942
[ 7] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 8] 0x00007ffd75723802 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01259522 Mfh_error::lookup+00012722
[ 9] 0x00007ffd757244dd C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262813 Mfh_file::dispatch+00000045
[ 10] 0x00007ffd718f705d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00421981 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00313389
[ 11] 0x00007ffd71906c3e C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00486462 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00377870
[ 12] 0x00007ffd47f0a93e C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06072638 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00006318
[ 13] 0x00007ffd47f0ca18 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06081048 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00014728
[ 14] 0x00007ffd47e41438 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05248056 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00212072
[ 15] 0x00007ffd47e5e379 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05366649 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00330665
[ 16] 0x00007ffd47d191c7 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+04035015 MathWorks::lxe::GetTag+00006663
[ 17] 0x00007ffd47d034f8 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03945720 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00041688
[ 18] 0x00007ffd47d078c0 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03963072 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00059040
[ 19] 0x00007ffd719f5790 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01464208 FeatureTestObservableWorkspace+00211120
[ 20] 0x00007ffd718eee3b C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00388667 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00280075
[ 21] 0x00007ffd718eeabc C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00387772 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00279180
[ 22] 0x00007ffd718f14f2 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00398578 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00289986
[ 23] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 24] 0x00007ffd75723228 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01258024 Mfh_error::lookup+00011224
[ 25] 0x00007ffd7572449d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262749 Mfh_file::dispatch+00000045
[ 26] 0x00007ffd31a65ff6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+03825654 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00306918
[ 27] 0x00007ffd31993947 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02963783 mcos::heterogeneous::mcosIsHeterogeneousArray+00051367
[ 28] 0x00007ffd31993af1 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02964209 mcos::heterogeneous::mcosIsHeterogeneousArray+00051793
[ 29] 0x00007ffd31993f8f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02965391 mcos::heterogeneous::mcosIsHeterogeneousArray+00052975
[ 30] 0x00007ffd31997c7c C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02980988 mcos::heterogeneous::mcosIsHeterogeneousArray+00068572
[ 31] 0x00007ffd31aa35e6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+04077030 namedArgsToCell+00000870
[ 32] 0x00007ffd31ba614f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05136719 musBeA+00328719
[ 33] 0x00007ffd31ba4aa6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05130918 musBeA+00322918
[ 34] 0x00007ffd755fc07f C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00049279
[ 35] 0x00007ffd7561d76d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00186221 Mfh_MATLAB_fn_impl::dispatch_with_reuse+00000045
[ 36] 0x00007ffd47f3ac70 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06270064 MathWorks::lxe::CreateUnboundFunctionHandle+00011168
[ 37] 0x00007ffd7193ef8d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00716685 mwboost::archive::detail::pointer_oserializer<mwboost::archive::xml_oarchive,MathWorks::lxe::PreLineExecutionEvent>::save_object_ptr+00086333
[ 38] 0x00007ffd719b952f C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01217839 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00323199
[ 39] 0x00007ffd75357ed5 C:Program FilesMATLABR2023bbinwin64m_interpreter.dll+00753365 inCallFcn+00000069
[ 40] 0x00007ffd45437216 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02585110 slsv::mxw::WarningHandler::operator=+00004918
[ 41] 0x00007ffd4544bcde C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02669790 CMatlabCommand::execute+00000190
[ 42] 0x00007ffd4545c8e4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738404 slsvFEVAL_NoThrow+00000276
[ 43] 0x00007ffd4545c7c4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738116 slsvFEVAL_NoThrow+00000068
[ 44] 0x00007ffca39e5898 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07755928 stm_util::lookup<stm::CoverageMetrics>+00010120
[ 45] 0x00007ffca39ea4ad C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07775405 stm_util::lookup<stm::CoverageMetrics>+00029597
[ 46] 0x00007ffca39ed7a3 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07788451 stm_util::lookup<stm::CoverageMetrics>+00042643
[ 47] 0x00007ffd09c93044 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274500 dmr::ObjectRef::objectID+00003668
[ 48] 0x00007ffd09c92f30 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274224 dmr::ObjectRef::objectID+00003392
[ 49] 0x00007ffcf44891bf C:Program FilesMATLABR2023bbinwin64simulation_data_repository.dll+00823743 sdi::ObjectManager::safeTransaction+00000095
[ 50] 0x00007ffca39eaae9 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07777001 stm_util::lookup<stm::CoverageMetrics>+00031193
[ 51] 0x00007ffca3b6fc4e C:Program FilesMATLABR2023bbinwin64libmwstm.dll+09370702 stm::msgservice::unsubscribeAll+00110030
[ 52] 0x00007ffca3557fe4 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+02981860
[ 53] 0x00007ffca358df00 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+03202816 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00032240
[ 54] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 55] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 56] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 57] 0x00007ffd758acc61 C:Program FilesMATLABR2023bbinwin64iqm.dll+00445537 iqm::Iqm::create+00007745
[ 58] 0x00007ffd71fa3f5e C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081758 ioReadLine+00000430
[ 59] 0x00007ffd71fa3d75 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081269 ioReadLine+00000165
[ 60] 0x00007ffd71fd5fb0 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00286640 mnGetCommandLineBuffer+00000288
[ 61] 0x00007ffd71fd64b2 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00287922 mnParser+00000578
[ 62] 0x00007ffd731ab398 C:Program FilesMATLABR2023bbinwin64mcr.dll+00439192 mcr_initialize_main+00013816
[ 63] 0x00007ffd73158604 C:Program FilesMATLABR2023bbinwin64mcr.dll+00099844 mcrFunctionSignature::set_signature+00078996
[ 64] 0x00007ffd731761a0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00221600 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00017728
[ 65] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 66] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 67] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 68] 0x00007ffd758ade81 C:Program FilesMATLABR2023bbinwin64iqm.dll+00450177 iqm::Iqm::create+00012385
[ 69] 0x00007ffd758ad5c9 C:Program FilesMATLABR2023bbinwin64iqm.dll+00447945 iqm::Iqm::create+00010153
[ 70] 0x00007ffd73191c1c C:Program FilesMATLABR2023bbinwin64mcr.dll+00334876 mcrInstantiationError::operator=+00009948
[ 71] 0x00007ffd73192645 C:Program FilesMATLABR2023bbinwin64mcr.dll+00337477 mcrInstantiationError::operator=+00012549
[ 72] 0x00007ffd7318ffd0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00327632 mcrInstantiationError::operator=+00002704
[ 73] 0x00007ffe069892ea C:Program FilesMATLABR2023bbinwin64mwboost_thread-vc142-mt-x64-1_78.dll+00037610 mwboost::detail::win32::handle_manager::swap+00001642
[ 74] 0x00007ffe22dd9333 C:WINDOWSSystem32ucrtbase.dll+00168755 recalloc+00000163
[ 75] 0x00007ffe240d257d C:WINDOWSSystem32KERNEL32.DLL+00075133 BaseThreadInitThunk+00000029
[ 76] 0x00007ffe251eaf28 C:WINDOWSSYSTEM32ntdll.dll+00372520 RtlUserThreadStart+00000040
MATLAB stack trace:
> In cvi.TopModelCov.updateModelHandles>get_sf_block_instance_handle
In cvi.TopModelCov.updateModelHandles>update_sf_chart_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles
In cvi.ReportUtils.checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoadedForCovdata
In cvi.ReportUtils.loadTopModelAndRefModels
In cvmodelview
In stm.internal.Coverage.safeSlvnv
In stm.internal.Coverage.modelView I have several mldatx files which are related to previous test results. Until yesterday, I could open them quite good tho but I today I couldn’t open any because I get the following error on the cmd window:
failed assertion in B:matlabtoolboxstateflowsrcstateflowutilssimutils.cpp at line 261:
SLGlue::isStateflowBlock(block)
[ 0] 0x00007ffcb5d8749d C:Program FilesMATLABR2023bbinwin64stateflow.dll+13857949 SF::mx2str_write_str+00034349
[ 1] 0x00007ffcb59d9a32 C:Program FilesMATLABR2023bbinwin64stateflow.dll+10000946 SF::sf_mexFunction+00002562
[ 2] 0x00007ffcb59d903c C:Program FilesMATLABR2023bbinwin64stateflow.dll+09998396 SF::sf_mexFunction+00000012
[ 3] 0x00007ffd72156f89 C:Program FilesMATLABR2023bbinwin64libmex.dll+00683913 mexfile::Inspector::needs_upgrade+00023257
[ 4] 0x00007ffd7215a002 C:Program FilesMATLABR2023bbinwin64libmex.dll+00696322 MexRetrieveVersion+00009682
[ 5] 0x00007ffd7215a327 C:Program FilesMATLABR2023bbinwin64libmex.dll+00697127 MexRetrieveVersion+00010487
[ 6] 0x00007ffd7213b2ce C:Program FilesMATLABR2023bbinwin64libmex.dll+00570062 mexUnlock+00016942
[ 7] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 8] 0x00007ffd75723802 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01259522 Mfh_error::lookup+00012722
[ 9] 0x00007ffd757244dd C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262813 Mfh_file::dispatch+00000045
[ 10] 0x00007ffd718f705d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00421981 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00313389
[ 11] 0x00007ffd71906c3e C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00486462 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00377870
[ 12] 0x00007ffd47f0a93e C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06072638 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00006318
[ 13] 0x00007ffd47f0ca18 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06081048 MathWorks::lxe::ReadOnlyXvaluePtr::operator=+00014728
[ 14] 0x00007ffd47e41438 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05248056 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00212072
[ 15] 0x00007ffd47e5e379 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+05366649 MathWorks::lxe::XvalueFactory::XvalueDeleter::XvalueDeleter+00330665
[ 16] 0x00007ffd47d191c7 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+04035015 MathWorks::lxe::GetTag+00006663
[ 17] 0x00007ffd47d034f8 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03945720 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00041688
[ 18] 0x00007ffd47d078c0 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+03963072 MathWorks::lxe::SetEngineImplUnlinkFlagForAllCallsOnStack+00059040
[ 19] 0x00007ffd719f5790 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01464208 FeatureTestObservableWorkspace+00211120
[ 20] 0x00007ffd718eee3b C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00388667 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00280075
[ 21] 0x00007ffd718eeabc C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00387772 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00279180
[ 22] 0x00007ffd718f14f2 C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00398578 mwboost::archive::codecvt_null<wchar_t>::do_max_length+00289986
[ 23] 0x00007ffd757245a2 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01263010 Mfh_file::dispatch_file_common+00000178
[ 24] 0x00007ffd75723228 C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01258024 Mfh_error::lookup+00011224
[ 25] 0x00007ffd7572449d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+01262749 Mfh_file::dispatch+00000045
[ 26] 0x00007ffd31a65ff6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+03825654 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00306918
[ 27] 0x00007ffd31993947 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02963783 mcos::heterogeneous::mcosIsHeterogeneousArray+00051367
[ 28] 0x00007ffd31993af1 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02964209 mcos::heterogeneous::mcosIsHeterogeneousArray+00051793
[ 29] 0x00007ffd31993f8f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02965391 mcos::heterogeneous::mcosIsHeterogeneousArray+00052975
[ 30] 0x00007ffd31997c7c C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+02980988 mcos::heterogeneous::mcosIsHeterogeneousArray+00068572
[ 31] 0x00007ffd31aa35e6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+04077030 namedArgsToCell+00000870
[ 32] 0x00007ffd31ba614f C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05136719 musBeA+00328719
[ 33] 0x00007ffd31ba4aa6 C:Program FilesMATLABR2023bbinwin64mcos_impl.dll+05130918 musBeA+00322918
[ 34] 0x00007ffd755fc07f C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00049279
[ 35] 0x00007ffd7561d76d C:Program FilesMATLABR2023bbinwin64m_dispatcher.dll+00186221 Mfh_MATLAB_fn_impl::dispatch_with_reuse+00000045
[ 36] 0x00007ffd47f3ac70 C:Program FilesMATLABR2023bbinwin64m_lxe.dll+06270064 MathWorks::lxe::CreateUnboundFunctionHandle+00011168
[ 37] 0x00007ffd7193ef8d C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+00716685 mwboost::archive::detail::pointer_oserializer<mwboost::archive::xml_oarchive,MathWorks::lxe::PreLineExecutionEvent>::save_object_ptr+00086333
[ 38] 0x00007ffd719b952f C:Program FilesMATLABR2023bbinwin64libmwlxemainservices.dll+01217839 mwboost::archive::detail::oserializer<mwboost::archive::text_oarchive,MathWorks::MatlabComponents::ComponentIdentifier>::save_object_data+00323199
[ 39] 0x00007ffd75357ed5 C:Program FilesMATLABR2023bbinwin64m_interpreter.dll+00753365 inCallFcn+00000069
[ 40] 0x00007ffd45437216 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02585110 slsv::mxw::WarningHandler::operator=+00004918
[ 41] 0x00007ffd4544bcde C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02669790 CMatlabCommand::execute+00000190
[ 42] 0x00007ffd4545c8e4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738404 slsvFEVAL_NoThrow+00000276
[ 43] 0x00007ffd4545c7c4 C:Program FilesMATLABR2023bbinwin64libmwsl_services.dll+02738116 slsvFEVAL_NoThrow+00000068
[ 44] 0x00007ffca39e5898 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07755928 stm_util::lookup<stm::CoverageMetrics>+00010120
[ 45] 0x00007ffca39ea4ad C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07775405 stm_util::lookup<stm::CoverageMetrics>+00029597
[ 46] 0x00007ffca39ed7a3 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07788451 stm_util::lookup<stm::CoverageMetrics>+00042643
[ 47] 0x00007ffd09c93044 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274500 dmr::ObjectRef::objectID+00003668
[ 48] 0x00007ffd09c92f30 C:Program FilesMATLABR2023bbinwin64dmr.dll+00274224 dmr::ObjectRef::objectID+00003392
[ 49] 0x00007ffcf44891bf C:Program FilesMATLABR2023bbinwin64simulation_data_repository.dll+00823743 sdi::ObjectManager::safeTransaction+00000095
[ 50] 0x00007ffca39eaae9 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+07777001 stm_util::lookup<stm::CoverageMetrics>+00031193
[ 51] 0x00007ffca3b6fc4e C:Program FilesMATLABR2023bbinwin64libmwstm.dll+09370702 stm::msgservice::unsubscribeAll+00110030
[ 52] 0x00007ffca3557fe4 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+02981860
[ 53] 0x00007ffca358df00 C:Program FilesMATLABR2023bbinwin64libmwstm.dll+03202816 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00032240
[ 54] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 55] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 56] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 57] 0x00007ffd758acc61 C:Program FilesMATLABR2023bbinwin64iqm.dll+00445537 iqm::Iqm::create+00007745
[ 58] 0x00007ffd71fa3f5e C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081758 ioReadLine+00000430
[ 59] 0x00007ffd71fa3d75 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00081269 ioReadLine+00000165
[ 60] 0x00007ffd71fd5fb0 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00286640 mnGetCommandLineBuffer+00000288
[ 61] 0x00007ffd71fd64b2 C:Program FilesMATLABR2023bbinwin64libmwbridge.dll+00287922 mnParser+00000578
[ 62] 0x00007ffd731ab398 C:Program FilesMATLABR2023bbinwin64mcr.dll+00439192 mcr_initialize_main+00013816
[ 63] 0x00007ffd73158604 C:Program FilesMATLABR2023bbinwin64mcr.dll+00099844 mcrFunctionSignature::set_signature+00078996
[ 64] 0x00007ffd731761a0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00221600 mwboost::archive::codecvt_null<wchar_t>::`default constructor closure’+00017728
[ 65] 0x00007ffd75908c3a C:Program FilesMATLABR2023bbinwin64iqm.dll+00822330 iqm::PackagedTaskPlugin::execute+00000074
[ 66] 0x00007ffd731a58e0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00415968 installMOCmdWinSink+00074384
[ 67] 0x00007ffd758dcbb7 C:Program FilesMATLABR2023bbinwin64iqm.dll+00641975 iqm::Iqm::setupIqmFcnPtrs+00100471
[ 68] 0x00007ffd758ade81 C:Program FilesMATLABR2023bbinwin64iqm.dll+00450177 iqm::Iqm::create+00012385
[ 69] 0x00007ffd758ad5c9 C:Program FilesMATLABR2023bbinwin64iqm.dll+00447945 iqm::Iqm::create+00010153
[ 70] 0x00007ffd73191c1c C:Program FilesMATLABR2023bbinwin64mcr.dll+00334876 mcrInstantiationError::operator=+00009948
[ 71] 0x00007ffd73192645 C:Program FilesMATLABR2023bbinwin64mcr.dll+00337477 mcrInstantiationError::operator=+00012549
[ 72] 0x00007ffd7318ffd0 C:Program FilesMATLABR2023bbinwin64mcr.dll+00327632 mcrInstantiationError::operator=+00002704
[ 73] 0x00007ffe069892ea C:Program FilesMATLABR2023bbinwin64mwboost_thread-vc142-mt-x64-1_78.dll+00037610 mwboost::detail::win32::handle_manager::swap+00001642
[ 74] 0x00007ffe22dd9333 C:WINDOWSSystem32ucrtbase.dll+00168755 recalloc+00000163
[ 75] 0x00007ffe240d257d C:WINDOWSSystem32KERNEL32.DLL+00075133 BaseThreadInitThunk+00000029
[ 76] 0x00007ffe251eaf28 C:WINDOWSSYSTEM32ntdll.dll+00372520 RtlUserThreadStart+00000040
MATLAB stack trace:
> In cvi.TopModelCov.updateModelHandles>get_sf_block_instance_handle
In cvi.TopModelCov.updateModelHandles>update_sf_chart_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles>update_susbsys_handles
In cvi.TopModelCov.updateModelHandles
In cvi.ReportUtils.checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoaded
In cvi.ReportUtils.loadTopModelAndRefModels>checkModelLoadedForCovdata
In cvi.ReportUtils.loadTopModelAndRefModels
In cvmodelview
In stm.internal.Coverage.safeSlvnv
In stm.internal.Coverage.modelView stateflow, testing, simulink, test MATLAB Answers — New Questions
statement in test assessment block
how can i verify output (multiple statements)w.r.t time in test assessment block , for example-(if t==1 ,verify (out== 1 ) ) (if t==2,verify (out== 2) )……..(if t==8 ,verify (out== 8 ) ) can we use any loops in test assement block in simulink test ?
for t=1:8
if t==i
verify(out==i)
end
this for loop showing error.how can i verify output (multiple statements)w.r.t time in test assessment block , for example-(if t==1 ,verify (out== 1 ) ) (if t==2,verify (out== 2) )……..(if t==8 ,verify (out== 8 ) ) can we use any loops in test assement block in simulink test ?
for t=1:8
if t==i
verify(out==i)
end
this for loop showing error. how can i verify output (multiple statements)w.r.t time in test assessment block , for example-(if t==1 ,verify (out== 1 ) ) (if t==2,verify (out== 2) )……..(if t==8 ,verify (out== 8 ) ) can we use any loops in test assement block in simulink test ?
for t=1:8
if t==i
verify(out==i)
end
this for loop showing error. test manager, test assement block MATLAB Answers — New Questions
How to do fast fourier analysis of first harmonic in matlab?
In simulink there is a block called, Fast Fourier Analysis, that given the fundamental frequency it extracts the phase delay and the magnitude amplification. I need to do the same thing in matlab, how can i do it? The harmonics of which I would like to extract the information it is just the first one. Is there a function or a specific code that i can use?
The data signal would then be given as input as an array with the relative time.In simulink there is a block called, Fast Fourier Analysis, that given the fundamental frequency it extracts the phase delay and the magnitude amplification. I need to do the same thing in matlab, how can i do it? The harmonics of which I would like to extract the information it is just the first one. Is there a function or a specific code that i can use?
The data signal would then be given as input as an array with the relative time. In simulink there is a block called, Fast Fourier Analysis, that given the fundamental frequency it extracts the phase delay and the magnitude amplification. I need to do the same thing in matlab, how can i do it? The harmonics of which I would like to extract the information it is just the first one. Is there a function or a specific code that i can use?
The data signal would then be given as input as an array with the relative time. matlab, signal, fft, signal processing, digital signal processing, frequency, simulink MATLAB Answers — New Questions
How to add a customized drive cycle in the vehicle composer app?
I want to add a customized drive cycle in the vehicle composer app. How can I add it to the app?I want to add a customized drive cycle in the vehicle composer app. How can I add it to the app? I want to add a customized drive cycle in the vehicle composer app. How can I add it to the app? vehicle composer app, matlab, drive cycle MATLAB Answers — New Questions
Mapping external inputs from Excel file to Test Harness fails
Hello All,
i am using MATLAB R2015b and trying to run an equivalence test (MIL vs SIL) using SL Test Manager.
I have created a test harness for the model. In the "INPUT" section I am adding the input as external inputs since the inputs are defined in a excel file.
This simple model has only 2 inputs (boolean and uint8) and 1 ouput (boolean).
The first column of my excel file contains the time vector, the second and third one contain the input signal values.
When mapping the inputs I get the following message:
"Failed to map inputs. Use a different file or a different mapping mode."
I have tried the other mapping modes but still get the same error message.
Can anyone advise how to fix this issue?Hello All,
i am using MATLAB R2015b and trying to run an equivalence test (MIL vs SIL) using SL Test Manager.
I have created a test harness for the model. In the "INPUT" section I am adding the input as external inputs since the inputs are defined in a excel file.
This simple model has only 2 inputs (boolean and uint8) and 1 ouput (boolean).
The first column of my excel file contains the time vector, the second and third one contain the input signal values.
When mapping the inputs I get the following message:
"Failed to map inputs. Use a different file or a different mapping mode."
I have tried the other mapping modes but still get the same error message.
Can anyone advise how to fix this issue? Hello All,
i am using MATLAB R2015b and trying to run an equivalence test (MIL vs SIL) using SL Test Manager.
I have created a test harness for the model. In the "INPUT" section I am adding the input as external inputs since the inputs are defined in a excel file.
This simple model has only 2 inputs (boolean and uint8) and 1 ouput (boolean).
The first column of my excel file contains the time vector, the second and third one contain the input signal values.
When mapping the inputs I get the following message:
"Failed to map inputs. Use a different file or a different mapping mode."
I have tried the other mapping modes but still get the same error message.
Can anyone advise how to fix this issue? simulink test, test harness, input mapping, equivalence test MATLAB Answers — New Questions
gui coded with uifigure
Hi every body,
I have coded a moderatly complex gui first within a standard figure and a second version within a uifigure. As usually observed the second version is very very slow compared against the first one. This is not my problem. To obtain a correct gui I must execute ma code in debug mode step by step. Otherwise, the gui is very strange as if each graphic object was not finished before the next one begins to be buit. I have tried to add pause, drawnow, drownow limiterate, uifigure visible off until the last command… Nothing works.
Any idea to find a workaround?
Thank a lotHi every body,
I have coded a moderatly complex gui first within a standard figure and a second version within a uifigure. As usually observed the second version is very very slow compared against the first one. This is not my problem. To obtain a correct gui I must execute ma code in debug mode step by step. Otherwise, the gui is very strange as if each graphic object was not finished before the next one begins to be buit. I have tried to add pause, drawnow, drownow limiterate, uifigure visible off until the last command… Nothing works.
Any idea to find a workaround?
Thank a lot Hi every body,
I have coded a moderatly complex gui first within a standard figure and a second version within a uifigure. As usually observed the second version is very very slow compared against the first one. This is not my problem. To obtain a correct gui I must execute ma code in debug mode step by step. Otherwise, the gui is very strange as if each graphic object was not finished before the next one begins to be buit. I have tried to add pause, drawnow, drownow limiterate, uifigure visible off until the last command… Nothing works.
Any idea to find a workaround?
Thank a lot gui, uifigure MATLAB Answers — New Questions
How can I use a Rician simulation on Passband?
Hi,
I am developing a Rician simulation for an OTFS modem and implementing it on a signal that has been modulated to passband. I am using the ‘comm.RicianChannel’ function for this purpose.
However, I encountered an issue: the output of this function is complex, as if it were in baseband, while I need the output to be in passband and real-valued.
I attempted to create an analytic signal and then use only the real part after applying the channel, but I am uncertain if this approach is correct.
Could you please advise on how to adjust the function or filter to work with passband signals and obtain a real-valued output? Any suggestions or guidance would be greatly appreciated.
Thank you.
Code example of the Rician channel:
%% Configure a Rician channel object
ricChan = comm.RicianChannel( …
‘SampleRate’,fs, …
‘PathDelays’,delayVector, …
‘AveragePathGains’,gainVector, …
‘KFactor’,KFactor, …
‘DirectPathDopplerShift’,specDopplerShift, …
‘MaximumDopplerShift’,maxDopplerShift, …
‘RandomStream’,’mt19937ar with seed’, …
‘Seed’,randi([1 1000],1) , …
‘PathGainsOutputPort’,true);
%% Apply Rician channel object on the modulated data
for k = 1:numberOfReceivers
temp=[zeros(round(DelayTime(k) * fs),1); sigIn ; zeros(round(max(DelayTime * fs)) – round(DelayTime(k) * fs),1)];
noise = Pn * randn(1, size(sigIn, 2));
sigOut(:,k)=ricChan(temp);
sigOut(:,k)=sigOut(:,k)+noise;
endHi,
I am developing a Rician simulation for an OTFS modem and implementing it on a signal that has been modulated to passband. I am using the ‘comm.RicianChannel’ function for this purpose.
However, I encountered an issue: the output of this function is complex, as if it were in baseband, while I need the output to be in passband and real-valued.
I attempted to create an analytic signal and then use only the real part after applying the channel, but I am uncertain if this approach is correct.
Could you please advise on how to adjust the function or filter to work with passband signals and obtain a real-valued output? Any suggestions or guidance would be greatly appreciated.
Thank you.
Code example of the Rician channel:
%% Configure a Rician channel object
ricChan = comm.RicianChannel( …
‘SampleRate’,fs, …
‘PathDelays’,delayVector, …
‘AveragePathGains’,gainVector, …
‘KFactor’,KFactor, …
‘DirectPathDopplerShift’,specDopplerShift, …
‘MaximumDopplerShift’,maxDopplerShift, …
‘RandomStream’,’mt19937ar with seed’, …
‘Seed’,randi([1 1000],1) , …
‘PathGainsOutputPort’,true);
%% Apply Rician channel object on the modulated data
for k = 1:numberOfReceivers
temp=[zeros(round(DelayTime(k) * fs),1); sigIn ; zeros(round(max(DelayTime * fs)) – round(DelayTime(k) * fs),1)];
noise = Pn * randn(1, size(sigIn, 2));
sigOut(:,k)=ricChan(temp);
sigOut(:,k)=sigOut(:,k)+noise;
end Hi,
I am developing a Rician simulation for an OTFS modem and implementing it on a signal that has been modulated to passband. I am using the ‘comm.RicianChannel’ function for this purpose.
However, I encountered an issue: the output of this function is complex, as if it were in baseband, while I need the output to be in passband and real-valued.
I attempted to create an analytic signal and then use only the real part after applying the channel, but I am uncertain if this approach is correct.
Could you please advise on how to adjust the function or filter to work with passband signals and obtain a real-valued output? Any suggestions or guidance would be greatly appreciated.
Thank you.
Code example of the Rician channel:
%% Configure a Rician channel object
ricChan = comm.RicianChannel( …
‘SampleRate’,fs, …
‘PathDelays’,delayVector, …
‘AveragePathGains’,gainVector, …
‘KFactor’,KFactor, …
‘DirectPathDopplerShift’,specDopplerShift, …
‘MaximumDopplerShift’,maxDopplerShift, …
‘RandomStream’,’mt19937ar with seed’, …
‘Seed’,randi([1 1000],1) , …
‘PathGainsOutputPort’,true);
%% Apply Rician channel object on the modulated data
for k = 1:numberOfReceivers
temp=[zeros(round(DelayTime(k) * fs),1); sigIn ; zeros(round(max(DelayTime * fs)) – round(DelayTime(k) * fs),1)];
noise = Pn * randn(1, size(sigIn, 2));
sigOut(:,k)=ricChan(temp);
sigOut(:,k)=sigOut(:,k)+noise;
end ricianchannel, otfs channel, passband MATLAB Answers — New Questions
Problem in using mouse and keyboard at the same instance of time in a simulator
Hi,
I have a three screen simulator in Matlab. I am running this simulator on three monitor system. Two monitor are access by 1st person and one monitor access by 2nd person. Both the operators using their individual mouse and keyboard(total 2 mouse and 2 keyboard, possible using Mouse mux tool).
The simulator has scenarios where, 1st person is clicking at some valves to move it and at tha same time 2nd person is writing in a space on his window (in simulator) and vice-versa. Whenever 1st(or 2nd) person moving valve, the keyboard pointer of 2nd(or 1st) person going to the same place where 1st person is clciking. So 2nd person unable to write in the given sapce in the simulator, he has to again click on the writing space to write.
Please give me some suggestions to solve the issue, so that both the person can act simultaneously.
is it possible in Matlab.
Thank youHi,
I have a three screen simulator in Matlab. I am running this simulator on three monitor system. Two monitor are access by 1st person and one monitor access by 2nd person. Both the operators using their individual mouse and keyboard(total 2 mouse and 2 keyboard, possible using Mouse mux tool).
The simulator has scenarios where, 1st person is clicking at some valves to move it and at tha same time 2nd person is writing in a space on his window (in simulator) and vice-versa. Whenever 1st(or 2nd) person moving valve, the keyboard pointer of 2nd(or 1st) person going to the same place where 1st person is clciking. So 2nd person unable to write in the given sapce in the simulator, he has to again click on the writing space to write.
Please give me some suggestions to solve the issue, so that both the person can act simultaneously.
is it possible in Matlab.
Thank you Hi,
I have a three screen simulator in Matlab. I am running this simulator on three monitor system. Two monitor are access by 1st person and one monitor access by 2nd person. Both the operators using their individual mouse and keyboard(total 2 mouse and 2 keyboard, possible using Mouse mux tool).
The simulator has scenarios where, 1st person is clicking at some valves to move it and at tha same time 2nd person is writing in a space on his window (in simulator) and vice-versa. Whenever 1st(or 2nd) person moving valve, the keyboard pointer of 2nd(or 1st) person going to the same place where 1st person is clciking. So 2nd person unable to write in the given sapce in the simulator, he has to again click on the writing space to write.
Please give me some suggestions to solve the issue, so that both the person can act simultaneously.
is it possible in Matlab.
Thank you mutiple screen simulator, pointers MATLAB Answers — New Questions
Unrecognized function or variable ‘featureInputLayer’.
I am using Deep Learning Toolbox in 2020a and getting the error message ‘Unrecognized function or variable ‘featureInputLayer’.’
Do I need to upgrade to something?I am using Deep Learning Toolbox in 2020a and getting the error message ‘Unrecognized function or variable ‘featureInputLayer’.’
Do I need to upgrade to something? I am using Deep Learning Toolbox in 2020a and getting the error message ‘Unrecognized function or variable ‘featureInputLayer’.’
Do I need to upgrade to something? unrecognized function or variable ‘featureinputlayer’. MATLAB Answers — New Questions
collect2.exe: error: ld returned 1 exit status
I am trying to build S function to perform SIL on my model. but I am getting an error for the function "Runnable_Step" which I am calling from "output" (Code description) section of S function. The error is as below :
C:Users105316~1AppDataLocalTempmex_75352478274417_9204S_Function_EVDC_wrapper.obj: In function `S_Function_EVDC_Outputs_wrapper’: C:/Users/105316885/Documents/MATLAB/14JUN_SIL/S_Function_EVDC_wrapper.c:64: undefined reference to `Runnable_Step’ collect2.exe: error: ld returned 1 exit status
Can anyone suggest any solution.I am trying to build S function to perform SIL on my model. but I am getting an error for the function "Runnable_Step" which I am calling from "output" (Code description) section of S function. The error is as below :
C:Users105316~1AppDataLocalTempmex_75352478274417_9204S_Function_EVDC_wrapper.obj: In function `S_Function_EVDC_Outputs_wrapper’: C:/Users/105316885/Documents/MATLAB/14JUN_SIL/S_Function_EVDC_wrapper.c:64: undefined reference to `Runnable_Step’ collect2.exe: error: ld returned 1 exit status
Can anyone suggest any solution. I am trying to build S function to perform SIL on my model. but I am getting an error for the function "Runnable_Step" which I am calling from "output" (Code description) section of S function. The error is as below :
C:Users105316~1AppDataLocalTempmex_75352478274417_9204S_Function_EVDC_wrapper.obj: In function `S_Function_EVDC_Outputs_wrapper’: C:/Users/105316885/Documents/MATLAB/14JUN_SIL/S_Function_EVDC_wrapper.c:64: undefined reference to `Runnable_Step’ collect2.exe: error: ld returned 1 exit status
Can anyone suggest any solution. collect2.exe: error: ld returned 1 exit status MATLAB Answers — New Questions
Tracking motion of particles: using edge detection and blob analysis?
Hi,
I would like to track particles in a stack of 500 images (451 x 191 x 500).
The raw images look like this:
I would like to detect, select a few different ROIs (for example, one of the very bright particles, and some of the darker ‘dots’ in this picture) and track their motion through the 500 frames.
I have tried using the canny edge detector, followed by a blob analysis to track it. Not too sure if this is the best way to go.
So far, I have this script:
data = load(data);
for i = 1:size(data, 3)
BWStack(:, :, i) = edge(data(:, :, i), ‘Canny’);
end
% Select ROI interactively
figure;
imshow(BWStack(:, :, 1));
h = drawpolygon();
roiMask = createMask(h);
% Crop the ROI from each frame
ROIStack = false(size(BWStack));
for i = 1:size(BWStack, 3)
ROIStack(:, :, i) = BWStack(:, :, i) & roiMask;
end
% Convert the ROIStack to uint8
ROIStack_uint8 = uint8(ROIStack) * 255;
% Motion tracking using foreground detection
foregroundDetector = vision.ForegroundDetector(‘NumGaussians’, 5, ‘NumTrainingFrames’, 150);
% Initialize video player
videoPlayer = vision.VideoPlayer(‘Position’, [100, 100, 500, 400]);
% Initialize a blob analysis system object
blobAnalysis = vision.BlobAnalysis(‘BoundingBoxOutputPort’, true, …
‘AreaOutputPort’, true, …
‘CentroidOutputPort’, true, …
‘MinimumBlobArea’, 1);
pauseDuration = 0.01; % Adjust this value to control playback speed
% Initialize
pointTracker = vision.PointTracker(‘MaxBidirectionalError’, 2);
trajectories = cell(size(ROIStack_uint8, 3), 1);
trackerInitialized = false;
outputTrajectories = {};
for i = 1:size(ROIStack_uint8, 3)
% Detect foreground
foreground = foregroundDetector(ROIStack_uint8(:, :, i));
% Perform blob analysis to find connected components
[objArea, centroids, bbox] = step(blobAnalysis, foreground);
% Ensure centroids have two columns
if ~isempty(centroids) && size(centroids, 2) >= 2
if ~trackerInitialized
% Convert centroids to double
centroids = double(centroids);
% Initialize the point tracker with the centroids in the first frame
initialize(pointTracker, centroids, ROIStack_uint8(:, :, i));
trackerInitialized = true;
else
% Track the points
[points, validity] = step(pointTracker, ROIStack_uint8(:, :, i));
% Store valid points
trajectories{i} = points(validity, :);
% Append valid points to output trajectories
if ~isempty(points(validity, :))
outputTrajectories = [outputTrajectories; num2cell([repmat(i, sum(validity), 1), points(validity, :)])];
end
% Draw the points on the frame if there are valid points
if ~isempty(points(validity, :))
out = insertMarker(ROIStack_uint8(:, :, i), points(validity, :), ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
else
% If no centroids are found, use the previous frame’s points
if i > 1 && ~isempty(trajectories{i-1})
points = trajectories{i-1};
trajectories{i} = points;
% Append previous points to output trajectories
outputTrajectories = [outputTrajectories; num2cell([repmat(i, size(points, 1), 1), points])];
out = insertMarker(ROIStack_uint8(:, :, i), points, ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
% Draw a box around the detected objects
Ishape = insertShape(out, ‘Rectangle’, bbox);
% Display the frame
step(videoPlayer, Ishape);
% Pause to control playback speed
pause(pauseDuration);
end
release(videoPlayer);
release(pointTracker);
% Display the trajectories
figure;
hold on;
for i = 2:size(trajectories, 1)
if ~isempty(trajectories{i})
plot(trajectories{i}(:, 1), trajectories{i}(:, 2), ‘r.-‘);
end
end
title(‘Particle Trajectories’);
xlabel(‘X Position’);
ylabel(‘Y Position’);
hold off;
% Write trajectories to CSV
cell2csv(‘trajectories.csv’, outputTrajectories, {‘Frame’, ‘X’, ‘Y’});
% Function to write cell array to CSV
function cell2csv(fileName, cellArray, headers)
fid = fopen(fileName, ‘w’);
if ~isempty(headers)
fprintf(fid, ‘%s,’, headers{1:end-1});
fprintf(fid, ‘%sn’, headers{end});
end
for row = 1:size(cellArray, 1)
fprintf(fid, ‘%d,%f,%fn’, cellArray{row,:});
end
fclose(fid);
end
It seems to track many different points on the ROI but not continuously.
Example dataset ‘data.mat’ available here.
Any help and advice much appreciated!Hi,
I would like to track particles in a stack of 500 images (451 x 191 x 500).
The raw images look like this:
I would like to detect, select a few different ROIs (for example, one of the very bright particles, and some of the darker ‘dots’ in this picture) and track their motion through the 500 frames.
I have tried using the canny edge detector, followed by a blob analysis to track it. Not too sure if this is the best way to go.
So far, I have this script:
data = load(data);
for i = 1:size(data, 3)
BWStack(:, :, i) = edge(data(:, :, i), ‘Canny’);
end
% Select ROI interactively
figure;
imshow(BWStack(:, :, 1));
h = drawpolygon();
roiMask = createMask(h);
% Crop the ROI from each frame
ROIStack = false(size(BWStack));
for i = 1:size(BWStack, 3)
ROIStack(:, :, i) = BWStack(:, :, i) & roiMask;
end
% Convert the ROIStack to uint8
ROIStack_uint8 = uint8(ROIStack) * 255;
% Motion tracking using foreground detection
foregroundDetector = vision.ForegroundDetector(‘NumGaussians’, 5, ‘NumTrainingFrames’, 150);
% Initialize video player
videoPlayer = vision.VideoPlayer(‘Position’, [100, 100, 500, 400]);
% Initialize a blob analysis system object
blobAnalysis = vision.BlobAnalysis(‘BoundingBoxOutputPort’, true, …
‘AreaOutputPort’, true, …
‘CentroidOutputPort’, true, …
‘MinimumBlobArea’, 1);
pauseDuration = 0.01; % Adjust this value to control playback speed
% Initialize
pointTracker = vision.PointTracker(‘MaxBidirectionalError’, 2);
trajectories = cell(size(ROIStack_uint8, 3), 1);
trackerInitialized = false;
outputTrajectories = {};
for i = 1:size(ROIStack_uint8, 3)
% Detect foreground
foreground = foregroundDetector(ROIStack_uint8(:, :, i));
% Perform blob analysis to find connected components
[objArea, centroids, bbox] = step(blobAnalysis, foreground);
% Ensure centroids have two columns
if ~isempty(centroids) && size(centroids, 2) >= 2
if ~trackerInitialized
% Convert centroids to double
centroids = double(centroids);
% Initialize the point tracker with the centroids in the first frame
initialize(pointTracker, centroids, ROIStack_uint8(:, :, i));
trackerInitialized = true;
else
% Track the points
[points, validity] = step(pointTracker, ROIStack_uint8(:, :, i));
% Store valid points
trajectories{i} = points(validity, :);
% Append valid points to output trajectories
if ~isempty(points(validity, :))
outputTrajectories = [outputTrajectories; num2cell([repmat(i, sum(validity), 1), points(validity, :)])];
end
% Draw the points on the frame if there are valid points
if ~isempty(points(validity, :))
out = insertMarker(ROIStack_uint8(:, :, i), points(validity, :), ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
else
% If no centroids are found, use the previous frame’s points
if i > 1 && ~isempty(trajectories{i-1})
points = trajectories{i-1};
trajectories{i} = points;
% Append previous points to output trajectories
outputTrajectories = [outputTrajectories; num2cell([repmat(i, size(points, 1), 1), points])];
out = insertMarker(ROIStack_uint8(:, :, i), points, ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
% Draw a box around the detected objects
Ishape = insertShape(out, ‘Rectangle’, bbox);
% Display the frame
step(videoPlayer, Ishape);
% Pause to control playback speed
pause(pauseDuration);
end
release(videoPlayer);
release(pointTracker);
% Display the trajectories
figure;
hold on;
for i = 2:size(trajectories, 1)
if ~isempty(trajectories{i})
plot(trajectories{i}(:, 1), trajectories{i}(:, 2), ‘r.-‘);
end
end
title(‘Particle Trajectories’);
xlabel(‘X Position’);
ylabel(‘Y Position’);
hold off;
% Write trajectories to CSV
cell2csv(‘trajectories.csv’, outputTrajectories, {‘Frame’, ‘X’, ‘Y’});
% Function to write cell array to CSV
function cell2csv(fileName, cellArray, headers)
fid = fopen(fileName, ‘w’);
if ~isempty(headers)
fprintf(fid, ‘%s,’, headers{1:end-1});
fprintf(fid, ‘%sn’, headers{end});
end
for row = 1:size(cellArray, 1)
fprintf(fid, ‘%d,%f,%fn’, cellArray{row,:});
end
fclose(fid);
end
It seems to track many different points on the ROI but not continuously.
Example dataset ‘data.mat’ available here.
Any help and advice much appreciated! Hi,
I would like to track particles in a stack of 500 images (451 x 191 x 500).
The raw images look like this:
I would like to detect, select a few different ROIs (for example, one of the very bright particles, and some of the darker ‘dots’ in this picture) and track their motion through the 500 frames.
I have tried using the canny edge detector, followed by a blob analysis to track it. Not too sure if this is the best way to go.
So far, I have this script:
data = load(data);
for i = 1:size(data, 3)
BWStack(:, :, i) = edge(data(:, :, i), ‘Canny’);
end
% Select ROI interactively
figure;
imshow(BWStack(:, :, 1));
h = drawpolygon();
roiMask = createMask(h);
% Crop the ROI from each frame
ROIStack = false(size(BWStack));
for i = 1:size(BWStack, 3)
ROIStack(:, :, i) = BWStack(:, :, i) & roiMask;
end
% Convert the ROIStack to uint8
ROIStack_uint8 = uint8(ROIStack) * 255;
% Motion tracking using foreground detection
foregroundDetector = vision.ForegroundDetector(‘NumGaussians’, 5, ‘NumTrainingFrames’, 150);
% Initialize video player
videoPlayer = vision.VideoPlayer(‘Position’, [100, 100, 500, 400]);
% Initialize a blob analysis system object
blobAnalysis = vision.BlobAnalysis(‘BoundingBoxOutputPort’, true, …
‘AreaOutputPort’, true, …
‘CentroidOutputPort’, true, …
‘MinimumBlobArea’, 1);
pauseDuration = 0.01; % Adjust this value to control playback speed
% Initialize
pointTracker = vision.PointTracker(‘MaxBidirectionalError’, 2);
trajectories = cell(size(ROIStack_uint8, 3), 1);
trackerInitialized = false;
outputTrajectories = {};
for i = 1:size(ROIStack_uint8, 3)
% Detect foreground
foreground = foregroundDetector(ROIStack_uint8(:, :, i));
% Perform blob analysis to find connected components
[objArea, centroids, bbox] = step(blobAnalysis, foreground);
% Ensure centroids have two columns
if ~isempty(centroids) && size(centroids, 2) >= 2
if ~trackerInitialized
% Convert centroids to double
centroids = double(centroids);
% Initialize the point tracker with the centroids in the first frame
initialize(pointTracker, centroids, ROIStack_uint8(:, :, i));
trackerInitialized = true;
else
% Track the points
[points, validity] = step(pointTracker, ROIStack_uint8(:, :, i));
% Store valid points
trajectories{i} = points(validity, :);
% Append valid points to output trajectories
if ~isempty(points(validity, :))
outputTrajectories = [outputTrajectories; num2cell([repmat(i, sum(validity), 1), points(validity, :)])];
end
% Draw the points on the frame if there are valid points
if ~isempty(points(validity, :))
out = insertMarker(ROIStack_uint8(:, :, i), points(validity, :), ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
else
% If no centroids are found, use the previous frame’s points
if i > 1 && ~isempty(trajectories{i-1})
points = trajectories{i-1};
trajectories{i} = points;
% Append previous points to output trajectories
outputTrajectories = [outputTrajectories; num2cell([repmat(i, size(points, 1), 1), points])];
out = insertMarker(ROIStack_uint8(:, :, i), points, ‘+’, ‘Color’, ‘red’);
else
out = ROIStack_uint8(:, :, i);
end
end
% Draw a box around the detected objects
Ishape = insertShape(out, ‘Rectangle’, bbox);
% Display the frame
step(videoPlayer, Ishape);
% Pause to control playback speed
pause(pauseDuration);
end
release(videoPlayer);
release(pointTracker);
% Display the trajectories
figure;
hold on;
for i = 2:size(trajectories, 1)
if ~isempty(trajectories{i})
plot(trajectories{i}(:, 1), trajectories{i}(:, 2), ‘r.-‘);
end
end
title(‘Particle Trajectories’);
xlabel(‘X Position’);
ylabel(‘Y Position’);
hold off;
% Write trajectories to CSV
cell2csv(‘trajectories.csv’, outputTrajectories, {‘Frame’, ‘X’, ‘Y’});
% Function to write cell array to CSV
function cell2csv(fileName, cellArray, headers)
fid = fopen(fileName, ‘w’);
if ~isempty(headers)
fprintf(fid, ‘%s,’, headers{1:end-1});
fprintf(fid, ‘%sn’, headers{end});
end
for row = 1:size(cellArray, 1)
fprintf(fid, ‘%d,%f,%fn’, cellArray{row,:});
end
fclose(fid);
end
It seems to track many different points on the ROI but not continuously.
Example dataset ‘data.mat’ available here.
Any help and advice much appreciated! computer vision, image processing, edge detection, motion tracking MATLAB Answers — New Questions
external trigger to initiate script commands
I’m wanted to use an external device to trigger my script. I have limited experience with Simulink so I’m not sure if that is the right system to use. Ideal, once something sets off the trigger, I want it to run my code.I’m wanted to use an external device to trigger my script. I have limited experience with Simulink so I’m not sure if that is the right system to use. Ideal, once something sets off the trigger, I want it to run my code. I’m wanted to use an external device to trigger my script. I have limited experience with Simulink so I’m not sure if that is the right system to use. Ideal, once something sets off the trigger, I want it to run my code. simulink, external, trigger, input, output MATLAB Answers — New Questions
Why do I see “The RPC server is unavailable” when calling Hysys solver from MATLAB?
Hi! I am trying to automate my hysys model on MATLAB, and successfully linked via actxserver. Added my code below. Currently, I keep getting the error that
Warning: Error during simulation run: Invalid input for argument 2 (rhs2):
Value must be numeric or logical
I tried to see what the problem was and used the code:
>> properties(MySimCase.Solver)
but I received back the error below:
Error: The RPC server is unavailable.
When I code properties(MySimCase), it is able to list for me all the properties, only for solver it isnt.
Please help!
Below is the full code:
>> % Connect to HYSYS Application
try
MyObject = actxserver(‘Hysys.Application’);
catch ME
error(‘Error connecting to HYSYS: %s’, ME.message);
end
FileNamePath = ‘Test’; % Adjust the filename as needed
try
MySimCase = MyObject.SimulationCases.Open([cd, strcat(”, FileNamePath, ‘.hsc’)]);
catch ME
error(‘Error opening simulation case: %s’, ME.message);
end
MySimCase.Visible = true;
% Verify the list of unit operations
try
unitOperations = MySimCase.Flowsheet.Operations;
numUnitOperations = unitOperations.Count;
unitOperationNames = cell(numUnitOperations, 1);
for idx = 1:numUnitOperations
unitOperationNames{idx} = unitOperations.Item(idx – 1).Name; % Adjusting index for MATLAB (1-based)
end
disp(‘Available unit operations in the flowsheet:’);
disp(unitOperationNames);
catch ME
error(‘Error accessing unit operations: %s’, ME.message);
end
% Access the LIC control under unit operations
try
LICSP = unitOperations.Item(‘LIC’);
catch ME
error(‘Error accessing LIC control: %s’, ME.message);
end
if isempty(LICSP)
error(‘The ”LIC” control was not found in the flowsheet.’);
end
% Display the properties of LICSP for debugging
disp(‘Properties of LICSP:’);
disp(get(LICSP));
% Set the range for the filling level in LIC (SP)
startLevel = 0.5;
endLevel = 0.9;
stepSize = 0.1;
% Initialize variables for storing the results
seagoingBOG = [];
cjkBOG = [];
portBOG = [];
boilerBOG = [];
% Loop through the filling levels
fillingLevel = startLevel:stepSize:endLevel;
for i = 1:numel(fillingLevel)
% Set the filling level value
try
LICSP.SPValue = fillingLevel(i); % Set the setpoint value
catch ME
warning(‘Error setting LIC control set point: %s’, ME.message);
continue;
end
% Run the simulation case
try
MySimCase.Solver.Integrator.RunUntil(MySimCase.Solver.Integrator.CurrentTime)
catch ME
warning(‘Error during simulation run: %s’, ME.message);
continue;
end
% Obtain Seagoing BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
seagoingBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG2 stream for Seagoing BOG: %s’, ME.message);
seagoingBOG(i) = NaN;
end
% Obtain CJK BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
cjkBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760 * 0.5; % Example: Assuming CJK BOG is 50% of BOG2
catch ME
warning(‘Error accessing BOG2 stream for CJK BOG: %s’, ME.message);
cjkBOG(i) = NaN;
end
% Obtain Port BOG
try
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
portBOG(i) = bog3Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG3 stream for Port BOG: %s’, ME.message);
portBOG(i) = NaN;
end
% Obtain Boiler BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
boilerBOG(i) = (bog2Stream.MolarFlow.GetValue(‘kgmole/h’) + bog3Stream.MolarFlow.GetValue(‘kgmole/h’)) * 8760 – cjkBOG(i);
catch ME
warning(‘Error accessing BOG streams for Boiler BOG: %s’, ME.message);
boilerBOG(i) = NaN;
end
end
% Close the HYSYS application
MyObject.Quit();Hi! I am trying to automate my hysys model on MATLAB, and successfully linked via actxserver. Added my code below. Currently, I keep getting the error that
Warning: Error during simulation run: Invalid input for argument 2 (rhs2):
Value must be numeric or logical
I tried to see what the problem was and used the code:
>> properties(MySimCase.Solver)
but I received back the error below:
Error: The RPC server is unavailable.
When I code properties(MySimCase), it is able to list for me all the properties, only for solver it isnt.
Please help!
Below is the full code:
>> % Connect to HYSYS Application
try
MyObject = actxserver(‘Hysys.Application’);
catch ME
error(‘Error connecting to HYSYS: %s’, ME.message);
end
FileNamePath = ‘Test’; % Adjust the filename as needed
try
MySimCase = MyObject.SimulationCases.Open([cd, strcat(”, FileNamePath, ‘.hsc’)]);
catch ME
error(‘Error opening simulation case: %s’, ME.message);
end
MySimCase.Visible = true;
% Verify the list of unit operations
try
unitOperations = MySimCase.Flowsheet.Operations;
numUnitOperations = unitOperations.Count;
unitOperationNames = cell(numUnitOperations, 1);
for idx = 1:numUnitOperations
unitOperationNames{idx} = unitOperations.Item(idx – 1).Name; % Adjusting index for MATLAB (1-based)
end
disp(‘Available unit operations in the flowsheet:’);
disp(unitOperationNames);
catch ME
error(‘Error accessing unit operations: %s’, ME.message);
end
% Access the LIC control under unit operations
try
LICSP = unitOperations.Item(‘LIC’);
catch ME
error(‘Error accessing LIC control: %s’, ME.message);
end
if isempty(LICSP)
error(‘The ”LIC” control was not found in the flowsheet.’);
end
% Display the properties of LICSP for debugging
disp(‘Properties of LICSP:’);
disp(get(LICSP));
% Set the range for the filling level in LIC (SP)
startLevel = 0.5;
endLevel = 0.9;
stepSize = 0.1;
% Initialize variables for storing the results
seagoingBOG = [];
cjkBOG = [];
portBOG = [];
boilerBOG = [];
% Loop through the filling levels
fillingLevel = startLevel:stepSize:endLevel;
for i = 1:numel(fillingLevel)
% Set the filling level value
try
LICSP.SPValue = fillingLevel(i); % Set the setpoint value
catch ME
warning(‘Error setting LIC control set point: %s’, ME.message);
continue;
end
% Run the simulation case
try
MySimCase.Solver.Integrator.RunUntil(MySimCase.Solver.Integrator.CurrentTime)
catch ME
warning(‘Error during simulation run: %s’, ME.message);
continue;
end
% Obtain Seagoing BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
seagoingBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG2 stream for Seagoing BOG: %s’, ME.message);
seagoingBOG(i) = NaN;
end
% Obtain CJK BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
cjkBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760 * 0.5; % Example: Assuming CJK BOG is 50% of BOG2
catch ME
warning(‘Error accessing BOG2 stream for CJK BOG: %s’, ME.message);
cjkBOG(i) = NaN;
end
% Obtain Port BOG
try
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
portBOG(i) = bog3Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG3 stream for Port BOG: %s’, ME.message);
portBOG(i) = NaN;
end
% Obtain Boiler BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
boilerBOG(i) = (bog2Stream.MolarFlow.GetValue(‘kgmole/h’) + bog3Stream.MolarFlow.GetValue(‘kgmole/h’)) * 8760 – cjkBOG(i);
catch ME
warning(‘Error accessing BOG streams for Boiler BOG: %s’, ME.message);
boilerBOG(i) = NaN;
end
end
% Close the HYSYS application
MyObject.Quit(); Hi! I am trying to automate my hysys model on MATLAB, and successfully linked via actxserver. Added my code below. Currently, I keep getting the error that
Warning: Error during simulation run: Invalid input for argument 2 (rhs2):
Value must be numeric or logical
I tried to see what the problem was and used the code:
>> properties(MySimCase.Solver)
but I received back the error below:
Error: The RPC server is unavailable.
When I code properties(MySimCase), it is able to list for me all the properties, only for solver it isnt.
Please help!
Below is the full code:
>> % Connect to HYSYS Application
try
MyObject = actxserver(‘Hysys.Application’);
catch ME
error(‘Error connecting to HYSYS: %s’, ME.message);
end
FileNamePath = ‘Test’; % Adjust the filename as needed
try
MySimCase = MyObject.SimulationCases.Open([cd, strcat(”, FileNamePath, ‘.hsc’)]);
catch ME
error(‘Error opening simulation case: %s’, ME.message);
end
MySimCase.Visible = true;
% Verify the list of unit operations
try
unitOperations = MySimCase.Flowsheet.Operations;
numUnitOperations = unitOperations.Count;
unitOperationNames = cell(numUnitOperations, 1);
for idx = 1:numUnitOperations
unitOperationNames{idx} = unitOperations.Item(idx – 1).Name; % Adjusting index for MATLAB (1-based)
end
disp(‘Available unit operations in the flowsheet:’);
disp(unitOperationNames);
catch ME
error(‘Error accessing unit operations: %s’, ME.message);
end
% Access the LIC control under unit operations
try
LICSP = unitOperations.Item(‘LIC’);
catch ME
error(‘Error accessing LIC control: %s’, ME.message);
end
if isempty(LICSP)
error(‘The ”LIC” control was not found in the flowsheet.’);
end
% Display the properties of LICSP for debugging
disp(‘Properties of LICSP:’);
disp(get(LICSP));
% Set the range for the filling level in LIC (SP)
startLevel = 0.5;
endLevel = 0.9;
stepSize = 0.1;
% Initialize variables for storing the results
seagoingBOG = [];
cjkBOG = [];
portBOG = [];
boilerBOG = [];
% Loop through the filling levels
fillingLevel = startLevel:stepSize:endLevel;
for i = 1:numel(fillingLevel)
% Set the filling level value
try
LICSP.SPValue = fillingLevel(i); % Set the setpoint value
catch ME
warning(‘Error setting LIC control set point: %s’, ME.message);
continue;
end
% Run the simulation case
try
MySimCase.Solver.Integrator.RunUntil(MySimCase.Solver.Integrator.CurrentTime)
catch ME
warning(‘Error during simulation run: %s’, ME.message);
continue;
end
% Obtain Seagoing BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
seagoingBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG2 stream for Seagoing BOG: %s’, ME.message);
seagoingBOG(i) = NaN;
end
% Obtain CJK BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
cjkBOG(i) = bog2Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760 * 0.5; % Example: Assuming CJK BOG is 50% of BOG2
catch ME
warning(‘Error accessing BOG2 stream for CJK BOG: %s’, ME.message);
cjkBOG(i) = NaN;
end
% Obtain Port BOG
try
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
portBOG(i) = bog3Stream.MolarFlow.GetValue(‘kgmole/h’) * 8760; % Assuming 8760 hours in a year
catch ME
warning(‘Error accessing BOG3 stream for Port BOG: %s’, ME.message);
portBOG(i) = NaN;
end
% Obtain Boiler BOG
try
bog2Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG2’);
bog3Stream = MySimCase.Flowsheet.MaterialStreams.Item(‘BOG3’);
boilerBOG(i) = (bog2Stream.MolarFlow.GetValue(‘kgmole/h’) + bog3Stream.MolarFlow.GetValue(‘kgmole/h’)) * 8760 – cjkBOG(i);
catch ME
warning(‘Error accessing BOG streams for Boiler BOG: %s’, ME.message);
boilerBOG(i) = NaN;
end
end
% Close the HYSYS application
MyObject.Quit(); matlab, hysys MATLAB Answers — New Questions
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
This code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problemThis code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problem This code is meant to read off a data stream from a creep frame and continuously save it until told to stop by attached ui. The problem is I had to move it to a new computer and reinstall everything necessary. Now I am getting a error from line 30 which states startBackground(s);
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
here is the input code i used. a separate Ui is created where the controlling properties like time interval, radius, initial length, triaxality and displacement increment are told. along with a folder designated, and name of output file. What should happen is that once i press run, the program should start recording the data after file directory is selected. Instead as soon as file directory is selected I get the error.
here is the code
clc;clear;
% c is a struct
c.Date = clock;
c.Rate = 10;
%% Reading/Setting DAQ
s = daq.createSession(‘dt’);
s.addAnalogInputChannel(‘DT9804(00)’,’0′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’1′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’2′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’3′,’Voltage’);
s.addAnalogInputChannel(‘DT9804(00)’,’4′,’Voltage’);
s.Rate = c.Rate; % Background acuisition rate
%%
% Display graphical user interface
hGui = createDataCaptureUI(s);
% Add a listener for DataAvailable events and specify the callback function
dataListener = addlistener(s, ‘DataAvailable’, @(src,event) dataCapture(src, event, c, hGui));
% Start continuous background data acquisition
s.IsContinuous = true;
startBackground(s);
% Wait until session s is stopped from the UI
while s.IsRunning
pause(0.5);
end
delete(dataListener);
delete(s);
I looked up solutions to the error online. but they do not seem to apply.
the gui file doesn’t seem to be the source of the problem property assignment, create array element, oop MATLAB Answers — New Questions
Strange issue with mean, max, and min of vector?
Hello,
I am having an issue with finding the mean max and min of a vector (attached). All values in the vector are positive (increments of time) and less than 1. However, when I test the mean() = -8.0219, max = 9.5770, min = -4.3200e+04. When I try to find() the indices of the min and max, it says that it is 1 but, the value at index 1 is 0.012.
When you test the vector, do you get the same result? Why is it outputting these incorrect values?Hello,
I am having an issue with finding the mean max and min of a vector (attached). All values in the vector are positive (increments of time) and less than 1. However, when I test the mean() = -8.0219, max = 9.5770, min = -4.3200e+04. When I try to find() the indices of the min and max, it says that it is 1 but, the value at index 1 is 0.012.
When you test the vector, do you get the same result? Why is it outputting these incorrect values? Hello,
I am having an issue with finding the mean max and min of a vector (attached). All values in the vector are positive (increments of time) and less than 1. However, when I test the mean() = -8.0219, max = 9.5770, min = -4.3200e+04. When I try to find() the indices of the min and max, it says that it is 1 but, the value at index 1 is 0.012.
When you test the vector, do you get the same result? Why is it outputting these incorrect values? mean, max, min MATLAB Answers — New Questions
Don’t know what is wrong with my output of this code
function [MOVINGREG] = registerMarsImages(MOVING,FIXED)
% Convert images to grayscale if they are RGB
if size(MOVING, 3) == 3
MOVING = rgb2gray(MOVING);
end
if size(FIXED, 3) == 3
FIXED = rgb2gray(FIXED);
end
% Detect features in both images
points1 = detectSURFFeatures(MOVING, ‘MetricThreshold’, 1000);
points2 = detectSURFFeatures(FIXED, ‘MetricThreshold’, 1000);
% Extract features from both images
[features1, valid_points1] = extractFeatures(MOVING, points1);
[features2, valid_points2] = extractFeatures(FIXED, points2);
% Match features by using their descriptors
indexPairs = matchFeatures(features1, features2, ‘MatchThreshold’, 10, ‘MaxRatio’, 0.7);
% Retrieve locations of corresponding points for each image
matchedPoints1 = valid_points1(indexPairs(:, 1), :);
matchedPoints2 = valid_points2(indexPairs(:, 2), :);
% Estimate the transformation between the moving and fixed images
[tform, inlierIdx] = estimateGeometricTransform2D(matchedPoints1, matchedPoints2, ‘projective’, ‘Confidence’, 99.9, ‘MaxNumTrials’, 2000);
% Get the output limits for the transformation
[xLimitsMoving, yLimitsMoving] = outputLimits(tform, [1 size(MOVING, 2)], [1 size(MOVING, 1)]);
[xLimitsFixed, yLimitsFixed] = outputLimits(projective2d(eye(3)), [1 size(FIXED, 2)], [1 size(FIXED, 1)]);
% Determine the size of the panorama
xMin = min([xLimitsMoving xLimitsFixed]);
xMax = max([xLimitsMoving xLimitsFixed]);
yMin = min([yLimitsMoving yLimitsFixed]);
yMax = max([yLimitsMoving yLimitsFixed]);
width = round(xMax – xMin);
height = round(yMax – yMin);
% Create an empty panorama canvas
panorama = zeros(height, width, ‘like’, FIXED);
% Create reference objects for the panorama and the fixed image
panoramaView = imref2d([height width], [xMin xMax], [yMin yMax]);
fixedRef = imref2d(size(FIXED), [xLimitsFixed(1) xLimitsFixed(2)], [yLimitsFixed(1) yLimitsFixed(2)]);
% Warp the moving image into the panorama
registered = imwarp(MOVING, tform, ‘OutputView’, panoramaView);
% Overlay the fixed image onto the panorama
panorama = imwarp(FIXED, projective2d(eye(3)), ‘OutputView’, panoramaView, ‘FillValues’, 0);
panorama = max(panorama, registered);
% Resize the panorama to fit within 1024×1024
scaleFactor = min(1024 / width, 1024 / height);
panoramaScaled = imresize(panorama, scaleFactor);
% Create a 1024×1024 canvas
finalPanorama = zeros(1024, 1024, ‘like’, FIXED);
% Determine the position to center the scaled stitched image within the canvas
[scaledHeight, scaledWidth] = size(panoramaScaled);
xOffset = max(0, round((1024 – scaledWidth) / 2));
yOffset = max(0, round((1024 – scaledHeight) / 2));
% Place the scaled stitched image onto the 1024×1024 canvas
finalPanorama(yOffset + (1:scaledHeight), xOffset + (1:scaledWidth)) = panoramaScaled;
% Store the registered image
MOVINGREG.RegisteredImage = finalPanorama;
% Store the transformation object
MOVINGREG.Transformation = tform;
end
% Load the images
fixedImg = imread("sol_03333_opgs_edr_ncam_NLB_693387385EDR_F0921230NCAM00259M_.JPG");
leftImg = imread("sol_03333_opgs_edr_ncam_NLB_693387301EDR_F0921230NCAM00259M_.JPG");
% Register the two images
reg = registerMarsImages(leftImg, fixedImg)
figure; imshow(reg.RegisteredImage)function [MOVINGREG] = registerMarsImages(MOVING,FIXED)
% Convert images to grayscale if they are RGB
if size(MOVING, 3) == 3
MOVING = rgb2gray(MOVING);
end
if size(FIXED, 3) == 3
FIXED = rgb2gray(FIXED);
end
% Detect features in both images
points1 = detectSURFFeatures(MOVING, ‘MetricThreshold’, 1000);
points2 = detectSURFFeatures(FIXED, ‘MetricThreshold’, 1000);
% Extract features from both images
[features1, valid_points1] = extractFeatures(MOVING, points1);
[features2, valid_points2] = extractFeatures(FIXED, points2);
% Match features by using their descriptors
indexPairs = matchFeatures(features1, features2, ‘MatchThreshold’, 10, ‘MaxRatio’, 0.7);
% Retrieve locations of corresponding points for each image
matchedPoints1 = valid_points1(indexPairs(:, 1), :);
matchedPoints2 = valid_points2(indexPairs(:, 2), :);
% Estimate the transformation between the moving and fixed images
[tform, inlierIdx] = estimateGeometricTransform2D(matchedPoints1, matchedPoints2, ‘projective’, ‘Confidence’, 99.9, ‘MaxNumTrials’, 2000);
% Get the output limits for the transformation
[xLimitsMoving, yLimitsMoving] = outputLimits(tform, [1 size(MOVING, 2)], [1 size(MOVING, 1)]);
[xLimitsFixed, yLimitsFixed] = outputLimits(projective2d(eye(3)), [1 size(FIXED, 2)], [1 size(FIXED, 1)]);
% Determine the size of the panorama
xMin = min([xLimitsMoving xLimitsFixed]);
xMax = max([xLimitsMoving xLimitsFixed]);
yMin = min([yLimitsMoving yLimitsFixed]);
yMax = max([yLimitsMoving yLimitsFixed]);
width = round(xMax – xMin);
height = round(yMax – yMin);
% Create an empty panorama canvas
panorama = zeros(height, width, ‘like’, FIXED);
% Create reference objects for the panorama and the fixed image
panoramaView = imref2d([height width], [xMin xMax], [yMin yMax]);
fixedRef = imref2d(size(FIXED), [xLimitsFixed(1) xLimitsFixed(2)], [yLimitsFixed(1) yLimitsFixed(2)]);
% Warp the moving image into the panorama
registered = imwarp(MOVING, tform, ‘OutputView’, panoramaView);
% Overlay the fixed image onto the panorama
panorama = imwarp(FIXED, projective2d(eye(3)), ‘OutputView’, panoramaView, ‘FillValues’, 0);
panorama = max(panorama, registered);
% Resize the panorama to fit within 1024×1024
scaleFactor = min(1024 / width, 1024 / height);
panoramaScaled = imresize(panorama, scaleFactor);
% Create a 1024×1024 canvas
finalPanorama = zeros(1024, 1024, ‘like’, FIXED);
% Determine the position to center the scaled stitched image within the canvas
[scaledHeight, scaledWidth] = size(panoramaScaled);
xOffset = max(0, round((1024 – scaledWidth) / 2));
yOffset = max(0, round((1024 – scaledHeight) / 2));
% Place the scaled stitched image onto the 1024×1024 canvas
finalPanorama(yOffset + (1:scaledHeight), xOffset + (1:scaledWidth)) = panoramaScaled;
% Store the registered image
MOVINGREG.RegisteredImage = finalPanorama;
% Store the transformation object
MOVINGREG.Transformation = tform;
end
% Load the images
fixedImg = imread("sol_03333_opgs_edr_ncam_NLB_693387385EDR_F0921230NCAM00259M_.JPG");
leftImg = imread("sol_03333_opgs_edr_ncam_NLB_693387301EDR_F0921230NCAM00259M_.JPG");
% Register the two images
reg = registerMarsImages(leftImg, fixedImg)
figure; imshow(reg.RegisteredImage) function [MOVINGREG] = registerMarsImages(MOVING,FIXED)
% Convert images to grayscale if they are RGB
if size(MOVING, 3) == 3
MOVING = rgb2gray(MOVING);
end
if size(FIXED, 3) == 3
FIXED = rgb2gray(FIXED);
end
% Detect features in both images
points1 = detectSURFFeatures(MOVING, ‘MetricThreshold’, 1000);
points2 = detectSURFFeatures(FIXED, ‘MetricThreshold’, 1000);
% Extract features from both images
[features1, valid_points1] = extractFeatures(MOVING, points1);
[features2, valid_points2] = extractFeatures(FIXED, points2);
% Match features by using their descriptors
indexPairs = matchFeatures(features1, features2, ‘MatchThreshold’, 10, ‘MaxRatio’, 0.7);
% Retrieve locations of corresponding points for each image
matchedPoints1 = valid_points1(indexPairs(:, 1), :);
matchedPoints2 = valid_points2(indexPairs(:, 2), :);
% Estimate the transformation between the moving and fixed images
[tform, inlierIdx] = estimateGeometricTransform2D(matchedPoints1, matchedPoints2, ‘projective’, ‘Confidence’, 99.9, ‘MaxNumTrials’, 2000);
% Get the output limits for the transformation
[xLimitsMoving, yLimitsMoving] = outputLimits(tform, [1 size(MOVING, 2)], [1 size(MOVING, 1)]);
[xLimitsFixed, yLimitsFixed] = outputLimits(projective2d(eye(3)), [1 size(FIXED, 2)], [1 size(FIXED, 1)]);
% Determine the size of the panorama
xMin = min([xLimitsMoving xLimitsFixed]);
xMax = max([xLimitsMoving xLimitsFixed]);
yMin = min([yLimitsMoving yLimitsFixed]);
yMax = max([yLimitsMoving yLimitsFixed]);
width = round(xMax – xMin);
height = round(yMax – yMin);
% Create an empty panorama canvas
panorama = zeros(height, width, ‘like’, FIXED);
% Create reference objects for the panorama and the fixed image
panoramaView = imref2d([height width], [xMin xMax], [yMin yMax]);
fixedRef = imref2d(size(FIXED), [xLimitsFixed(1) xLimitsFixed(2)], [yLimitsFixed(1) yLimitsFixed(2)]);
% Warp the moving image into the panorama
registered = imwarp(MOVING, tform, ‘OutputView’, panoramaView);
% Overlay the fixed image onto the panorama
panorama = imwarp(FIXED, projective2d(eye(3)), ‘OutputView’, panoramaView, ‘FillValues’, 0);
panorama = max(panorama, registered);
% Resize the panorama to fit within 1024×1024
scaleFactor = min(1024 / width, 1024 / height);
panoramaScaled = imresize(panorama, scaleFactor);
% Create a 1024×1024 canvas
finalPanorama = zeros(1024, 1024, ‘like’, FIXED);
% Determine the position to center the scaled stitched image within the canvas
[scaledHeight, scaledWidth] = size(panoramaScaled);
xOffset = max(0, round((1024 – scaledWidth) / 2));
yOffset = max(0, round((1024 – scaledHeight) / 2));
% Place the scaled stitched image onto the 1024×1024 canvas
finalPanorama(yOffset + (1:scaledHeight), xOffset + (1:scaledWidth)) = panoramaScaled;
% Store the registered image
MOVINGREG.RegisteredImage = finalPanorama;
% Store the transformation object
MOVINGREG.Transformation = tform;
end
% Load the images
fixedImg = imread("sol_03333_opgs_edr_ncam_NLB_693387385EDR_F0921230NCAM00259M_.JPG");
leftImg = imread("sol_03333_opgs_edr_ncam_NLB_693387301EDR_F0921230NCAM00259M_.JPG");
% Register the two images
reg = registerMarsImages(leftImg, fixedImg)
figure; imshow(reg.RegisteredImage) matlab code, matlab, output, image stitching, panorama MATLAB Answers — New Questions
I want show population on plot like 36M, 37M….
please help me, I=I need the grow population like 36m, 37, 38,.. on plotplease help me, I=I need the grow population like 36m, 37, 38,.. on plot please help me, I=I need the grow population like 36m, 37, 38,.. on plot matlab MATLAB Answers — New Questions
I need help combining two sine waves
Hello. I am trying to learn how to end an ascending sine wave at the start of a signal and end a descending sine wave at the end of a signal. Here is what I have so far:
f=1000;
n=10;
T=1/f;
t=(0:T/100:n*T);
s = sin(2*pi*t*f);
e = (-expm1(-t*250));
e2 = (exp(-t*250));
n = s .* e;
m = e2 .* s;
fix = n + s + m;
plot(t,fix);
I am still doing research on how to properly add them but any help from others would be appreciated.Hello. I am trying to learn how to end an ascending sine wave at the start of a signal and end a descending sine wave at the end of a signal. Here is what I have so far:
f=1000;
n=10;
T=1/f;
t=(0:T/100:n*T);
s = sin(2*pi*t*f);
e = (-expm1(-t*250));
e2 = (exp(-t*250));
n = s .* e;
m = e2 .* s;
fix = n + s + m;
plot(t,fix);
I am still doing research on how to properly add them but any help from others would be appreciated. Hello. I am trying to learn how to end an ascending sine wave at the start of a signal and end a descending sine wave at the end of a signal. Here is what I have so far:
f=1000;
n=10;
T=1/f;
t=(0:T/100:n*T);
s = sin(2*pi*t*f);
e = (-expm1(-t*250));
e2 = (exp(-t*250));
n = s .* e;
m = e2 .* s;
fix = n + s + m;
plot(t,fix);
I am still doing research on how to properly add them but any help from others would be appreciated. plotting MATLAB Answers — New Questions
Matching combinations of strings
I have a table TT with a string variable TT.name. I want to return true if TT.name matches any entry in another table variable OK.name. However, I have some complications I am having a hard time parsing.
Many of the strings in TT.name are combinations of strings that appear in OK.name. I want to include these as a true match. Sometimes they have a + symbol, sometimes just a space. Further complicating matters, the table OK contains some entries with spaces, and if they do I want to treat them as an entire entry, and not break them up at the spaces.
TT = table(["Green"; "Red"; "Blue"; "Black Blue"; "Black"; "Blue Green"; "Red + Blue"; "Red Orange"; "Red + White"], ‘VariableNames’, {‘name’})
OK = table(["Red"; "Green"; "Blue"; "Black Blue"], ‘VariableNames’, {‘name’})
This is the output I would want, but not by manually changing rows 6 and 7:
TT.match=ismember(TT.name,OK.name);
TT.match(6:7)=1
In the example, "Blue Green" and "Red + Blue" are true matchs, because "Blue" "Green" and "Red" all appear as entries in OK.name.
"Black" is not a match, because the only entry in OK.name is "Black Blue" and I do not want to separate the words from this table.
"Red Orange" and "Red + Orange" are not matches because only "Red" is in the OK table.I have a table TT with a string variable TT.name. I want to return true if TT.name matches any entry in another table variable OK.name. However, I have some complications I am having a hard time parsing.
Many of the strings in TT.name are combinations of strings that appear in OK.name. I want to include these as a true match. Sometimes they have a + symbol, sometimes just a space. Further complicating matters, the table OK contains some entries with spaces, and if they do I want to treat them as an entire entry, and not break them up at the spaces.
TT = table(["Green"; "Red"; "Blue"; "Black Blue"; "Black"; "Blue Green"; "Red + Blue"; "Red Orange"; "Red + White"], ‘VariableNames’, {‘name’})
OK = table(["Red"; "Green"; "Blue"; "Black Blue"], ‘VariableNames’, {‘name’})
This is the output I would want, but not by manually changing rows 6 and 7:
TT.match=ismember(TT.name,OK.name);
TT.match(6:7)=1
In the example, "Blue Green" and "Red + Blue" are true matchs, because "Blue" "Green" and "Red" all appear as entries in OK.name.
"Black" is not a match, because the only entry in OK.name is "Black Blue" and I do not want to separate the words from this table.
"Red Orange" and "Red + Orange" are not matches because only "Red" is in the OK table. I have a table TT with a string variable TT.name. I want to return true if TT.name matches any entry in another table variable OK.name. However, I have some complications I am having a hard time parsing.
Many of the strings in TT.name are combinations of strings that appear in OK.name. I want to include these as a true match. Sometimes they have a + symbol, sometimes just a space. Further complicating matters, the table OK contains some entries with spaces, and if they do I want to treat them as an entire entry, and not break them up at the spaces.
TT = table(["Green"; "Red"; "Blue"; "Black Blue"; "Black"; "Blue Green"; "Red + Blue"; "Red Orange"; "Red + White"], ‘VariableNames’, {‘name’})
OK = table(["Red"; "Green"; "Blue"; "Black Blue"], ‘VariableNames’, {‘name’})
This is the output I would want, but not by manually changing rows 6 and 7:
TT.match=ismember(TT.name,OK.name);
TT.match(6:7)=1
In the example, "Blue Green" and "Red + Blue" are true matchs, because "Blue" "Green" and "Red" all appear as entries in OK.name.
"Black" is not a match, because the only entry in OK.name is "Black Blue" and I do not want to separate the words from this table.
"Red Orange" and "Red + Orange" are not matches because only "Red" is in the OK table. strings, compare, ismember, matching MATLAB Answers — New Questions