Tag Archives: matlab
How to Clean the MATLAB Runtime (MCR) Cache?
How can I clean MATLAB Runtime cache?How can I clean MATLAB Runtime cache? How can I clean MATLAB Runtime cache? MATLAB Answers — New Questions
Why do I get the error “Unrecognized function or variable ‘ctfroot'” when running “MATLABWebAppServer.exe”?
Why do I get the error "Unrecognized function or variable ‘ctfroot’" when running the Development version of MATLAB Web App Server – "MATLABWebAppServer.exe"?
Here is a screenshot of the exact error:Why do I get the error "Unrecognized function or variable ‘ctfroot’" when running the Development version of MATLAB Web App Server – "MATLABWebAppServer.exe"?
Here is a screenshot of the exact error: Why do I get the error "Unrecognized function or variable ‘ctfroot’" when running the Development version of MATLAB Web App Server – "MATLABWebAppServer.exe"?
Here is a screenshot of the exact error: matlabwebappserver, ctfroot, unrecognized, web, app, server MATLAB Answers — New Questions
RMSE in Fuzzy logic designer
I can’t find any information about how the Fuzzy Logic Designer toolbox calculates the RMSE. Does anyone know how it’s done?I can’t find any information about how the Fuzzy Logic Designer toolbox calculates the RMSE. Does anyone know how it’s done? I can’t find any information about how the Fuzzy Logic Designer toolbox calculates the RMSE. Does anyone know how it’s done? rmse, fuzzy MATLAB Answers — New Questions
integrate with the upper limit is a function
Hello!
How to integrate a function on Matlab with the upper limit is a function, for exemple the following integral:
i tried this code:
U= vpa(int(f,s,0,t^2))
but it returns int(f,s,0,t^2)!!
is there any method to do it?Hello!
How to integrate a function on Matlab with the upper limit is a function, for exemple the following integral:
i tried this code:
U= vpa(int(f,s,0,t^2))
but it returns int(f,s,0,t^2)!!
is there any method to do it? Hello!
How to integrate a function on Matlab with the upper limit is a function, for exemple the following integral:
i tried this code:
U= vpa(int(f,s,0,t^2))
but it returns int(f,s,0,t^2)!!
is there any method to do it? integral, numerical integration MATLAB Answers — New Questions
MATLAB only plotting most recent graph
I don’t understand why matlab is only plotting figure 2
t0 = 0; tf = 50; y0 = [-0.5;0.5];
[t,Y] = ode45(@f,[t0,tf],y0,[]);
y=Y(:,1);v=Y(:,2);
[t,Y(:,1),Y(:,2)];
% y in output has 2 columns corresponding to u1 and u2
figure(1);
plot(t, y,’b-‘, t,v,’r-‘ )
xlabel(‘t’); ylabel(‘y, v = y”’);
legend(‘y(t)’,’v(t)’)
ylim([-2.5,2.5]);xticks(0:10:50);
grid on
figure(2);
plot(y,v); axis square; xlabel(‘y’); ylabel(‘v=y”’);
ylim([-2.5,2.5])
xlim([-2.5,2.5])
grid on
hold off
% plot the phase plot %———————————————————————-
function dydt = f(t,Y)
y = Y(1); v = Y(2);
dydt = [v;-2*sin(t)-v-2*y ];
endI don’t understand why matlab is only plotting figure 2
t0 = 0; tf = 50; y0 = [-0.5;0.5];
[t,Y] = ode45(@f,[t0,tf],y0,[]);
y=Y(:,1);v=Y(:,2);
[t,Y(:,1),Y(:,2)];
% y in output has 2 columns corresponding to u1 and u2
figure(1);
plot(t, y,’b-‘, t,v,’r-‘ )
xlabel(‘t’); ylabel(‘y, v = y”’);
legend(‘y(t)’,’v(t)’)
ylim([-2.5,2.5]);xticks(0:10:50);
grid on
figure(2);
plot(y,v); axis square; xlabel(‘y’); ylabel(‘v=y”’);
ylim([-2.5,2.5])
xlim([-2.5,2.5])
grid on
hold off
% plot the phase plot %———————————————————————-
function dydt = f(t,Y)
y = Y(1); v = Y(2);
dydt = [v;-2*sin(t)-v-2*y ];
end I don’t understand why matlab is only plotting figure 2
t0 = 0; tf = 50; y0 = [-0.5;0.5];
[t,Y] = ode45(@f,[t0,tf],y0,[]);
y=Y(:,1);v=Y(:,2);
[t,Y(:,1),Y(:,2)];
% y in output has 2 columns corresponding to u1 and u2
figure(1);
plot(t, y,’b-‘, t,v,’r-‘ )
xlabel(‘t’); ylabel(‘y, v = y”’);
legend(‘y(t)’,’v(t)’)
ylim([-2.5,2.5]);xticks(0:10:50);
grid on
figure(2);
plot(y,v); axis square; xlabel(‘y’); ylabel(‘v=y”’);
ylim([-2.5,2.5])
xlim([-2.5,2.5])
grid on
hold off
% plot the phase plot %———————————————————————-
function dydt = f(t,Y)
y = Y(1); v = Y(2);
dydt = [v;-2*sin(t)-v-2*y ];
end graph problem MATLAB Answers — New Questions
uilabel – fit width to text
Hi,
I have some uilabel objectss in my appdesigner app which are created programmatically while the app is running.
Now I would like to change the size of the uilabel in a way that it fits the text and does not cut it off. How can I do that?
Googling gave me only some information on how to do that with uicontrol objects via the ‘Extent’ property. Unfortunately, uilabel objects do not have such a property and uicontrols don’t work with appdesigner.
I would also be interested in how to fit the label size when the fontsize changes. Maybe that could be done using the same means.Hi,
I have some uilabel objectss in my appdesigner app which are created programmatically while the app is running.
Now I would like to change the size of the uilabel in a way that it fits the text and does not cut it off. How can I do that?
Googling gave me only some information on how to do that with uicontrol objects via the ‘Extent’ property. Unfortunately, uilabel objects do not have such a property and uicontrols don’t work with appdesigner.
I would also be interested in how to fit the label size when the fontsize changes. Maybe that could be done using the same means. Hi,
I have some uilabel objectss in my appdesigner app which are created programmatically while the app is running.
Now I would like to change the size of the uilabel in a way that it fits the text and does not cut it off. How can I do that?
Googling gave me only some information on how to do that with uicontrol objects via the ‘Extent’ property. Unfortunately, uilabel objects do not have such a property and uicontrols don’t work with appdesigner.
I would also be interested in how to fit the label size when the fontsize changes. Maybe that could be done using the same means. appdesigner, uilabel MATLAB Answers — New Questions
What happened to the figure palette plot browser for 2024B?
What happened to the figure palette plot browser for 2024B? In 2023 version and before it, I can type figure then with the figure palette I can add an axes and then add data to the plot for quickly looking at data in a mat file. Is this all gone, how is it replaced?What happened to the figure palette plot browser for 2024B? In 2023 version and before it, I can type figure then with the figure palette I can add an axes and then add data to the plot for quickly looking at data in a mat file. Is this all gone, how is it replaced? What happened to the figure palette plot browser for 2024B? In 2023 version and before it, I can type figure then with the figure palette I can add an axes and then add data to the plot for quickly looking at data in a mat file. Is this all gone, how is it replaced? figure axes palette MATLAB Answers — New Questions
How to resize uitable?
I have a uitable extracting data from a database in my GUI which is displayed upon a click of a button.
I am sending 3 columns of data, however only one column appears with a horizontal scroll bar. I want the table to re-adjust the size depending on he number of columns sent as this can be seleced from 1-3.
Here is my code so far:
FinalOut = [Output, Output2, Output3];
disp(FinalOut);
ColNames = {TableType; TableType2; TableType3};
disp(ColNames);
uitable(handles.figure1,’Data’,FinalOut,’ColumnName’,ColNames,’Position’,[250 20 150 300]);
Is there a way to make this table more flexible/dynamic depending on the columns of data sent, so the width of the table only is changed as data is loaded in?I have a uitable extracting data from a database in my GUI which is displayed upon a click of a button.
I am sending 3 columns of data, however only one column appears with a horizontal scroll bar. I want the table to re-adjust the size depending on he number of columns sent as this can be seleced from 1-3.
Here is my code so far:
FinalOut = [Output, Output2, Output3];
disp(FinalOut);
ColNames = {TableType; TableType2; TableType3};
disp(ColNames);
uitable(handles.figure1,’Data’,FinalOut,’ColumnName’,ColNames,’Position’,[250 20 150 300]);
Is there a way to make this table more flexible/dynamic depending on the columns of data sent, so the width of the table only is changed as data is loaded in? I have a uitable extracting data from a database in my GUI which is displayed upon a click of a button.
I am sending 3 columns of data, however only one column appears with a horizontal scroll bar. I want the table to re-adjust the size depending on he number of columns sent as this can be seleced from 1-3.
Here is my code so far:
FinalOut = [Output, Output2, Output3];
disp(FinalOut);
ColNames = {TableType; TableType2; TableType3};
disp(ColNames);
uitable(handles.figure1,’Data’,FinalOut,’ColumnName’,ColNames,’Position’,[250 20 150 300]);
Is there a way to make this table more flexible/dynamic depending on the columns of data sent, so the width of the table only is changed as data is loaded in? uitable, gui, mysql MATLAB Answers — New Questions
Understanding using the Plot() and troubleshooting with R2024a
So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them.So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them. So I am doing a simple project coupling with Simulink and an Arduino Uno. I built a model and used the arduino to generate data.
This is the code that I am using.
figure; plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
eo_act and ei are variables.
Ts is the assigned Sample time which is declared in the program in Simulink.
40 is the amount of time the program ran to collect the data.
So my problem is this: I keep on having this error code. But I don’t know how to fix it or understand why it is popping up.
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,’r’);
and
Error using plot
Data cannot have more than 2 dimensions.
Error in RCPulseM (line 76)
plot(0:Ts:40,eo_act,0:Ts:40,ei,’r’);
I read the doc file assoiated with plots(), but it doesn’t seem to explain for my situation. I have been experimenting with it. I separated each variable in their own respective plot()s and added a "hold on". It still throws the same error. I also verified that the variable has data in them. plot MATLAB Answers — New Questions
Compensate the vector with the last entry
I have a length L vector contains some numbers, I want to compensate this vector to length K, where K > L, with repeating the last entry of the vector. For example, the vector is [2 4 7 3], after compensate, it will be [2 4 7 3 3 3 3 3]. I hope there is an efficient way to do so because I actually have more than 10^4 vectors to compensate.
Thanks,I have a length L vector contains some numbers, I want to compensate this vector to length K, where K > L, with repeating the last entry of the vector. For example, the vector is [2 4 7 3], after compensate, it will be [2 4 7 3 3 3 3 3]. I hope there is an efficient way to do so because I actually have more than 10^4 vectors to compensate.
Thanks, I have a length L vector contains some numbers, I want to compensate this vector to length K, where K > L, with repeating the last entry of the vector. For example, the vector is [2 4 7 3], after compensate, it will be [2 4 7 3 3 3 3 3]. I hope there is an efficient way to do so because I actually have more than 10^4 vectors to compensate.
Thanks, matlab MATLAB Answers — New Questions
Live Editor (Matlab Mobile): clear output
Hi! How can I clear all outputs in Matlab Mobile when using the Live Editor environment?Hi! How can I clear all outputs in Matlab Mobile when using the Live Editor environment? Hi! How can I clear all outputs in Matlab Mobile when using the Live Editor environment? matlab mobile, live editor MATLAB Answers — New Questions
Why does my parpool crash when I am running Python from within MATLAB using Anaconda Python?
My parallel pool keeps crashing every time I run my MATLAB code that calls Python functions inside it. My Python installation was installed using Anaconda.
My crash log is shown below:
——————————————————————————–
abort() detected at 2023-11-06 14:11:56 -0800
——————————————————————————–
Stack Trace (captured):
[ 0] 0x00007ffcdc43aca3 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00044195 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007ffcdc439278 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00037496 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007ffcdc43d39f C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00054175 foundation::core::diag::symbols::getSymbolAddress+00009455
[ 3] 0x00007ffcdc4403b7 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00066487 foundation::core::diag::is_terminate_message_enabled+00000535
[ 4] 0x00007ffc891a5e6f C:Program FilesMATLABR2023bbinwin64mcr.dll+00876143 mnFullExitFcn+00036351
[ 5] 0x00007ffc891a569d C:Program FilesMATLABR2023bbinwin64mcr.dll+00874141 mnFullExitFcn+00034349
[ 6] 0x00007ffc891a1523 C:Program FilesMATLABR2023bbinwin64mcr.dll+00857379 mnFullExitFcn+00017587
[ 7] 0x00007ffc891a322f C:Program FilesMATLABR2023bbinwin64mcr.dll+00864815 mnFullExitFcn+00025023
[ 8] 0x00007ffd2aa61881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ffc0d6268d3 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00747731 _kmp_get_reduce_method+00026275
[ 10] 0x00007ffc0d606a1c C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00616988 kmp_set_affinity+00005292
[ 11] 0x00007ffc0d625d2d C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00744749 _kmp_get_reduce_method+00023293
[ 12] 0x00007ffc0d612515 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00664853 _kmp_acquire_nested_drdpa_lock+00021861My parallel pool keeps crashing every time I run my MATLAB code that calls Python functions inside it. My Python installation was installed using Anaconda.
My crash log is shown below:
——————————————————————————–
abort() detected at 2023-11-06 14:11:56 -0800
——————————————————————————–
Stack Trace (captured):
[ 0] 0x00007ffcdc43aca3 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00044195 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007ffcdc439278 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00037496 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007ffcdc43d39f C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00054175 foundation::core::diag::symbols::getSymbolAddress+00009455
[ 3] 0x00007ffcdc4403b7 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00066487 foundation::core::diag::is_terminate_message_enabled+00000535
[ 4] 0x00007ffc891a5e6f C:Program FilesMATLABR2023bbinwin64mcr.dll+00876143 mnFullExitFcn+00036351
[ 5] 0x00007ffc891a569d C:Program FilesMATLABR2023bbinwin64mcr.dll+00874141 mnFullExitFcn+00034349
[ 6] 0x00007ffc891a1523 C:Program FilesMATLABR2023bbinwin64mcr.dll+00857379 mnFullExitFcn+00017587
[ 7] 0x00007ffc891a322f C:Program FilesMATLABR2023bbinwin64mcr.dll+00864815 mnFullExitFcn+00025023
[ 8] 0x00007ffd2aa61881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ffc0d6268d3 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00747731 _kmp_get_reduce_method+00026275
[ 10] 0x00007ffc0d606a1c C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00616988 kmp_set_affinity+00005292
[ 11] 0x00007ffc0d625d2d C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00744749 _kmp_get_reduce_method+00023293
[ 12] 0x00007ffc0d612515 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00664853 _kmp_acquire_nested_drdpa_lock+00021861 My parallel pool keeps crashing every time I run my MATLAB code that calls Python functions inside it. My Python installation was installed using Anaconda.
My crash log is shown below:
——————————————————————————–
abort() detected at 2023-11-06 14:11:56 -0800
——————————————————————————–
Stack Trace (captured):
[ 0] 0x00007ffcdc43aca3 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00044195 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00007ffcdc439278 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00037496 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00007ffcdc43d39f C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00054175 foundation::core::diag::symbols::getSymbolAddress+00009455
[ 3] 0x00007ffcdc4403b7 C:Program FilesMATLABR2023bbinwin64libmwfl.dll+00066487 foundation::core::diag::is_terminate_message_enabled+00000535
[ 4] 0x00007ffc891a5e6f C:Program FilesMATLABR2023bbinwin64mcr.dll+00876143 mnFullExitFcn+00036351
[ 5] 0x00007ffc891a569d C:Program FilesMATLABR2023bbinwin64mcr.dll+00874141 mnFullExitFcn+00034349
[ 6] 0x00007ffc891a1523 C:Program FilesMATLABR2023bbinwin64mcr.dll+00857379 mnFullExitFcn+00017587
[ 7] 0x00007ffc891a322f C:Program FilesMATLABR2023bbinwin64mcr.dll+00864815 mnFullExitFcn+00025023
[ 8] 0x00007ffd2aa61881 C:WINDOWSSystem32ucrtbase.dll+00465025 raise+00000481
[ 9] 0x00007ffc0d6268d3 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00747731 _kmp_get_reduce_method+00026275
[ 10] 0x00007ffc0d606a1c C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00616988 kmp_set_affinity+00005292
[ 11] 0x00007ffc0d625d2d C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00744749 _kmp_get_reduce_method+00023293
[ 12] 0x00007ffc0d612515 C:UsersusernameAppDataLocalanaconda3Librarybinlibiomp5md.dll+00664853 _kmp_acquire_nested_drdpa_lock+00021861 python, anaconda3, parpool, crash, pyrunfile MATLAB Answers — New Questions
Issues in Running VBA macros programmatically from Matlab
Hello,
When I try to open my VBA macro enabled excel directly and run the macro within excel, it works fine. However, when I try to do the same operation using Matlab script, it shoots these error messages. Does anyone has any idea?
% Test Script VBA Code access and run
ExcelApp = actxserver(‘Excel.Application’); % Create object
ExcelApp.Visible = 1; % Show window (optional).
macrobook = ExcelApp.Workbooks.Open(fullfile(‘C:Pro’,’Test.xlsm’)); % Open file
retVal = ExcelApp.Run(‘Macro1’); % Run Macro1
I have checked my macro settings in excel and they are all enabled:
I have also attached a simple macro enabled file example.Hello,
When I try to open my VBA macro enabled excel directly and run the macro within excel, it works fine. However, when I try to do the same operation using Matlab script, it shoots these error messages. Does anyone has any idea?
% Test Script VBA Code access and run
ExcelApp = actxserver(‘Excel.Application’); % Create object
ExcelApp.Visible = 1; % Show window (optional).
macrobook = ExcelApp.Workbooks.Open(fullfile(‘C:Pro’,’Test.xlsm’)); % Open file
retVal = ExcelApp.Run(‘Macro1’); % Run Macro1
I have checked my macro settings in excel and they are all enabled:
I have also attached a simple macro enabled file example. Hello,
When I try to open my VBA macro enabled excel directly and run the macro within excel, it works fine. However, when I try to do the same operation using Matlab script, it shoots these error messages. Does anyone has any idea?
% Test Script VBA Code access and run
ExcelApp = actxserver(‘Excel.Application’); % Create object
ExcelApp.Visible = 1; % Show window (optional).
macrobook = ExcelApp.Workbooks.Open(fullfile(‘C:Pro’,’Test.xlsm’)); % Open file
retVal = ExcelApp.Run(‘Macro1’); % Run Macro1
I have checked my macro settings in excel and they are all enabled:
I have also attached a simple macro enabled file example. excel, macros MATLAB Answers — New Questions
can I use custom libraries (dlls) written for matlab with Thingspeak
I have developed some custom libraries (dlls written in C++) that I call and use in analysis using desktop Matlab.
Is there a way to use these libraries with thingspeak ?
Are there any alternatives or workarounds that would serve the same purpose.I have developed some custom libraries (dlls written in C++) that I call and use in analysis using desktop Matlab.
Is there a way to use these libraries with thingspeak ?
Are there any alternatives or workarounds that would serve the same purpose. I have developed some custom libraries (dlls written in C++) that I call and use in analysis using desktop Matlab.
Is there a way to use these libraries with thingspeak ?
Are there any alternatives or workarounds that would serve the same purpose. thingspeak, custom dlls, custom libraries MATLAB Answers — New Questions
VideoReader missing codec problem
I cannot open avi files with VideoReader on my MacBook (OS Ventura 13.5) with a pretty up-to-date version of MATLAB (R2023b; 23.2.0.2365128, 64-bit). When I try to open an avi file with the following code
v = VideoReader(vidFileName.avi)
I get the following error
Error using VideoReader/initReader
Unable to determine the required codec.
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
Similarly, if I try to get information about the avi file, the code
info = mmfileinfo(vidFileName.avi)
returns the error
Unable to determine the required codec.
Some important points:
Yes, I know other people have posted similar problems. No clear solution to my problem is found there
Yes, this video file is valid and uncorrupted. It plays fine on VLC Player. It does not play on QuickTime, which does not support the avi format
Yes, I am aware that the solution might be "installing new codecs"–a solution mentioned in some other posts–but I need more information than that
Here’s the deal: The MATLAB Central "solutions" mention installing codecs from mediaplayercodecpack.com…but that only support Windows systems. I tried installing 3rd party Mac codecs from 3ivx.com, but they didn’t work. FWIW, they didn’t allow QT to play avi files either, as it was supposed to do. I know nothing about video codecs, but teh interwebs tell me they are usually stored in Library/QuickTime on Macs. Sure enough, the 3ivx installation did add "3ivxVideoCodec.component" to that folder, but again, it doesn’t work. The fact that VLC Player does work suggests that the necessary codec does exist somewhere on my Mac, but apparently MATLAB can’t use it.
In closing, I pose these fundamental questions: Doesn’t the MATLAB installation include the video codes required for the video formats VideoReader/VideoWriter supposedly supports? If yes, why am I getting this probelm? If no, where do I find the relevant codecs and how do I install them in a way that MATLAB can use?I cannot open avi files with VideoReader on my MacBook (OS Ventura 13.5) with a pretty up-to-date version of MATLAB (R2023b; 23.2.0.2365128, 64-bit). When I try to open an avi file with the following code
v = VideoReader(vidFileName.avi)
I get the following error
Error using VideoReader/initReader
Unable to determine the required codec.
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
Similarly, if I try to get information about the avi file, the code
info = mmfileinfo(vidFileName.avi)
returns the error
Unable to determine the required codec.
Some important points:
Yes, I know other people have posted similar problems. No clear solution to my problem is found there
Yes, this video file is valid and uncorrupted. It plays fine on VLC Player. It does not play on QuickTime, which does not support the avi format
Yes, I am aware that the solution might be "installing new codecs"–a solution mentioned in some other posts–but I need more information than that
Here’s the deal: The MATLAB Central "solutions" mention installing codecs from mediaplayercodecpack.com…but that only support Windows systems. I tried installing 3rd party Mac codecs from 3ivx.com, but they didn’t work. FWIW, they didn’t allow QT to play avi files either, as it was supposed to do. I know nothing about video codecs, but teh interwebs tell me they are usually stored in Library/QuickTime on Macs. Sure enough, the 3ivx installation did add "3ivxVideoCodec.component" to that folder, but again, it doesn’t work. The fact that VLC Player does work suggests that the necessary codec does exist somewhere on my Mac, but apparently MATLAB can’t use it.
In closing, I pose these fundamental questions: Doesn’t the MATLAB installation include the video codes required for the video formats VideoReader/VideoWriter supposedly supports? If yes, why am I getting this probelm? If no, where do I find the relevant codecs and how do I install them in a way that MATLAB can use? I cannot open avi files with VideoReader on my MacBook (OS Ventura 13.5) with a pretty up-to-date version of MATLAB (R2023b; 23.2.0.2365128, 64-bit). When I try to open an avi file with the following code
v = VideoReader(vidFileName.avi)
I get the following error
Error using VideoReader/initReader
Unable to determine the required codec.
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
Similarly, if I try to get information about the avi file, the code
info = mmfileinfo(vidFileName.avi)
returns the error
Unable to determine the required codec.
Some important points:
Yes, I know other people have posted similar problems. No clear solution to my problem is found there
Yes, this video file is valid and uncorrupted. It plays fine on VLC Player. It does not play on QuickTime, which does not support the avi format
Yes, I am aware that the solution might be "installing new codecs"–a solution mentioned in some other posts–but I need more information than that
Here’s the deal: The MATLAB Central "solutions" mention installing codecs from mediaplayercodecpack.com…but that only support Windows systems. I tried installing 3rd party Mac codecs from 3ivx.com, but they didn’t work. FWIW, they didn’t allow QT to play avi files either, as it was supposed to do. I know nothing about video codecs, but teh interwebs tell me they are usually stored in Library/QuickTime on Macs. Sure enough, the 3ivx installation did add "3ivxVideoCodec.component" to that folder, but again, it doesn’t work. The fact that VLC Player does work suggests that the necessary codec does exist somewhere on my Mac, but apparently MATLAB can’t use it.
In closing, I pose these fundamental questions: Doesn’t the MATLAB installation include the video codes required for the video formats VideoReader/VideoWriter supposedly supports? If yes, why am I getting this probelm? If no, where do I find the relevant codecs and how do I install them in a way that MATLAB can use? video, codec, mac, matlab MATLAB Answers — New Questions
Efficient management of interacting atoms based on their mutual distance
Dear all
Currently, I am dealing with a dataset, which I attach here in the "File.txt", file, where the first column is an atomic label ranging from 0 to 95900 (that it is, to the number of atoms-1). Each row represents the spatial coordinates of each i-th atom of the system, denoting the second, third, and fourth columns the coordinate values, in Angstroms, along x-, y-, and z-th directions. It is important to note that the fourth column, that it is, the z-th spatial coordinate, only can have two different values, 3.27645 and 9.82515. So basically, I have two monolayers at two different heights.
My goal is, for each atom, to loop over the first ten nearest interlayer atoms. That it is, for the i-th atom, to loop over the atoms with the lowest deviations in the xy plane from (xi,yi) and with different value of the z-th component. Importantly, if, for example, during the looping one founds that atom with id 4 and 560 have in common the atom with 1100 as one of the ten nearest neighbors to them, it would be very desirable that when looping in for 1100, the program knows, from the previous calculations, that atoms with label 4 and 560 are indeed two of the ten nearest neighbors to 1100.
I had in mind something like:
file=readmatrix(‘File.txt’);
counter=0;
for i=1:length(file(:,1))
indices=file(file(:,4)~=file(i,4));
atoms=file(indices,1:3);
for j=1:length(indices)
distances(j)=norm(atoms(j,2:3)-file(i,2:3)); % Angstroms
end
sorted_distances=unique(distances); % Angstroms
interacting_distances=sorted_distances(1:10); % Angstroms
interacting_atoms=find(distances<=max(interacting_distances));
for j=1:length(interacting_atoms(:,1))
counter=counter+1;
interaction_list(counter,1)=file(i,1); % i-th atom id
interaction_list(counter,2)=interacting_atoms(j,1); % j-th atom id
interaction_list(counter,3)=somevalue;
end
clear indices distances sorted_distances interacting_distances interacting_atoms
end
Obviously, this approach does not seem to be very fast/efficient. Also, this won’t meet one of the requirements I explained above: that if one finds that i-th atom interacts with j-th atom, one knows that j-th atom interacts with i-th atom (double counting). In that case, I would need to save in the interaction_list(counter,3)=-somevalue.
Any idea?Dear all
Currently, I am dealing with a dataset, which I attach here in the "File.txt", file, where the first column is an atomic label ranging from 0 to 95900 (that it is, to the number of atoms-1). Each row represents the spatial coordinates of each i-th atom of the system, denoting the second, third, and fourth columns the coordinate values, in Angstroms, along x-, y-, and z-th directions. It is important to note that the fourth column, that it is, the z-th spatial coordinate, only can have two different values, 3.27645 and 9.82515. So basically, I have two monolayers at two different heights.
My goal is, for each atom, to loop over the first ten nearest interlayer atoms. That it is, for the i-th atom, to loop over the atoms with the lowest deviations in the xy plane from (xi,yi) and with different value of the z-th component. Importantly, if, for example, during the looping one founds that atom with id 4 and 560 have in common the atom with 1100 as one of the ten nearest neighbors to them, it would be very desirable that when looping in for 1100, the program knows, from the previous calculations, that atoms with label 4 and 560 are indeed two of the ten nearest neighbors to 1100.
I had in mind something like:
file=readmatrix(‘File.txt’);
counter=0;
for i=1:length(file(:,1))
indices=file(file(:,4)~=file(i,4));
atoms=file(indices,1:3);
for j=1:length(indices)
distances(j)=norm(atoms(j,2:3)-file(i,2:3)); % Angstroms
end
sorted_distances=unique(distances); % Angstroms
interacting_distances=sorted_distances(1:10); % Angstroms
interacting_atoms=find(distances<=max(interacting_distances));
for j=1:length(interacting_atoms(:,1))
counter=counter+1;
interaction_list(counter,1)=file(i,1); % i-th atom id
interaction_list(counter,2)=interacting_atoms(j,1); % j-th atom id
interaction_list(counter,3)=somevalue;
end
clear indices distances sorted_distances interacting_distances interacting_atoms
end
Obviously, this approach does not seem to be very fast/efficient. Also, this won’t meet one of the requirements I explained above: that if one finds that i-th atom interacts with j-th atom, one knows that j-th atom interacts with i-th atom (double counting). In that case, I would need to save in the interaction_list(counter,3)=-somevalue.
Any idea? Dear all
Currently, I am dealing with a dataset, which I attach here in the "File.txt", file, where the first column is an atomic label ranging from 0 to 95900 (that it is, to the number of atoms-1). Each row represents the spatial coordinates of each i-th atom of the system, denoting the second, third, and fourth columns the coordinate values, in Angstroms, along x-, y-, and z-th directions. It is important to note that the fourth column, that it is, the z-th spatial coordinate, only can have two different values, 3.27645 and 9.82515. So basically, I have two monolayers at two different heights.
My goal is, for each atom, to loop over the first ten nearest interlayer atoms. That it is, for the i-th atom, to loop over the atoms with the lowest deviations in the xy plane from (xi,yi) and with different value of the z-th component. Importantly, if, for example, during the looping one founds that atom with id 4 and 560 have in common the atom with 1100 as one of the ten nearest neighbors to them, it would be very desirable that when looping in for 1100, the program knows, from the previous calculations, that atoms with label 4 and 560 are indeed two of the ten nearest neighbors to 1100.
I had in mind something like:
file=readmatrix(‘File.txt’);
counter=0;
for i=1:length(file(:,1))
indices=file(file(:,4)~=file(i,4));
atoms=file(indices,1:3);
for j=1:length(indices)
distances(j)=norm(atoms(j,2:3)-file(i,2:3)); % Angstroms
end
sorted_distances=unique(distances); % Angstroms
interacting_distances=sorted_distances(1:10); % Angstroms
interacting_atoms=find(distances<=max(interacting_distances));
for j=1:length(interacting_atoms(:,1))
counter=counter+1;
interaction_list(counter,1)=file(i,1); % i-th atom id
interaction_list(counter,2)=interacting_atoms(j,1); % j-th atom id
interaction_list(counter,3)=somevalue;
end
clear indices distances sorted_distances interacting_distances interacting_atoms
end
Obviously, this approach does not seem to be very fast/efficient. Also, this won’t meet one of the requirements I explained above: that if one finds that i-th atom interacts with j-th atom, one knows that j-th atom interacts with i-th atom (double counting). In that case, I would need to save in the interaction_list(counter,3)=-somevalue.
Any idea? fast and efficient double counting of data MATLAB Answers — New Questions
See also … blocks viewing of answer
I’m trying to see an answer that includes a screenshot apparently. The See Also pane is blocking much of the screen so I can’t see what I need to see. How do I dismiss this part I don’t need?I’m trying to see an answer that includes a screenshot apparently. The See Also pane is blocking much of the screen so I can’t see what I need to see. How do I dismiss this part I don’t need? I’m trying to see an answer that includes a screenshot apparently. The See Also pane is blocking much of the screen so I can’t see what I need to see. How do I dismiss this part I don’t need? dismiss see also MATLAB Answers — New Questions
Path Following Algorithm Line-Circle Path Path Switching Problem
Hi everyone ,
I’m trying to implement a path following algorithm for UAV (Carrot Chase) with matlab for a line-circle path.
I have already implemented the algorithm for straight line and the loiter separately and this codes are work fine. But, since they are geometrically different shapes, they have different algorithms. So we need to switch algorithms when switching between these two shapes if we want to follow this two shapes together . And i added a algorithm for that but i think it’s not working
i have a variable for that named as " guidance index". You can see this variable at the begginning of the code. When i enter this variable 1 the UAV will follow the straight line path firstly. But if i enter this variable 2, the UAV will follow the circle firstly.
You can see this in the files I attached. But the real problem starts here. After the straight line path ends, it does not follow the circular path but goes out of the path. Likewise, when I set the guidance_index variable to 2, it follows the circle path correctly, but this time it does not continue with the straight line path.
How can i fix it ?
Thanks a lot.
Best RegardsHi everyone ,
I’m trying to implement a path following algorithm for UAV (Carrot Chase) with matlab for a line-circle path.
I have already implemented the algorithm for straight line and the loiter separately and this codes are work fine. But, since they are geometrically different shapes, they have different algorithms. So we need to switch algorithms when switching between these two shapes if we want to follow this two shapes together . And i added a algorithm for that but i think it’s not working
i have a variable for that named as " guidance index". You can see this variable at the begginning of the code. When i enter this variable 1 the UAV will follow the straight line path firstly. But if i enter this variable 2, the UAV will follow the circle firstly.
You can see this in the files I attached. But the real problem starts here. After the straight line path ends, it does not follow the circular path but goes out of the path. Likewise, when I set the guidance_index variable to 2, it follows the circle path correctly, but this time it does not continue with the straight line path.
How can i fix it ?
Thanks a lot.
Best Regards Hi everyone ,
I’m trying to implement a path following algorithm for UAV (Carrot Chase) with matlab for a line-circle path.
I have already implemented the algorithm for straight line and the loiter separately and this codes are work fine. But, since they are geometrically different shapes, they have different algorithms. So we need to switch algorithms when switching between these two shapes if we want to follow this two shapes together . And i added a algorithm for that but i think it’s not working
i have a variable for that named as " guidance index". You can see this variable at the begginning of the code. When i enter this variable 1 the UAV will follow the straight line path firstly. But if i enter this variable 2, the UAV will follow the circle firstly.
You can see this in the files I attached. But the real problem starts here. After the straight line path ends, it does not follow the circular path but goes out of the path. Likewise, when I set the guidance_index variable to 2, it follows the circle path correctly, but this time it does not continue with the straight line path.
How can i fix it ?
Thanks a lot.
Best Regards matlab, path following, uav MATLAB Answers — New Questions
Setting unknown constants in equation for known data
I have data of points and equation with 3 unknown constants.I want to finds the constants that will give me the values of the data how can i do that ?I have data of points and equation with 3 unknown constants.I want to finds the constants that will give me the values of the data how can i do that ? I have data of points and equation with 3 unknown constants.I want to finds the constants that will give me the values of the data how can i do that ? adjust, equation, constants MATLAB Answers — New Questions
I am having trouble understanding this error “To assign to or create a variable in a table, the number of rows must match the height of the table.”, can someone explain?
As stated in the title, I’m struggling with getting rid of error message "To assign to or create a variable in a table, the number of rows must match the height of the table."
Here is a snippit of my original code. The line specifically causing hte probled is the line within the For loop. Sorry if this is a simple question, I do not usually work MATLAB and got thrown into this project. Thank you!
units_tbl(1,:)
values_tbl_new = vertcat(units_tbl(1,:),values_tbl);
for k = 1:length(vars_wanted)
values_tbl_new.(vars_wanted(k)) = values_tbl.(vars_wanted(k));
endAs stated in the title, I’m struggling with getting rid of error message "To assign to or create a variable in a table, the number of rows must match the height of the table."
Here is a snippit of my original code. The line specifically causing hte probled is the line within the For loop. Sorry if this is a simple question, I do not usually work MATLAB and got thrown into this project. Thank you!
units_tbl(1,:)
values_tbl_new = vertcat(units_tbl(1,:),values_tbl);
for k = 1:length(vars_wanted)
values_tbl_new.(vars_wanted(k)) = values_tbl.(vars_wanted(k));
end As stated in the title, I’m struggling with getting rid of error message "To assign to or create a variable in a table, the number of rows must match the height of the table."
Here is a snippit of my original code. The line specifically causing hte probled is the line within the For loop. Sorry if this is a simple question, I do not usually work MATLAB and got thrown into this project. Thank you!
units_tbl(1,:)
values_tbl_new = vertcat(units_tbl(1,:),values_tbl);
for k = 1:length(vars_wanted)
values_tbl_new.(vars_wanted(k)) = values_tbl.(vars_wanted(k));
end matlab MATLAB Answers — New Questions