Category: Matlab
Category Archives: Matlab
sim(simIn) gives error saying all the runs have an error
% set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end% set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end % set_param(‘fl_name/Speed_sweep’,’Value’,’Spd’)
Spd = 100;
%% Speed Array
Speed = zeros(1,5001);
len = numel(Speed);
q=0;
for s = 1:len
Speed(1,s) = q;
q = q + (1/(len-1));
end
Trq_inst = zeros(1,401);
len_trq = numel(Trq_inst);
Trq_ref =1;
clear simIn
clear simOutputs
for t = 1:(len_trq)
Trq_inst(1,t)= Trq_ref;
for i = 1:len
simIn(i) = Simulink.SimulationInput(‘fl_name’);
simIn(i) = setBlockParameter(simIn(i),’fl_name/Speed_Sweep’,’Spd’,Speed(i));
end
simOutputs = sim(simIn);
Trq_ref = Trq_ref – (1/(len_trq-1));
end sim() MATLAB Answers — New Questions
Having issues installing Imaging Processing Toolbox
I have a student license in which Imaging Prossessing Toolbox is included, but when I try to install the image processing toolbox, it never installs and the loading circle goes on for hours. I had it trying to install for 8 hours and nothing happened. How can I fix this?I have a student license in which Imaging Prossessing Toolbox is included, but when I try to install the image processing toolbox, it never installs and the loading circle goes on for hours. I had it trying to install for 8 hours and nothing happened. How can I fix this? I have a student license in which Imaging Prossessing Toolbox is included, but when I try to install the image processing toolbox, it never installs and the loading circle goes on for hours. I had it trying to install for 8 hours and nothing happened. How can I fix this? image processing, toolbox MATLAB Answers — New Questions
MATLAB ver R2020a Update 4 cashes. ERROR: Abnormal termination abort ()
Getting this error message:
Abnormal termination:
abort()
Register State (captured):
RAX = 00007fff846519a8 RBX = 00007fff846519a8
RCX = 00000053f3afbf10 RDX = 0000000000000000
RSP = 00000053f3afbe90 RBP = 000001ba152f3f70
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 0000000000000003 R9 = 00000053f3afbdf8
R10 = 0000000000000014 R11 = 00007fff84641947
R12 = 00000053f3afcb48 R13 = 0000000000000000
R14 = 00000053f3afc580 R15 = 00007fff846418e8
RIP = 00007fff843f476a EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00007fff843ec9c3 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00051651 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007fff843e98a8 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00039080 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007fff843f009b C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00065691 foundation::core::diag::symbols::getSymbolAddress+00012859
[ 3] 0x00007fff843f3391 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00078737 foundation::core::diag::is_terminate_message_enabled+00000577
[ 4] 0x00007fff8057a50f C:Program FilesMATLABR2020Abinwin64mcr.dll+01156367 mcr::shutdown::startWatchdog+00039423
[ 5] 0x00007fff80579e3c C:Program FilesMATLABR2020Abinwin64mcr.dll+01154620 mcr::shutdown::startWatchdog+00037676
[ 6] 0x00007fff80575473 C:Program FilesMATLABR2020Abinwin64mcr.dll+01135731 mcr::shutdown::startWatchdog+00018787
[ 7] 0x00007fff80577817 C:Program FilesMATLABR2020Abinwin64mcr.dll+01144855 mcr::shutdown::startWatchdog+00027911
[ 8] 0x00007ff807e51881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ff807e52851 C:WINDOWSSystem32ucrtbase.dll+00469073 abort+00000049
[ 10] 0x00007ff807e51f9f C:WINDOWSSystem32ucrtbase.dll+00466847 terminate+00000031
[ 11] 0x00007fff7143b303 C:Program FilesMATLABR2020Abinwin64performance.dll+00897795 Performance::GetNanosecondTimer+00073891
[ 12] 0x00007ff807df42d6 C:WINDOWSSystem32ucrtbase.dll+00082646 execute_onexit_table+00000342
[ 13] 0x00007ff807df41fb C:WINDOWSSystem32ucrtbase.dll+00082427 execute_onexit_table+00000123
[ 14] 0x00007ff807df41b4 C:WINDOWSSystem32ucrtbase.dll+00082356 execute_onexit_table+00000052
[ 15] 0x00007fff7142d422 C:Program FilesMATLABR2020Abinwin64performance.dll+00840738 Performance::GetNanosecondTimer+00016834
[ 16] 0x00007fff7142d548 C:Program FilesMATLABR2020Abinwin64performance.dll+00841032 Performance::GetNanosecondTimer+00017128
[ 17] 0x00007ff809ee9a1d C:WINDOWSSYSTEM32ntdll.dll+00104989 RtlActivateActivationContextUnsafeFast+00000285
[ 18] 0x00007ff809f2dcfc C:WINDOWSSYSTEM32ntdll.dll+00384252 LdrShutdownProcess+00000588
[ 19] 0x00007ff809f2da8d C:WINDOWSSYSTEM32ntdll.dll+00383629 RtlExitUserProcess+00000173
[ 20] 0x00007ff80890e82b C:WINDOWSSystem32KERNEL32.DLL+00124971 FatalExit+00000011
[ 21] 0x00000000665e0ccd C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00134349 get_pgmptr+00000585
[ 22] 0x00000000668b4045 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02179141 JVM_ResolveClass+00183925
[ 23] 0x00000000668ed5d7 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02414039 JVM_ResolveClass+00418823
[ 24] 0x00000000668ec876 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02410614 JVM_ResolveClass+00415398
[ 25] 0x00000000668ecd11 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02411793 JVM_ResolveClass+00416577
[ 26] 0x00000000668ecf2e C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02412334 JVM_ResolveClass+00417118
[ 27] 0x000000006693fc6a C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02751594 JVM_FindSignal+00026826
[ 28] 0x00000000665e1d9f C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138655 endthreadex+00000067
[ 29] 0x00000000665e1e3b C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138811 endthreadex+00000223
[ 30] 0x00007ff808907614 C:WINDOWSSystem32KERNEL32.DLL+00095764 BaseThreadInitThunk+00000020
[ 31] 0x00007ff809f226b1 C:WINDOWSSYSTEM32ntdll.dll+00337585 RtlUserThreadStart+00000033Getting this error message:
Abnormal termination:
abort()
Register State (captured):
RAX = 00007fff846519a8 RBX = 00007fff846519a8
RCX = 00000053f3afbf10 RDX = 0000000000000000
RSP = 00000053f3afbe90 RBP = 000001ba152f3f70
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 0000000000000003 R9 = 00000053f3afbdf8
R10 = 0000000000000014 R11 = 00007fff84641947
R12 = 00000053f3afcb48 R13 = 0000000000000000
R14 = 00000053f3afc580 R15 = 00007fff846418e8
RIP = 00007fff843f476a EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00007fff843ec9c3 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00051651 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007fff843e98a8 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00039080 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007fff843f009b C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00065691 foundation::core::diag::symbols::getSymbolAddress+00012859
[ 3] 0x00007fff843f3391 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00078737 foundation::core::diag::is_terminate_message_enabled+00000577
[ 4] 0x00007fff8057a50f C:Program FilesMATLABR2020Abinwin64mcr.dll+01156367 mcr::shutdown::startWatchdog+00039423
[ 5] 0x00007fff80579e3c C:Program FilesMATLABR2020Abinwin64mcr.dll+01154620 mcr::shutdown::startWatchdog+00037676
[ 6] 0x00007fff80575473 C:Program FilesMATLABR2020Abinwin64mcr.dll+01135731 mcr::shutdown::startWatchdog+00018787
[ 7] 0x00007fff80577817 C:Program FilesMATLABR2020Abinwin64mcr.dll+01144855 mcr::shutdown::startWatchdog+00027911
[ 8] 0x00007ff807e51881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ff807e52851 C:WINDOWSSystem32ucrtbase.dll+00469073 abort+00000049
[ 10] 0x00007ff807e51f9f C:WINDOWSSystem32ucrtbase.dll+00466847 terminate+00000031
[ 11] 0x00007fff7143b303 C:Program FilesMATLABR2020Abinwin64performance.dll+00897795 Performance::GetNanosecondTimer+00073891
[ 12] 0x00007ff807df42d6 C:WINDOWSSystem32ucrtbase.dll+00082646 execute_onexit_table+00000342
[ 13] 0x00007ff807df41fb C:WINDOWSSystem32ucrtbase.dll+00082427 execute_onexit_table+00000123
[ 14] 0x00007ff807df41b4 C:WINDOWSSystem32ucrtbase.dll+00082356 execute_onexit_table+00000052
[ 15] 0x00007fff7142d422 C:Program FilesMATLABR2020Abinwin64performance.dll+00840738 Performance::GetNanosecondTimer+00016834
[ 16] 0x00007fff7142d548 C:Program FilesMATLABR2020Abinwin64performance.dll+00841032 Performance::GetNanosecondTimer+00017128
[ 17] 0x00007ff809ee9a1d C:WINDOWSSYSTEM32ntdll.dll+00104989 RtlActivateActivationContextUnsafeFast+00000285
[ 18] 0x00007ff809f2dcfc C:WINDOWSSYSTEM32ntdll.dll+00384252 LdrShutdownProcess+00000588
[ 19] 0x00007ff809f2da8d C:WINDOWSSYSTEM32ntdll.dll+00383629 RtlExitUserProcess+00000173
[ 20] 0x00007ff80890e82b C:WINDOWSSystem32KERNEL32.DLL+00124971 FatalExit+00000011
[ 21] 0x00000000665e0ccd C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00134349 get_pgmptr+00000585
[ 22] 0x00000000668b4045 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02179141 JVM_ResolveClass+00183925
[ 23] 0x00000000668ed5d7 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02414039 JVM_ResolveClass+00418823
[ 24] 0x00000000668ec876 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02410614 JVM_ResolveClass+00415398
[ 25] 0x00000000668ecd11 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02411793 JVM_ResolveClass+00416577
[ 26] 0x00000000668ecf2e C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02412334 JVM_ResolveClass+00417118
[ 27] 0x000000006693fc6a C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02751594 JVM_FindSignal+00026826
[ 28] 0x00000000665e1d9f C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138655 endthreadex+00000067
[ 29] 0x00000000665e1e3b C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138811 endthreadex+00000223
[ 30] 0x00007ff808907614 C:WINDOWSSystem32KERNEL32.DLL+00095764 BaseThreadInitThunk+00000020
[ 31] 0x00007ff809f226b1 C:WINDOWSSYSTEM32ntdll.dll+00337585 RtlUserThreadStart+00000033 Getting this error message:
Abnormal termination:
abort()
Register State (captured):
RAX = 00007fff846519a8 RBX = 00007fff846519a8
RCX = 00000053f3afbf10 RDX = 0000000000000000
RSP = 00000053f3afbe90 RBP = 000001ba152f3f70
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 0000000000000003 R9 = 00000053f3afbdf8
R10 = 0000000000000014 R11 = 00007fff84641947
R12 = 00000053f3afcb48 R13 = 0000000000000000
R14 = 00000053f3afc580 R15 = 00007fff846418e8
RIP = 00007fff843f476a EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00007fff843ec9c3 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00051651 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007fff843e98a8 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00039080 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007fff843f009b C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00065691 foundation::core::diag::symbols::getSymbolAddress+00012859
[ 3] 0x00007fff843f3391 C:Program FilesMATLABR2020Abinwin64libmwfl.dll+00078737 foundation::core::diag::is_terminate_message_enabled+00000577
[ 4] 0x00007fff8057a50f C:Program FilesMATLABR2020Abinwin64mcr.dll+01156367 mcr::shutdown::startWatchdog+00039423
[ 5] 0x00007fff80579e3c C:Program FilesMATLABR2020Abinwin64mcr.dll+01154620 mcr::shutdown::startWatchdog+00037676
[ 6] 0x00007fff80575473 C:Program FilesMATLABR2020Abinwin64mcr.dll+01135731 mcr::shutdown::startWatchdog+00018787
[ 7] 0x00007fff80577817 C:Program FilesMATLABR2020Abinwin64mcr.dll+01144855 mcr::shutdown::startWatchdog+00027911
[ 8] 0x00007ff807e51881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ff807e52851 C:WINDOWSSystem32ucrtbase.dll+00469073 abort+00000049
[ 10] 0x00007ff807e51f9f C:WINDOWSSystem32ucrtbase.dll+00466847 terminate+00000031
[ 11] 0x00007fff7143b303 C:Program FilesMATLABR2020Abinwin64performance.dll+00897795 Performance::GetNanosecondTimer+00073891
[ 12] 0x00007ff807df42d6 C:WINDOWSSystem32ucrtbase.dll+00082646 execute_onexit_table+00000342
[ 13] 0x00007ff807df41fb C:WINDOWSSystem32ucrtbase.dll+00082427 execute_onexit_table+00000123
[ 14] 0x00007ff807df41b4 C:WINDOWSSystem32ucrtbase.dll+00082356 execute_onexit_table+00000052
[ 15] 0x00007fff7142d422 C:Program FilesMATLABR2020Abinwin64performance.dll+00840738 Performance::GetNanosecondTimer+00016834
[ 16] 0x00007fff7142d548 C:Program FilesMATLABR2020Abinwin64performance.dll+00841032 Performance::GetNanosecondTimer+00017128
[ 17] 0x00007ff809ee9a1d C:WINDOWSSYSTEM32ntdll.dll+00104989 RtlActivateActivationContextUnsafeFast+00000285
[ 18] 0x00007ff809f2dcfc C:WINDOWSSYSTEM32ntdll.dll+00384252 LdrShutdownProcess+00000588
[ 19] 0x00007ff809f2da8d C:WINDOWSSYSTEM32ntdll.dll+00383629 RtlExitUserProcess+00000173
[ 20] 0x00007ff80890e82b C:WINDOWSSystem32KERNEL32.DLL+00124971 FatalExit+00000011
[ 21] 0x00000000665e0ccd C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00134349 get_pgmptr+00000585
[ 22] 0x00000000668b4045 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02179141 JVM_ResolveClass+00183925
[ 23] 0x00000000668ed5d7 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02414039 JVM_ResolveClass+00418823
[ 24] 0x00000000668ec876 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02410614 JVM_ResolveClass+00415398
[ 25] 0x00000000668ecd11 C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02411793 JVM_ResolveClass+00416577
[ 26] 0x00000000668ecf2e C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02412334 JVM_ResolveClass+00417118
[ 27] 0x000000006693fc6a C:Program FilesMATLABR2020Asysjavajrewin64jrebinserverjvm.dll+02751594 JVM_FindSignal+00026826
[ 28] 0x00000000665e1d9f C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138655 endthreadex+00000067
[ 29] 0x00000000665e1e3b C:Program FilesMATLABR2020Asysjavajrewin64jrebinMSVCR100.dll+00138811 endthreadex+00000223
[ 30] 0x00007ff808907614 C:WINDOWSSystem32KERNEL32.DLL+00095764 BaseThreadInitThunk+00000020
[ 31] 0x00007ff809f226b1 C:WINDOWSSYSTEM32ntdll.dll+00337585 RtlUserThreadStart+00000033 matlab, crashes, abort termination, abort, r2020a MATLAB Answers — New Questions
Matlab extremely slow to start up due to error mwdocsearch.exe
Matlab 2022B has a bug in "mwdocsearch.exe" which is automatically run when launching Matlab and results in the following error.
Caught "std::exception" Exception message is:
An error occurred while initializing child process: While attempting to execute "C:Program FilesMATLABR2023abinwin64mwdocsearch.exe server -m C:Program FilesMATLABR2023a -p 59732 -v C:UsersTestMTTAppDataLocalTemp -t 7412 0 1 0 0 0": CreateProcessW: Insufficient system resources exist to complete the requested service [system:1450]
I tried to upgrade to 2023a and same bug occurs.
Does anybody know how to cure this failure or disable the "mwdocsearch.exe" from running? This will cause Matlab to hangup for sometimes up to 10minutes before ultimately presenting the error and allowing Matlab to open.Matlab 2022B has a bug in "mwdocsearch.exe" which is automatically run when launching Matlab and results in the following error.
Caught "std::exception" Exception message is:
An error occurred while initializing child process: While attempting to execute "C:Program FilesMATLABR2023abinwin64mwdocsearch.exe server -m C:Program FilesMATLABR2023a -p 59732 -v C:UsersTestMTTAppDataLocalTemp -t 7412 0 1 0 0 0": CreateProcessW: Insufficient system resources exist to complete the requested service [system:1450]
I tried to upgrade to 2023a and same bug occurs.
Does anybody know how to cure this failure or disable the "mwdocsearch.exe" from running? This will cause Matlab to hangup for sometimes up to 10minutes before ultimately presenting the error and allowing Matlab to open. Matlab 2022B has a bug in "mwdocsearch.exe" which is automatically run when launching Matlab and results in the following error.
Caught "std::exception" Exception message is:
An error occurred while initializing child process: While attempting to execute "C:Program FilesMATLABR2023abinwin64mwdocsearch.exe server -m C:Program FilesMATLABR2023a -p 59732 -v C:UsersTestMTTAppDataLocalTemp -t 7412 0 1 0 0 0": CreateProcessW: Insufficient system resources exist to complete the requested service [system:1450]
I tried to upgrade to 2023a and same bug occurs.
Does anybody know how to cure this failure or disable the "mwdocsearch.exe" from running? This will cause Matlab to hangup for sometimes up to 10minutes before ultimately presenting the error and allowing Matlab to open. mwdocsearch.exe, slow startup MATLAB Answers — New Questions
How to solve PDEs with only one side boundary conditions?
Hi,
I met some problem in solving a system of PDEs with only the left-side boundary conditions. I will revise the built-in example Solve System of PDEs a little bit to show the problem:
Everything is identical to the example Solve System of PDEs , except the two boundary conditions in the red rectangle, which are at the left hand side (x=0), rather than the right hand side (x=1).
So my question is, can I solve the PDEs through PDEPE (I guess not because it needs BCs on both sides)? Can I use matlab PDE toolbox, or other method, to solve the equations?
I really appreciate your help. Thanks!
RuiHi,
I met some problem in solving a system of PDEs with only the left-side boundary conditions. I will revise the built-in example Solve System of PDEs a little bit to show the problem:
Everything is identical to the example Solve System of PDEs , except the two boundary conditions in the red rectangle, which are at the left hand side (x=0), rather than the right hand side (x=1).
So my question is, can I solve the PDEs through PDEPE (I guess not because it needs BCs on both sides)? Can I use matlab PDE toolbox, or other method, to solve the equations?
I really appreciate your help. Thanks!
Rui Hi,
I met some problem in solving a system of PDEs with only the left-side boundary conditions. I will revise the built-in example Solve System of PDEs a little bit to show the problem:
Everything is identical to the example Solve System of PDEs , except the two boundary conditions in the red rectangle, which are at the left hand side (x=0), rather than the right hand side (x=1).
So my question is, can I solve the PDEs through PDEPE (I guess not because it needs BCs on both sides)? Can I use matlab PDE toolbox, or other method, to solve the equations?
I really appreciate your help. Thanks!
Rui pde, pdepe, pde toolbox MATLAB Answers — New Questions
Video frames all garbled and not in sequence
Hi
I am using imaqtools in particular using gentl driver with Lucid vision camera. Ni Max and Arena records a sequence of frames just fine.
But matlab is having trouble. Initially the frames are in sequence for first few ten frames and then the frames randomly start jumping around e.g., frame 260 appears prior to frame 259 etc.
When I look at frame time, it all seems to be in sequence. Here is my code
Not only that the timing shows that frame interval is about 40ms.
Based on the frame rate that I am providing (40fps), the frame rate should have been ~22ms
% Generated in MATLAB R2022b on 14-Jan-2023 18:07:51
% Connect to Device
% Create connection to the device using the specified adaptor with the specified format.
clearvars;
v = videoinput("gentl", 1, "Mono16");
%% Configure Device-Specific Properties
% Configure properties that are specific to this device.
v.SelectedSource = "1";
%src displays a summary of video object
src = getselectedsource(v);
src.ExposureAuto = ‘Off’;
src.AcquisitionFrameRateEnable = ‘true’;
src.AcquisitionFrameRate = 40;
exposuretime =1000;%ms
src.ExposureTime = exposuretime;
%PRF=1000;
numFrames=ceil(231*4*5/src.AcquisitionFrameRate);
v.FramesPerTrigger = 1.5*numFrames;%extra frames for not missing out
set(v, ‘Timeout’, 600);
%% Record Video for Set Number of Frames
% Record video data for a specified number of frames.
start(v);
%give sufficient time 3x
wait(v,3*1/src.AcquisitionFrameRate*numFrames);
%stop(v);
while get(v,’FramesAvailable’)<1 %Wait until at least 1 frame is available
unavailable=1;
end
% Determine the number frames acquired.
framesLogged = v.FramesAcquired;
[recording1,Time,Meta] = getdata(v, framesLogged);
%% Show Recording
% View the recorded video.
implay(recording1);
%% Clean Up
% Delete the videoinput object and clear variables from the workspace.
%stop(v);
delete(v)
clear src v
%%
fid = fopen(‘2D_scan.bin’,’w’);
fwrite(fid’,recording1,"uint16");Hi
I am using imaqtools in particular using gentl driver with Lucid vision camera. Ni Max and Arena records a sequence of frames just fine.
But matlab is having trouble. Initially the frames are in sequence for first few ten frames and then the frames randomly start jumping around e.g., frame 260 appears prior to frame 259 etc.
When I look at frame time, it all seems to be in sequence. Here is my code
Not only that the timing shows that frame interval is about 40ms.
Based on the frame rate that I am providing (40fps), the frame rate should have been ~22ms
% Generated in MATLAB R2022b on 14-Jan-2023 18:07:51
% Connect to Device
% Create connection to the device using the specified adaptor with the specified format.
clearvars;
v = videoinput("gentl", 1, "Mono16");
%% Configure Device-Specific Properties
% Configure properties that are specific to this device.
v.SelectedSource = "1";
%src displays a summary of video object
src = getselectedsource(v);
src.ExposureAuto = ‘Off’;
src.AcquisitionFrameRateEnable = ‘true’;
src.AcquisitionFrameRate = 40;
exposuretime =1000;%ms
src.ExposureTime = exposuretime;
%PRF=1000;
numFrames=ceil(231*4*5/src.AcquisitionFrameRate);
v.FramesPerTrigger = 1.5*numFrames;%extra frames for not missing out
set(v, ‘Timeout’, 600);
%% Record Video for Set Number of Frames
% Record video data for a specified number of frames.
start(v);
%give sufficient time 3x
wait(v,3*1/src.AcquisitionFrameRate*numFrames);
%stop(v);
while get(v,’FramesAvailable’)<1 %Wait until at least 1 frame is available
unavailable=1;
end
% Determine the number frames acquired.
framesLogged = v.FramesAcquired;
[recording1,Time,Meta] = getdata(v, framesLogged);
%% Show Recording
% View the recorded video.
implay(recording1);
%% Clean Up
% Delete the videoinput object and clear variables from the workspace.
%stop(v);
delete(v)
clear src v
%%
fid = fopen(‘2D_scan.bin’,’w’);
fwrite(fid’,recording1,"uint16"); Hi
I am using imaqtools in particular using gentl driver with Lucid vision camera. Ni Max and Arena records a sequence of frames just fine.
But matlab is having trouble. Initially the frames are in sequence for first few ten frames and then the frames randomly start jumping around e.g., frame 260 appears prior to frame 259 etc.
When I look at frame time, it all seems to be in sequence. Here is my code
Not only that the timing shows that frame interval is about 40ms.
Based on the frame rate that I am providing (40fps), the frame rate should have been ~22ms
% Generated in MATLAB R2022b on 14-Jan-2023 18:07:51
% Connect to Device
% Create connection to the device using the specified adaptor with the specified format.
clearvars;
v = videoinput("gentl", 1, "Mono16");
%% Configure Device-Specific Properties
% Configure properties that are specific to this device.
v.SelectedSource = "1";
%src displays a summary of video object
src = getselectedsource(v);
src.ExposureAuto = ‘Off’;
src.AcquisitionFrameRateEnable = ‘true’;
src.AcquisitionFrameRate = 40;
exposuretime =1000;%ms
src.ExposureTime = exposuretime;
%PRF=1000;
numFrames=ceil(231*4*5/src.AcquisitionFrameRate);
v.FramesPerTrigger = 1.5*numFrames;%extra frames for not missing out
set(v, ‘Timeout’, 600);
%% Record Video for Set Number of Frames
% Record video data for a specified number of frames.
start(v);
%give sufficient time 3x
wait(v,3*1/src.AcquisitionFrameRate*numFrames);
%stop(v);
while get(v,’FramesAvailable’)<1 %Wait until at least 1 frame is available
unavailable=1;
end
% Determine the number frames acquired.
framesLogged = v.FramesAcquired;
[recording1,Time,Meta] = getdata(v, framesLogged);
%% Show Recording
% View the recorded video.
implay(recording1);
%% Clean Up
% Delete the videoinput object and clear variables from the workspace.
%stop(v);
delete(v)
clear src v
%%
fid = fopen(‘2D_scan.bin’,’w’);
fwrite(fid’,recording1,"uint16"); imaqtools, video, recording, gentl, lucid MATLAB Answers — New Questions
colormap using command line in implay()
While I can change the colormap using the pull down menu, is there a way to use a command line to change the colormap?
So my images are grayscale uint16
implay sets it as gray(256)
From the pull down menu I change the settings to manually select 0-2000 or whatever other than 255.
Otherwise all the images are dark.
But is there a way to do this using commands?
I have stack of 200 frames i.e., the images are N x M x 1 x 200
ThanksWhile I can change the colormap using the pull down menu, is there a way to use a command line to change the colormap?
So my images are grayscale uint16
implay sets it as gray(256)
From the pull down menu I change the settings to manually select 0-2000 or whatever other than 255.
Otherwise all the images are dark.
But is there a way to do this using commands?
I have stack of 200 frames i.e., the images are N x M x 1 x 200
Thanks While I can change the colormap using the pull down menu, is there a way to use a command line to change the colormap?
So my images are grayscale uint16
implay sets it as gray(256)
From the pull down menu I change the settings to manually select 0-2000 or whatever other than 255.
Otherwise all the images are dark.
But is there a way to do this using commands?
I have stack of 200 frames i.e., the images are N x M x 1 x 200
Thanks image processing, colormap, implay MATLAB Answers — New Questions
3-D line of best fit from origin to cloud of data points
I’m trying to get a line of best fit for a 3-D set of data points. This line of fit should go from the origin to the "cloud" of points, and I’d like to know the equation for that fit. Any ideas?
ThanksI’m trying to get a line of best fit for a 3-D set of data points. This line of fit should go from the origin to the "cloud" of points, and I’d like to know the equation for that fit. Any ideas?
Thanks I’m trying to get a line of best fit for a 3-D set of data points. This line of fit should go from the origin to the "cloud" of points, and I’d like to know the equation for that fit. Any ideas?
Thanks line of best fit, 3-d data MATLAB Answers — New Questions
How Do I Make a Dropdown of UI Elements in a Live Editor Task ?
In the Live Editor, Matlab has a built in Live Task, "Create Plot", which has toggleable containers used to show / hide UI Elements. I can’t find any documentation on how to replicate this.
The picture above is Matlab’s "Create Plot". I’m asking about the toggles on "Select visualization", "Select data", and "Select optional visualization parameters". The picture below is my own Custom Live Editor Task, where "Get Graph" is created using a uigridlayout and a uilabel.In the Live Editor, Matlab has a built in Live Task, "Create Plot", which has toggleable containers used to show / hide UI Elements. I can’t find any documentation on how to replicate this.
The picture above is Matlab’s "Create Plot". I’m asking about the toggles on "Select visualization", "Select data", and "Select optional visualization parameters". The picture below is my own Custom Live Editor Task, where "Get Graph" is created using a uigridlayout and a uilabel. In the Live Editor, Matlab has a built in Live Task, "Create Plot", which has toggleable containers used to show / hide UI Elements. I can’t find any documentation on how to replicate this.
The picture above is Matlab’s "Create Plot". I’m asking about the toggles on "Select visualization", "Select data", and "Select optional visualization parameters". The picture below is my own Custom Live Editor Task, where "Get Graph" is created using a uigridlayout and a uilabel. live editor, tasks MATLAB Answers — New Questions
Save_System error:
I am writing a script to in version 2021b to:
1) load a Simulink model using:
mhandle = load_system(this_model)
2) make some changes, e.g., renaming some signals
3) save these changes using:
save_system(mhandle)
close_system(mhandle)
I keep getting the following error:
Error using save_system (line 43)
system: invalid vector subscript: (class std::out_of_range)
Seems simple enough, but I can’t figure what I’m doing wrong. I also tried
close_system(mhandle, 1)
but get the same error. Thanks for any guidance for what seems to be a brain-freeze mistake 🙂 :)I am writing a script to in version 2021b to:
1) load a Simulink model using:
mhandle = load_system(this_model)
2) make some changes, e.g., renaming some signals
3) save these changes using:
save_system(mhandle)
close_system(mhandle)
I keep getting the following error:
Error using save_system (line 43)
system: invalid vector subscript: (class std::out_of_range)
Seems simple enough, but I can’t figure what I’m doing wrong. I also tried
close_system(mhandle, 1)
but get the same error. Thanks for any guidance for what seems to be a brain-freeze mistake 🙂 🙂 I am writing a script to in version 2021b to:
1) load a Simulink model using:
mhandle = load_system(this_model)
2) make some changes, e.g., renaming some signals
3) save these changes using:
save_system(mhandle)
close_system(mhandle)
I keep getting the following error:
Error using save_system (line 43)
system: invalid vector subscript: (class std::out_of_range)
Seems simple enough, but I can’t figure what I’m doing wrong. I also tried
close_system(mhandle, 1)
but get the same error. Thanks for any guidance for what seems to be a brain-freeze mistake 🙂 🙂 load_system, save_system, close_system MATLAB Answers — New Questions
When is subsystem reference a better choice than model reference?
I am trying to understand the difference between "model reference" and "subsystem reference". I came across this documentation page, but no matter how many use-cases I reviewed, I never seem to end up with a "subsystem reference". From the flow chart shown in that page, the only way conclude with "subsystem reference" is when the block does not have a defined interface, or is not re-used or does not change. These are the antithesis of arguments for any creating any type of subsystems. Can someone comment on practical situations when a "subsystem reference" will be useful over "model reference"? Are there computational costs associated with "model reference"? I am inclined to believe that in practical cases in the industry, "subsystem references" are rarely used.I am trying to understand the difference between "model reference" and "subsystem reference". I came across this documentation page, but no matter how many use-cases I reviewed, I never seem to end up with a "subsystem reference". From the flow chart shown in that page, the only way conclude with "subsystem reference" is when the block does not have a defined interface, or is not re-used or does not change. These are the antithesis of arguments for any creating any type of subsystems. Can someone comment on practical situations when a "subsystem reference" will be useful over "model reference"? Are there computational costs associated with "model reference"? I am inclined to believe that in practical cases in the industry, "subsystem references" are rarely used. I am trying to understand the difference between "model reference" and "subsystem reference". I came across this documentation page, but no matter how many use-cases I reviewed, I never seem to end up with a "subsystem reference". From the flow chart shown in that page, the only way conclude with "subsystem reference" is when the block does not have a defined interface, or is not re-used or does not change. These are the antithesis of arguments for any creating any type of subsystems. Can someone comment on practical situations when a "subsystem reference" will be useful over "model reference"? Are there computational costs associated with "model reference"? I am inclined to believe that in practical cases in the industry, "subsystem references" are rarely used. reference subsystem, model subsystem MATLAB Answers — New Questions
How to combine panes, or how to redock an undocked file in main editor pane
When I am editing multiple files, I have them all open in one undocked editor window, each one with it’s own tab.
Sometimes I like to rearrange them by dragging the tabs. It’s very sensitive to vertical movements (that’s a bug too, it should not be so sensitive in the vertical direction) so if I move a little bit vertically, the editor creates a separate pane for the tab. I can’t figure out how to move it back to the pane with all my other files. I can undock, then dock all in editor, but the editor just puts it back into its separate pane.
How do I get back to the arrangement that I started with?When I am editing multiple files, I have them all open in one undocked editor window, each one with it’s own tab.
Sometimes I like to rearrange them by dragging the tabs. It’s very sensitive to vertical movements (that’s a bug too, it should not be so sensitive in the vertical direction) so if I move a little bit vertically, the editor creates a separate pane for the tab. I can’t figure out how to move it back to the pane with all my other files. I can undock, then dock all in editor, but the editor just puts it back into its separate pane.
How do I get back to the arrangement that I started with? When I am editing multiple files, I have them all open in one undocked editor window, each one with it’s own tab.
Sometimes I like to rearrange them by dragging the tabs. It’s very sensitive to vertical movements (that’s a bug too, it should not be so sensitive in the vertical direction) so if I move a little bit vertically, the editor creates a separate pane for the tab. I can’t figure out how to move it back to the pane with all my other files. I can undock, then dock all in editor, but the editor just puts it back into its separate pane.
How do I get back to the arrangement that I started with? editor, undock, dock, pane MATLAB Answers — New Questions
How to recursively go through all directories and sub directories and process files?
So I have a single directory with sub directories and sub directories and then files (its a mess). I want to go to each folder at end ( I dont care about directories) and process the files in it (be it .txt .jpg etc). I kinda got a way to list all folders using the dirwalk function from here, – https://www.mathworks.com/matlabcentral/fileexchange/32036-dirwalk-walk-the-directory-tree , but I don’t know two things. How to figure out if a path (the function outputs all possible paths, thats what i understood) is not directory with sub directories, but a directory with images or text files, so I can process them. After choosing a path, I need to figure out how to loop through files. Or is there an easier way I’m missing? any advice would be appreciated!
Example of direc structure:
Main Directory>
>> Dir 1
>> fold1
>>txt files
>>fold2
>>files
>>Dir 2
…etcSo I have a single directory with sub directories and sub directories and then files (its a mess). I want to go to each folder at end ( I dont care about directories) and process the files in it (be it .txt .jpg etc). I kinda got a way to list all folders using the dirwalk function from here, – https://www.mathworks.com/matlabcentral/fileexchange/32036-dirwalk-walk-the-directory-tree , but I don’t know two things. How to figure out if a path (the function outputs all possible paths, thats what i understood) is not directory with sub directories, but a directory with images or text files, so I can process them. After choosing a path, I need to figure out how to loop through files. Or is there an easier way I’m missing? any advice would be appreciated!
Example of direc structure:
Main Directory>
>> Dir 1
>> fold1
>>txt files
>>fold2
>>files
>>Dir 2
…etc So I have a single directory with sub directories and sub directories and then files (its a mess). I want to go to each folder at end ( I dont care about directories) and process the files in it (be it .txt .jpg etc). I kinda got a way to list all folders using the dirwalk function from here, – https://www.mathworks.com/matlabcentral/fileexchange/32036-dirwalk-walk-the-directory-tree , but I don’t know two things. How to figure out if a path (the function outputs all possible paths, thats what i understood) is not directory with sub directories, but a directory with images or text files, so I can process them. After choosing a path, I need to figure out how to loop through files. Or is there an easier way I’m missing? any advice would be appreciated!
Example of direc structure:
Main Directory>
>> Dir 1
>> fold1
>>txt files
>>fold2
>>files
>>Dir 2
…etc directory, file processing MATLAB Answers — New Questions
error: unknown type name ‘mxArray’
I added non-inlined s-functions to a simulink model, built the code, and am now trying to generate a2l file.
I am running into these errors. In what file do I define the type names and how do I define them?
Thanks,
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘_ResolveVarFcn’
error: unknown type name ‘_ssFcnCallExecArgInfo’
simstruc.h:: error: unknown type name ‘_ssFcnCallExecArgInfo’
error: unknown type name ‘_ssFcnCallExecArgs’
imstruc.h: error: unknown type name ‘SSSimulinkFunctionPtr’I added non-inlined s-functions to a simulink model, built the code, and am now trying to generate a2l file.
I am running into these errors. In what file do I define the type names and how do I define them?
Thanks,
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘_ResolveVarFcn’
error: unknown type name ‘_ssFcnCallExecArgInfo’
simstruc.h:: error: unknown type name ‘_ssFcnCallExecArgInfo’
error: unknown type name ‘_ssFcnCallExecArgs’
imstruc.h: error: unknown type name ‘SSSimulinkFunctionPtr’ I added non-inlined s-functions to a simulink model, built the code, and am now trying to generate a2l file.
I am running into these errors. In what file do I define the type names and how do I define them?
Thanks,
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘mxArray’
simstruc.h:: error: unknown type name ‘_ResolveVarFcn’
error: unknown type name ‘_ssFcnCallExecArgInfo’
simstruc.h:: error: unknown type name ‘_ssFcnCallExecArgInfo’
error: unknown type name ‘_ssFcnCallExecArgs’
imstruc.h: error: unknown type name ‘SSSimulinkFunctionPtr’ ‘mxarray’ unknown type name MATLAB Answers — New Questions
Running CLP Solver (COIN-OR) from MATLAB
Hello everyone,
I want to use the COIN-OR CLP linear program solver from MATLAB. Is it possible to create a function in matlab with inputs and outputs, which solves the LP using CLP solver? I’ll appreciate any guidance.
Best,
DursunHello everyone,
I want to use the COIN-OR CLP linear program solver from MATLAB. Is it possible to create a function in matlab with inputs and outputs, which solves the LP using CLP solver? I’ll appreciate any guidance.
Best,
Dursun Hello everyone,
I want to use the COIN-OR CLP linear program solver from MATLAB. Is it possible to create a function in matlab with inputs and outputs, which solves the LP using CLP solver? I’ll appreciate any guidance.
Best,
Dursun coin-or, clp, lp, lp solver, linear program MATLAB Answers — New Questions
Artifacts appear on my matlab image
Hello everyone,
I wrote a matlab program to process my data, the results and in the form of image of different colors. The color scale is a choice and this is the problem, because when I use a colormap with 3 different colors I don’t have this artifact that appears but when I use the one with the rainbow colors the artifact appears. I’m attaching the image and the code snippet for the colormap. Do you have any idea why I’m having this problem? How can I fix it?Hello everyone,
I wrote a matlab program to process my data, the results and in the form of image of different colors. The color scale is a choice and this is the problem, because when I use a colormap with 3 different colors I don’t have this artifact that appears but when I use the one with the rainbow colors the artifact appears. I’m attaching the image and the code snippet for the colormap. Do you have any idea why I’m having this problem? How can I fix it? Hello everyone,
I wrote a matlab program to process my data, the results and in the form of image of different colors. The color scale is a choice and this is the problem, because when I use a colormap with 3 different colors I don’t have this artifact that appears but when I use the one with the rainbow colors the artifact appears. I’m attaching the image and the code snippet for the colormap. Do you have any idea why I’m having this problem? How can I fix it? colourmap, image processing MATLAB Answers — New Questions
Can anyone help me for knowing the options of genetic algorithm?
How can i know what the value that i put in genetic algorithm’s options ?How can i know what the value that i put in genetic algorithm’s options ? How can i know what the value that i put in genetic algorithm’s options ? genetic algorithm, matlab MATLAB Answers — New Questions
Connecting MATLAB to ABAQUS and reading osb output files
I want to run a .inp abaqus file through MATLAB and read the results output in the form of odb files. SOme help regarding this would be appreciatedI want to run a .inp abaqus file through MATLAB and read the results output in the form of odb files. SOme help regarding this would be appreciated I want to run a .inp abaqus file through MATLAB and read the results output in the form of odb files. SOme help regarding this would be appreciated abaqus, odb file reading MATLAB Answers — New Questions
Can I attach multiple DBC files to a single “canChannel” object?
I am using the Vehicle Network Toolbox, and would like to either concatenate two DBC files or attach multiple DBC files to the same "canChannel" object. Is this possible?I am using the Vehicle Network Toolbox, and would like to either concatenate two DBC files or attach multiple DBC files to the same "canChannel" object. Is this possible? I am using the Vehicle Network Toolbox, and would like to either concatenate two DBC files or attach multiple DBC files to the same "canChannel" object. Is this possible? can, dbc, canchannel, cat MATLAB Answers — New Questions
Example of a Device Driver integrated in Simulink using a Custom block
Hi,
Can someone point to any example/sample code demonstrating integration of a board specific device driver code ( for example read data from a serial bus like CAN/SPI, or even simpler read data from ADC etc.. ) into SIMULINK with a custom block.
Which is a better choice for such a requirement , S-Function block or a C Function block?
I want to possibly simulate and also generate the glue code to integrate with the low level driver with the embedded coder.
Thanks in advance
AAAHi,
Can someone point to any example/sample code demonstrating integration of a board specific device driver code ( for example read data from a serial bus like CAN/SPI, or even simpler read data from ADC etc.. ) into SIMULINK with a custom block.
Which is a better choice for such a requirement , S-Function block or a C Function block?
I want to possibly simulate and also generate the glue code to integrate with the low level driver with the embedded coder.
Thanks in advance
AAA Hi,
Can someone point to any example/sample code demonstrating integration of a board specific device driver code ( for example read data from a serial bus like CAN/SPI, or even simpler read data from ADC etc.. ) into SIMULINK with a custom block.
Which is a better choice for such a requirement , S-Function block or a C Function block?
I want to possibly simulate and also generate the glue code to integrate with the low level driver with the embedded coder.
Thanks in advance
AAA custom blocks MATLAB Answers — New Questions