Category: Matlab
Category Archives: Matlab
How to estimate the temperature from a Boltzmann distribution, given only the mass, number of molecules, and area under the curve for three speed regions?
I have the mass, number of molecules, and area under the curve for three speed regions of a gas following the Boltzmann distribution. How can I estimate the temperature using this information?I have the mass, number of molecules, and area under the curve for three speed regions of a gas following the Boltzmann distribution. How can I estimate the temperature using this information? I have the mass, number of molecules, and area under the curve for three speed regions of a gas following the Boltzmann distribution. How can I estimate the temperature using this information? matlab, help, mathematics MATLAB Answers — New Questions
Different Output value of Functions
function f_value = test_function(Solution)
% Beale function test functions
Implementation 1
x=Solution(1);
y=Solution(2);
f_value = (1.5- x+ x*y)^2 + (2.25 – x + x*y^2)^2 + (2.625 -x + x*y^2)^2;
% Optimal at f(3,0.5) = 0
%% Implementation 2
% x1 = Solution(1);
% x2 = Solution(2);
%
% term1 = (1.5 – x1 + x1*x2)^2;
% term2 = (2.25 – x1 + x1*x2^2)^2;
% term3 = (2.625 – x1 + x1*x2^3)^2;
%
% f_value = term1 + term2 + term3;
end
Hi, I have a test function for testing my optimization algorithm. These two implementations are same but they are generating different f_value for the same solution value. For example. for Solution [-3.3381,0.1668], Implementation1 generates f_value of 82.9832 whereas Imp2 generates 83.8981. I am unable to find the reason. This small difference is making huge difference and with imp1. Optimization algorithm doesnot converge to global solution. However, with imp2 it converges to global solution. Any help would be appreciated.function f_value = test_function(Solution)
% Beale function test functions
Implementation 1
x=Solution(1);
y=Solution(2);
f_value = (1.5- x+ x*y)^2 + (2.25 – x + x*y^2)^2 + (2.625 -x + x*y^2)^2;
% Optimal at f(3,0.5) = 0
%% Implementation 2
% x1 = Solution(1);
% x2 = Solution(2);
%
% term1 = (1.5 – x1 + x1*x2)^2;
% term2 = (2.25 – x1 + x1*x2^2)^2;
% term3 = (2.625 – x1 + x1*x2^3)^2;
%
% f_value = term1 + term2 + term3;
end
Hi, I have a test function for testing my optimization algorithm. These two implementations are same but they are generating different f_value for the same solution value. For example. for Solution [-3.3381,0.1668], Implementation1 generates f_value of 82.9832 whereas Imp2 generates 83.8981. I am unable to find the reason. This small difference is making huge difference and with imp1. Optimization algorithm doesnot converge to global solution. However, with imp2 it converges to global solution. Any help would be appreciated. function f_value = test_function(Solution)
% Beale function test functions
Implementation 1
x=Solution(1);
y=Solution(2);
f_value = (1.5- x+ x*y)^2 + (2.25 – x + x*y^2)^2 + (2.625 -x + x*y^2)^2;
% Optimal at f(3,0.5) = 0
%% Implementation 2
% x1 = Solution(1);
% x2 = Solution(2);
%
% term1 = (1.5 – x1 + x1*x2)^2;
% term2 = (2.25 – x1 + x1*x2^2)^2;
% term3 = (2.625 – x1 + x1*x2^3)^2;
%
% f_value = term1 + term2 + term3;
end
Hi, I have a test function for testing my optimization algorithm. These two implementations are same but they are generating different f_value for the same solution value. For example. for Solution [-3.3381,0.1668], Implementation1 generates f_value of 82.9832 whereas Imp2 generates 83.8981. I am unable to find the reason. This small difference is making huge difference and with imp1. Optimization algorithm doesnot converge to global solution. However, with imp2 it converges to global solution. Any help would be appreciated. function value, different output MATLAB Answers — New Questions
species go to negative values
Hi
I developed a model in Simbiology simulating the effect of a drug on a tissue mass. Sometime, I received a message that the integration toerance does not met and other times I had a mass species with negative values.Why does the software allow the value of a species representing the mass of this tissue go to negative values? what is the cause of this issue and how can I solve it? I want the content of this species to go as small as it can go without jumping to negative values.
Thank youHi
I developed a model in Simbiology simulating the effect of a drug on a tissue mass. Sometime, I received a message that the integration toerance does not met and other times I had a mass species with negative values.Why does the software allow the value of a species representing the mass of this tissue go to negative values? what is the cause of this issue and how can I solve it? I want the content of this species to go as small as it can go without jumping to negative values.
Thank you Hi
I developed a model in Simbiology simulating the effect of a drug on a tissue mass. Sometime, I received a message that the integration toerance does not met and other times I had a mass species with negative values.Why does the software allow the value of a species representing the mass of this tissue go to negative values? what is the cause of this issue and how can I solve it? I want the content of this species to go as small as it can go without jumping to negative values.
Thank you negative species, simbiology MATLAB Answers — New Questions
Add duration object to datetime object to get new datetime object
I’m reading a text file that looks like this:
2024-05-11 00:34:35 1.2 sta/lta 2.0 8.0 3.5 2.5 max 363.3 rms 127.2 id: L MSS1
2024-05-11 01:19:32 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1126.7 rms 328.4 id: t MSS1
2024-05-11 01:30:10 1.7 sta/lta 2.0 8.0 3.5 2.5 max 597.3 rms 162.4 id: t MSS1
2024-05-11 04:52:52 2.7 sta/lta 2.0 8.0 3.5 2.5 max 2516.3 rms 657.6 id: t MSS1
2024-05-11 07:14:16 2.3 sta/lta 2.0 8.0 3.5 2.5 max 2644.7 rms 626.9 id: t MSS1
2024-05-11 09:45:07 1.9 sta/lta 2.0 8.0 3.5 2.5 max 1768.3 rms 558.0 id: u MSS1
2024-05-11 19:44:04 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1027.7 rms 229.0 id: r MSS1
I use readtable, and it returns this:
>> A = readtable( fileTriggerIDs )
A =
7×15 table
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11 Var12 Var13 Var14 Var15
__________ ________ ____ ___________ ____ ____ ____ ____ _______ ______ _______ _____ _______ _____ ________
11/05/2024 00:34:35 1.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 363.3 {‘rms’} 127.2 {‘id:’} {‘L’} {‘MSS1’}
11/05/2024 01:19:32 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1126.7 {‘rms’} 328.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 01:30:10 1.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 597.3 {‘rms’} 162.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 04:52:52 2.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2516.3 {‘rms’} 657.6 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 07:14:16 2.3 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2644.7 {‘rms’} 626.9 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 09:45:07 1.9 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1768.3 {‘rms’} 558 {‘id:’} {‘u’} {‘MSS1’}
11/05/2024 19:44:04 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1027.7 {‘rms’} 229 {‘id:’} {‘r’} {‘MSS1’}
A.Var1 is a datetime array and A.Var2 is a duration array.
How do I combine them to get one datetime array?
I tried adding them, but the results are nonsense:
>> A.Var1 + A.Var2
ans =
7×1 datetime array
2024-05-11 12:34:35
2024-05-11 01:19:32
2024-05-11 01:30:10
2024-05-11 04:52:52
2024-05-11 07:14:16
2024-05-11 09:45:07
2024-05-11 07:44:04I’m reading a text file that looks like this:
2024-05-11 00:34:35 1.2 sta/lta 2.0 8.0 3.5 2.5 max 363.3 rms 127.2 id: L MSS1
2024-05-11 01:19:32 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1126.7 rms 328.4 id: t MSS1
2024-05-11 01:30:10 1.7 sta/lta 2.0 8.0 3.5 2.5 max 597.3 rms 162.4 id: t MSS1
2024-05-11 04:52:52 2.7 sta/lta 2.0 8.0 3.5 2.5 max 2516.3 rms 657.6 id: t MSS1
2024-05-11 07:14:16 2.3 sta/lta 2.0 8.0 3.5 2.5 max 2644.7 rms 626.9 id: t MSS1
2024-05-11 09:45:07 1.9 sta/lta 2.0 8.0 3.5 2.5 max 1768.3 rms 558.0 id: u MSS1
2024-05-11 19:44:04 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1027.7 rms 229.0 id: r MSS1
I use readtable, and it returns this:
>> A = readtable( fileTriggerIDs )
A =
7×15 table
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11 Var12 Var13 Var14 Var15
__________ ________ ____ ___________ ____ ____ ____ ____ _______ ______ _______ _____ _______ _____ ________
11/05/2024 00:34:35 1.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 363.3 {‘rms’} 127.2 {‘id:’} {‘L’} {‘MSS1’}
11/05/2024 01:19:32 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1126.7 {‘rms’} 328.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 01:30:10 1.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 597.3 {‘rms’} 162.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 04:52:52 2.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2516.3 {‘rms’} 657.6 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 07:14:16 2.3 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2644.7 {‘rms’} 626.9 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 09:45:07 1.9 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1768.3 {‘rms’} 558 {‘id:’} {‘u’} {‘MSS1’}
11/05/2024 19:44:04 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1027.7 {‘rms’} 229 {‘id:’} {‘r’} {‘MSS1’}
A.Var1 is a datetime array and A.Var2 is a duration array.
How do I combine them to get one datetime array?
I tried adding them, but the results are nonsense:
>> A.Var1 + A.Var2
ans =
7×1 datetime array
2024-05-11 12:34:35
2024-05-11 01:19:32
2024-05-11 01:30:10
2024-05-11 04:52:52
2024-05-11 07:14:16
2024-05-11 09:45:07
2024-05-11 07:44:04 I’m reading a text file that looks like this:
2024-05-11 00:34:35 1.2 sta/lta 2.0 8.0 3.5 2.5 max 363.3 rms 127.2 id: L MSS1
2024-05-11 01:19:32 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1126.7 rms 328.4 id: t MSS1
2024-05-11 01:30:10 1.7 sta/lta 2.0 8.0 3.5 2.5 max 597.3 rms 162.4 id: t MSS1
2024-05-11 04:52:52 2.7 sta/lta 2.0 8.0 3.5 2.5 max 2516.3 rms 657.6 id: t MSS1
2024-05-11 07:14:16 2.3 sta/lta 2.0 8.0 3.5 2.5 max 2644.7 rms 626.9 id: t MSS1
2024-05-11 09:45:07 1.9 sta/lta 2.0 8.0 3.5 2.5 max 1768.3 rms 558.0 id: u MSS1
2024-05-11 19:44:04 2.2 sta/lta 2.0 8.0 3.5 2.5 max 1027.7 rms 229.0 id: r MSS1
I use readtable, and it returns this:
>> A = readtable( fileTriggerIDs )
A =
7×15 table
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10 Var11 Var12 Var13 Var14 Var15
__________ ________ ____ ___________ ____ ____ ____ ____ _______ ______ _______ _____ _______ _____ ________
11/05/2024 00:34:35 1.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 363.3 {‘rms’} 127.2 {‘id:’} {‘L’} {‘MSS1’}
11/05/2024 01:19:32 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1126.7 {‘rms’} 328.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 01:30:10 1.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 597.3 {‘rms’} 162.4 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 04:52:52 2.7 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2516.3 {‘rms’} 657.6 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 07:14:16 2.3 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 2644.7 {‘rms’} 626.9 {‘id:’} {‘t’} {‘MSS1’}
11/05/2024 09:45:07 1.9 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1768.3 {‘rms’} 558 {‘id:’} {‘u’} {‘MSS1’}
11/05/2024 19:44:04 2.2 {‘sta/lta’} 2 8 3.5 2.5 {‘max’} 1027.7 {‘rms’} 229 {‘id:’} {‘r’} {‘MSS1’}
A.Var1 is a datetime array and A.Var2 is a duration array.
How do I combine them to get one datetime array?
I tried adding them, but the results are nonsense:
>> A.Var1 + A.Var2
ans =
7×1 datetime array
2024-05-11 12:34:35
2024-05-11 01:19:32
2024-05-11 01:30:10
2024-05-11 04:52:52
2024-05-11 07:14:16
2024-05-11 09:45:07
2024-05-11 07:44:04 datetime, duration MATLAB Answers — New Questions
Can sqlite not search in the project path?
I have a sqlite database, say "filename.db", in a local folder (MacOS). The folder is then added to my project path. However, sqlite can find it with absolute path, but not with filename. Can sqlite not search in the project path?
% works
conn = sqlite(full_absolute_path/"filename.db", "connect")
% Error: database not found
conn = sqlite("filename.db", "connect")I have a sqlite database, say "filename.db", in a local folder (MacOS). The folder is then added to my project path. However, sqlite can find it with absolute path, but not with filename. Can sqlite not search in the project path?
% works
conn = sqlite(full_absolute_path/"filename.db", "connect")
% Error: database not found
conn = sqlite("filename.db", "connect") I have a sqlite database, say "filename.db", in a local folder (MacOS). The folder is then added to my project path. However, sqlite can find it with absolute path, but not with filename. Can sqlite not search in the project path?
% works
conn = sqlite(full_absolute_path/"filename.db", "connect")
% Error: database not found
conn = sqlite("filename.db", "connect") sqlite, project, path MATLAB Answers — New Questions
I’m experiencing matlab crashes on my model how do I find out the cause?
I have a rather complex simulink model that uses simevents, I created a block that saves the packets (simevents entities) in the matlab workspace, this is done by calling a simulink function with a toWorkspace block inside it.
The problem is that by inserting one of these blocks into the model everything works correctly, but if I insert 2 matlab freezes and then closes without showing any error message. It’s not a "same name in the toWorkspace block" issue because it would give me a compilation error and instead it starts simulating and then crash.
The most absurd thing is that by creating a very simplified model I managed to make these 2 blocks work correctly but in the large model I’m working on it doesn’t work. However, by removing the part related to saving in the workspace there are no problems.I have a rather complex simulink model that uses simevents, I created a block that saves the packets (simevents entities) in the matlab workspace, this is done by calling a simulink function with a toWorkspace block inside it.
The problem is that by inserting one of these blocks into the model everything works correctly, but if I insert 2 matlab freezes and then closes without showing any error message. It’s not a "same name in the toWorkspace block" issue because it would give me a compilation error and instead it starts simulating and then crash.
The most absurd thing is that by creating a very simplified model I managed to make these 2 blocks work correctly but in the large model I’m working on it doesn’t work. However, by removing the part related to saving in the workspace there are no problems. I have a rather complex simulink model that uses simevents, I created a block that saves the packets (simevents entities) in the matlab workspace, this is done by calling a simulink function with a toWorkspace block inside it.
The problem is that by inserting one of these blocks into the model everything works correctly, but if I insert 2 matlab freezes and then closes without showing any error message. It’s not a "same name in the toWorkspace block" issue because it would give me a compilation error and instead it starts simulating and then crash.
The most absurd thing is that by creating a very simplified model I managed to make these 2 blocks work correctly but in the large model I’m working on it doesn’t work. However, by removing the part related to saving in the workspace there are no problems. simulink, crash, simevent, workspace MATLAB Answers — New Questions
How to remove Reset Zoom keyboard shortcut?
The keyboard shortcut for "Reset Zoom" is the same as for my close brakets key (}), which means I can never place curly brackets on my live scripts. I tried to go in the settings, but, for some reason, there isn’t an option to change or remove this shortcut. How can I change this setting otherwise?The keyboard shortcut for "Reset Zoom" is the same as for my close brakets key (}), which means I can never place curly brackets on my live scripts. I tried to go in the settings, but, for some reason, there isn’t an option to change or remove this shortcut. How can I change this setting otherwise? The keyboard shortcut for "Reset Zoom" is the same as for my close brakets key (}), which means I can never place curly brackets on my live scripts. I tried to go in the settings, but, for some reason, there isn’t an option to change or remove this shortcut. How can I change this setting otherwise? zoom, reset zoom, matlab, settings, curly braces, braces, brackets, curly brackets MATLAB Answers — New Questions
pulling non-consistent arrays out of a structure
Hello, I am trying to pull out arrays from a structure previously defined in my code to then find the median behavior, so I can plot alongside my individual object’s behaviors. The overall goal is to track median behavior of all obects over the time of the experiment.
Let me create an example via words, as I do not know how to recapitulate via code. Object 1-5 were detected over the whole length of the experiment, so they have all data points. Object 6-9 had varying degrees of detection, but were detected for more than 70% of the experiment, and so are considered ‘tracked well enough to retain’.
The problem is when attempting horzcat or any way to pull data out of the structure, due to the inconsistent size, matlab has an error. The overall idea I have to use a ‘full detection’ object to compare all other objects to, and if an image frame wasn’t found in the array of a certain object, to fill the row that should have been that with NaN. Then all arrays would be consistent, and I could pull them out of their individual sections within the structure to then collectively median.
While I don’t know how to do most of that, attached is the structure, and what I would like to do with the structure once the NaN is inserted into different objects. If there is a better or more efficient way to do this, perhaps without even inserting the NaN, please let me know!!
load ‘DataStruct.mat’
% Note that Data.m was used to contruct two different populations, Data.PC3
% and .MDA, disregard Data.m at this point
%once NaN inserted, separate x and y of each object within the structure
%for easier extraction
idxPC3 =
5 6 7 8 9
for i = 1:length(idxPC3)
for j = 1:length(Data.m{idxPC3(i)}.n)
if i== 1
Data.PC3.x = Data.m{idxPC3(i)}.n{1,j}(:,1);
Data.PC3.y = Data.m{idxPC3(i)}.n{1,j}(:,2);
else
Data.PC3.x = horzcat(Data.PC3.x, Data.m{idxPC3(i)}.n{1,j}(:,1));
Data.PC3.y = horzcat(Data.PC3.y, Data.m{idxPC3(i)}.n{1,j}(:,2));
end
end
end
MedPC3= median(Data.PC3.y, 2) %the median,2 is used for median behavior across time points, not at the median time point
plot(Data.PC3.x, MedPC3) %plot the median behavior with respect to time (x data points)Hello, I am trying to pull out arrays from a structure previously defined in my code to then find the median behavior, so I can plot alongside my individual object’s behaviors. The overall goal is to track median behavior of all obects over the time of the experiment.
Let me create an example via words, as I do not know how to recapitulate via code. Object 1-5 were detected over the whole length of the experiment, so they have all data points. Object 6-9 had varying degrees of detection, but were detected for more than 70% of the experiment, and so are considered ‘tracked well enough to retain’.
The problem is when attempting horzcat or any way to pull data out of the structure, due to the inconsistent size, matlab has an error. The overall idea I have to use a ‘full detection’ object to compare all other objects to, and if an image frame wasn’t found in the array of a certain object, to fill the row that should have been that with NaN. Then all arrays would be consistent, and I could pull them out of their individual sections within the structure to then collectively median.
While I don’t know how to do most of that, attached is the structure, and what I would like to do with the structure once the NaN is inserted into different objects. If there is a better or more efficient way to do this, perhaps without even inserting the NaN, please let me know!!
load ‘DataStruct.mat’
% Note that Data.m was used to contruct two different populations, Data.PC3
% and .MDA, disregard Data.m at this point
%once NaN inserted, separate x and y of each object within the structure
%for easier extraction
idxPC3 =
5 6 7 8 9
for i = 1:length(idxPC3)
for j = 1:length(Data.m{idxPC3(i)}.n)
if i== 1
Data.PC3.x = Data.m{idxPC3(i)}.n{1,j}(:,1);
Data.PC3.y = Data.m{idxPC3(i)}.n{1,j}(:,2);
else
Data.PC3.x = horzcat(Data.PC3.x, Data.m{idxPC3(i)}.n{1,j}(:,1));
Data.PC3.y = horzcat(Data.PC3.y, Data.m{idxPC3(i)}.n{1,j}(:,2));
end
end
end
MedPC3= median(Data.PC3.y, 2) %the median,2 is used for median behavior across time points, not at the median time point
plot(Data.PC3.x, MedPC3) %plot the median behavior with respect to time (x data points) Hello, I am trying to pull out arrays from a structure previously defined in my code to then find the median behavior, so I can plot alongside my individual object’s behaviors. The overall goal is to track median behavior of all obects over the time of the experiment.
Let me create an example via words, as I do not know how to recapitulate via code. Object 1-5 were detected over the whole length of the experiment, so they have all data points. Object 6-9 had varying degrees of detection, but were detected for more than 70% of the experiment, and so are considered ‘tracked well enough to retain’.
The problem is when attempting horzcat or any way to pull data out of the structure, due to the inconsistent size, matlab has an error. The overall idea I have to use a ‘full detection’ object to compare all other objects to, and if an image frame wasn’t found in the array of a certain object, to fill the row that should have been that with NaN. Then all arrays would be consistent, and I could pull them out of their individual sections within the structure to then collectively median.
While I don’t know how to do most of that, attached is the structure, and what I would like to do with the structure once the NaN is inserted into different objects. If there is a better or more efficient way to do this, perhaps without even inserting the NaN, please let me know!!
load ‘DataStruct.mat’
% Note that Data.m was used to contruct two different populations, Data.PC3
% and .MDA, disregard Data.m at this point
%once NaN inserted, separate x and y of each object within the structure
%for easier extraction
idxPC3 =
5 6 7 8 9
for i = 1:length(idxPC3)
for j = 1:length(Data.m{idxPC3(i)}.n)
if i== 1
Data.PC3.x = Data.m{idxPC3(i)}.n{1,j}(:,1);
Data.PC3.y = Data.m{idxPC3(i)}.n{1,j}(:,2);
else
Data.PC3.x = horzcat(Data.PC3.x, Data.m{idxPC3(i)}.n{1,j}(:,1));
Data.PC3.y = horzcat(Data.PC3.y, Data.m{idxPC3(i)}.n{1,j}(:,2));
end
end
end
MedPC3= median(Data.PC3.y, 2) %the median,2 is used for median behavior across time points, not at the median time point
plot(Data.PC3.x, MedPC3) %plot the median behavior with respect to time (x data points) structures MATLAB Answers — New Questions
How do you convert a surf object to an isosurface?
How to convert a regular surf surface (rectangular mesh) to a patch isosurface (triangular mesh)?
I have seen how to go the other direction, but this one eludes me. After creating the isosurface, I need to run inpolyhedron() to see if points are inside or outside the object.
theta = (pi:0.1:pi);
phi = 0:0.1:pi);
[THETA, PHI] = meshgrid(theta, phi);
x = cos(THETA).* sin(PHI);
y = sin(THETA).*sin(PHI);
z = cos(PHI;
ellipsoid = surf(x,y,z);
(Extract the isosurface from the ellipsoid…)
fv = isosurface(something something …)
pts = rand(5,3);
in = inpolyhedron(fv,pts); % check if points are inside or outside objectHow to convert a regular surf surface (rectangular mesh) to a patch isosurface (triangular mesh)?
I have seen how to go the other direction, but this one eludes me. After creating the isosurface, I need to run inpolyhedron() to see if points are inside or outside the object.
theta = (pi:0.1:pi);
phi = 0:0.1:pi);
[THETA, PHI] = meshgrid(theta, phi);
x = cos(THETA).* sin(PHI);
y = sin(THETA).*sin(PHI);
z = cos(PHI;
ellipsoid = surf(x,y,z);
(Extract the isosurface from the ellipsoid…)
fv = isosurface(something something …)
pts = rand(5,3);
in = inpolyhedron(fv,pts); % check if points are inside or outside object How to convert a regular surf surface (rectangular mesh) to a patch isosurface (triangular mesh)?
I have seen how to go the other direction, but this one eludes me. After creating the isosurface, I need to run inpolyhedron() to see if points are inside or outside the object.
theta = (pi:0.1:pi);
phi = 0:0.1:pi);
[THETA, PHI] = meshgrid(theta, phi);
x = cos(THETA).* sin(PHI);
y = sin(THETA).*sin(PHI);
z = cos(PHI;
ellipsoid = surf(x,y,z);
(Extract the isosurface from the ellipsoid…)
fv = isosurface(something something …)
pts = rand(5,3);
in = inpolyhedron(fv,pts); % check if points are inside or outside object isosurface, meshgrid, inpolyhedron, surf MATLAB Answers — New Questions
Regrid netcdf file using weighted average method
How can we regrid netcdf file in matlab? I found out in Python it is easy to regrid 3-dimensional data using xarray or xesmf but it seems not easy to regrid regrid 3-D netcdf in matlab? I want to resample a netcdf data from 0.25 degree to 1 degree. I want to use the the weighted average of all non-NODATA contributing pixels. How can I do this in Matlab? Is there a good function for resampling gridded datasets in matlab using different resampling methods?How can we regrid netcdf file in matlab? I found out in Python it is easy to regrid 3-dimensional data using xarray or xesmf but it seems not easy to regrid regrid 3-D netcdf in matlab? I want to resample a netcdf data from 0.25 degree to 1 degree. I want to use the the weighted average of all non-NODATA contributing pixels. How can I do this in Matlab? Is there a good function for resampling gridded datasets in matlab using different resampling methods? How can we regrid netcdf file in matlab? I found out in Python it is easy to regrid 3-dimensional data using xarray or xesmf but it seems not easy to regrid regrid 3-D netcdf in matlab? I want to resample a netcdf data from 0.25 degree to 1 degree. I want to use the the weighted average of all non-NODATA contributing pixels. How can I do this in Matlab? Is there a good function for resampling gridded datasets in matlab using different resampling methods? netcdf, regrid, resample MATLAB Answers — New Questions
Why the codes detects the binary image wrong?
Hello all. Why the codes detects the binary image the wrong one? Below I attach the codes, and sample of my data.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
%===============================================================================
% Read in gray scale demo image.
rgbImage = imread(‘1_245.jpg’);
% Get the dimensions of the image.
% numberOfColorChannels should be = 1 for a gray scale image, and 3 for an RGB color image.
[rows, columns, numberOfColorChannels] = size(rgbImage)
if numberOfColorChannels > 1
% It’s not really gray scale like we expected – it’s color.
% Use weighted sum of ALL channels to create a gray scale image.
% grayImage = rgb2gray(rgbImage);
% ALTERNATE METHOD: Convert it to gray scale by taking only the green channel,
% which in a typical snapshot will be the least noisy channel.
grayImage = rgbImage(:, :, 2); % Take green channel.
else
grayImage = rgbImage; % It’s already gray scale.
end
% Now it’s gray scale with range of 0 to 255.
% Display the image.
subplot(2, 3, 1);
imshow(grayImage, []);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
%——————————————————————————
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]);
% Get rid of tool bar and pulldown menus that are along top of figure.
% set(gcf, ‘Toolbar’, ‘none’, ‘Menu’, ‘none’);
% Give a name to the title bar.
set(gcf, ‘Name’, ‘Demo by ImageAnalyst’, ‘NumberTitle’, ‘Off’)
drawnow;
% Show the histogram
subplot(2, 3, 2);
[counts, grayLevels] = histcounts(grayImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Median Filter to get rid of seams in wall.
windowSize = 11;
mfImage = medfilt2(grayImage, [windowSize, windowSize]);
% Display the image.
subplot(2, 3, 3);
imshow(mfImage, []);
title(‘Median Filtered Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
windowSize = 13;
sdImage = stdfilt(mfImage, ones(windowSize));
% Display the image.
subplot(2, 3, 4);
imshow(sdImage, []);
title(‘Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Show the histogram
subplot(2, 3, 5);
[counts, grayLevels] = histcounts(sdImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Binarize the image
binaryImage = sdImage >= 25;
% Remove blobs touching border.
binaryImage = imclearborder(binaryImage);
% Take largest blob
binaryImage = bwareafilt(binaryImage, 1);
% Display the image.
subplot(2, 3, 6);
imshow(binaryImage, []);
title(‘Binary Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Get widths as a function of row
widths = zeros(rows, 1);
for row = 1 : rows
col1 = find(binaryImage(row, :), 1, ‘first’);
col2 = find(binaryImage(row, :), 1, ‘last’);
if ~isempty(col1)
widths(row) = col2 – col1 + 1;
end
end
figure
subplot(2, 1, 1);
plot(widths, ‘b-‘, ‘LineWidth’, 2);
xlabel(‘Row’, ‘FontSize’, fontSize);
ylabel(‘Width’, ‘FontSize’, fontSize);
% Find valleys byinverting and finding peaks
[peakValues, indexes] = findpeaks(-widths);
peakValues = -peakValues; % Negate to flip over.
grid on;
hold on;
plot(indexes, peakValues, ‘r+’, ‘MarkerSize’, 12, ‘LineWidth’, 2);
% The neck is the first peak.
neckRow = indexes(1);
% Display the original image again.
subplot(2, 1, 2);
imshow(grayImage, []);
axis(‘on’, ‘image’);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Put a line up over the neck.
hold on;
line(xlim, [neckRow, neckRow], ‘Color’, ‘r’, ‘LineWidth’, 2);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]);Hello all. Why the codes detects the binary image the wrong one? Below I attach the codes, and sample of my data.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
%===============================================================================
% Read in gray scale demo image.
rgbImage = imread(‘1_245.jpg’);
% Get the dimensions of the image.
% numberOfColorChannels should be = 1 for a gray scale image, and 3 for an RGB color image.
[rows, columns, numberOfColorChannels] = size(rgbImage)
if numberOfColorChannels > 1
% It’s not really gray scale like we expected – it’s color.
% Use weighted sum of ALL channels to create a gray scale image.
% grayImage = rgb2gray(rgbImage);
% ALTERNATE METHOD: Convert it to gray scale by taking only the green channel,
% which in a typical snapshot will be the least noisy channel.
grayImage = rgbImage(:, :, 2); % Take green channel.
else
grayImage = rgbImage; % It’s already gray scale.
end
% Now it’s gray scale with range of 0 to 255.
% Display the image.
subplot(2, 3, 1);
imshow(grayImage, []);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
%——————————————————————————
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]);
% Get rid of tool bar and pulldown menus that are along top of figure.
% set(gcf, ‘Toolbar’, ‘none’, ‘Menu’, ‘none’);
% Give a name to the title bar.
set(gcf, ‘Name’, ‘Demo by ImageAnalyst’, ‘NumberTitle’, ‘Off’)
drawnow;
% Show the histogram
subplot(2, 3, 2);
[counts, grayLevels] = histcounts(grayImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Median Filter to get rid of seams in wall.
windowSize = 11;
mfImage = medfilt2(grayImage, [windowSize, windowSize]);
% Display the image.
subplot(2, 3, 3);
imshow(mfImage, []);
title(‘Median Filtered Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
windowSize = 13;
sdImage = stdfilt(mfImage, ones(windowSize));
% Display the image.
subplot(2, 3, 4);
imshow(sdImage, []);
title(‘Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Show the histogram
subplot(2, 3, 5);
[counts, grayLevels] = histcounts(sdImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Binarize the image
binaryImage = sdImage >= 25;
% Remove blobs touching border.
binaryImage = imclearborder(binaryImage);
% Take largest blob
binaryImage = bwareafilt(binaryImage, 1);
% Display the image.
subplot(2, 3, 6);
imshow(binaryImage, []);
title(‘Binary Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Get widths as a function of row
widths = zeros(rows, 1);
for row = 1 : rows
col1 = find(binaryImage(row, :), 1, ‘first’);
col2 = find(binaryImage(row, :), 1, ‘last’);
if ~isempty(col1)
widths(row) = col2 – col1 + 1;
end
end
figure
subplot(2, 1, 1);
plot(widths, ‘b-‘, ‘LineWidth’, 2);
xlabel(‘Row’, ‘FontSize’, fontSize);
ylabel(‘Width’, ‘FontSize’, fontSize);
% Find valleys byinverting and finding peaks
[peakValues, indexes] = findpeaks(-widths);
peakValues = -peakValues; % Negate to flip over.
grid on;
hold on;
plot(indexes, peakValues, ‘r+’, ‘MarkerSize’, 12, ‘LineWidth’, 2);
% The neck is the first peak.
neckRow = indexes(1);
% Display the original image again.
subplot(2, 1, 2);
imshow(grayImage, []);
axis(‘on’, ‘image’);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Put a line up over the neck.
hold on;
line(xlim, [neckRow, neckRow], ‘Color’, ‘r’, ‘LineWidth’, 2);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]); Hello all. Why the codes detects the binary image the wrong one? Below I attach the codes, and sample of my data.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
%===============================================================================
% Read in gray scale demo image.
rgbImage = imread(‘1_245.jpg’);
% Get the dimensions of the image.
% numberOfColorChannels should be = 1 for a gray scale image, and 3 for an RGB color image.
[rows, columns, numberOfColorChannels] = size(rgbImage)
if numberOfColorChannels > 1
% It’s not really gray scale like we expected – it’s color.
% Use weighted sum of ALL channels to create a gray scale image.
% grayImage = rgb2gray(rgbImage);
% ALTERNATE METHOD: Convert it to gray scale by taking only the green channel,
% which in a typical snapshot will be the least noisy channel.
grayImage = rgbImage(:, :, 2); % Take green channel.
else
grayImage = rgbImage; % It’s already gray scale.
end
% Now it’s gray scale with range of 0 to 255.
% Display the image.
subplot(2, 3, 1);
imshow(grayImage, []);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
%——————————————————————————
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]);
% Get rid of tool bar and pulldown menus that are along top of figure.
% set(gcf, ‘Toolbar’, ‘none’, ‘Menu’, ‘none’);
% Give a name to the title bar.
set(gcf, ‘Name’, ‘Demo by ImageAnalyst’, ‘NumberTitle’, ‘Off’)
drawnow;
% Show the histogram
subplot(2, 3, 2);
[counts, grayLevels] = histcounts(grayImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Median Filter to get rid of seams in wall.
windowSize = 11;
mfImage = medfilt2(grayImage, [windowSize, windowSize]);
% Display the image.
subplot(2, 3, 3);
imshow(mfImage, []);
title(‘Median Filtered Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
windowSize = 13;
sdImage = stdfilt(mfImage, ones(windowSize));
% Display the image.
subplot(2, 3, 4);
imshow(sdImage, []);
title(‘Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Show the histogram
subplot(2, 3, 5);
[counts, grayLevels] = histcounts(sdImage(:));
counts(counts == max(counts)) = 0; % Suppress spike
bar(grayLevels(1:end-1), counts);
grid on;
title(‘Histogram of Standard Deviation Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
% Binarize the image
binaryImage = sdImage >= 25;
% Remove blobs touching border.
binaryImage = imclearborder(binaryImage);
% Take largest blob
binaryImage = bwareafilt(binaryImage, 1);
% Display the image.
subplot(2, 3, 6);
imshow(binaryImage, []);
title(‘Binary Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Get widths as a function of row
widths = zeros(rows, 1);
for row = 1 : rows
col1 = find(binaryImage(row, :), 1, ‘first’);
col2 = find(binaryImage(row, :), 1, ‘last’);
if ~isempty(col1)
widths(row) = col2 – col1 + 1;
end
end
figure
subplot(2, 1, 1);
plot(widths, ‘b-‘, ‘LineWidth’, 2);
xlabel(‘Row’, ‘FontSize’, fontSize);
ylabel(‘Width’, ‘FontSize’, fontSize);
% Find valleys byinverting and finding peaks
[peakValues, indexes] = findpeaks(-widths);
peakValues = -peakValues; % Negate to flip over.
grid on;
hold on;
plot(indexes, peakValues, ‘r+’, ‘MarkerSize’, 12, ‘LineWidth’, 2);
% The neck is the first peak.
neckRow = indexes(1);
% Display the original image again.
subplot(2, 1, 2);
imshow(grayImage, []);
axis(‘on’, ‘image’);
title(‘Original Image’, ‘FontSize’, fontSize, ‘Interpreter’, ‘None’);
axis(‘on’, ‘image’);
hp = impixelinfo();
% Put a line up over the neck.
hold on;
line(xlim, [neckRow, neckRow], ‘Color’, ‘r’, ‘LineWidth’, 2);
% Enlarge figure to full screen.
set(gcf, ‘Units’, ‘Normalized’, ‘OuterPosition’, [0, 0.04, 1, 0.96]); binary MATLAB Answers — New Questions
How do I install and configure RTI for use with DDS Blockset?
I am trying to build my model which contains DDS blocks into an executable that conforms to the RTI Connext DDS API. However, I encounter the following error after pressing the "Build" button:
Environment variable "NDDSHOME" is not defined, set it to the "RTI"
installation directory, for more information please refer to "RTI" documentation.
How do I resolve this issue and install RTI for use with Simulink and DDS Blockset?I am trying to build my model which contains DDS blocks into an executable that conforms to the RTI Connext DDS API. However, I encounter the following error after pressing the "Build" button:
Environment variable "NDDSHOME" is not defined, set it to the "RTI"
installation directory, for more information please refer to "RTI" documentation.
How do I resolve this issue and install RTI for use with Simulink and DDS Blockset? I am trying to build my model which contains DDS blocks into an executable that conforms to the RTI Connext DDS API. However, I encounter the following error after pressing the "Build" button:
Environment variable "NDDSHOME" is not defined, set it to the "RTI"
installation directory, for more information please refer to "RTI" documentation.
How do I resolve this issue and install RTI for use with Simulink and DDS Blockset? rti, dds, addons MATLAB Answers — New Questions
How to solve a highly non-linear ODE containing multiple powers?
I’m working on a time-dependent equation from fluid mechanics for the velocity (u) in a loop. The equation I’m trying to solve is:
Where c1, c2, c3, and c4 are all positive, known constants. I’ve tried pretty much all of the ODE solvers in MATLAB and they all blow up to infinity and return the following error: "Warning: Failure at t=3.237651e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.150245e-14) at time t."
Can anyone give me some insights into other solvers that might work for this type of problem, or modifications to the solvers I’ve tried that can resolve the integration tolerance issue?I’m working on a time-dependent equation from fluid mechanics for the velocity (u) in a loop. The equation I’m trying to solve is:
Where c1, c2, c3, and c4 are all positive, known constants. I’ve tried pretty much all of the ODE solvers in MATLAB and they all blow up to infinity and return the following error: "Warning: Failure at t=3.237651e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.150245e-14) at time t."
Can anyone give me some insights into other solvers that might work for this type of problem, or modifications to the solvers I’ve tried that can resolve the integration tolerance issue? I’m working on a time-dependent equation from fluid mechanics for the velocity (u) in a loop. The equation I’m trying to solve is:
Where c1, c2, c3, and c4 are all positive, known constants. I’ve tried pretty much all of the ODE solvers in MATLAB and they all blow up to infinity and return the following error: "Warning: Failure at t=3.237651e+00. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.150245e-14) at time t."
Can anyone give me some insights into other solvers that might work for this type of problem, or modifications to the solvers I’ve tried that can resolve the integration tolerance issue? differential equations, nonlinear, numerical integration, ode MATLAB Answers — New Questions
SoC Builder stucked on “Synthesize design”
Hello. I’m attempting to deploy the "RFSoC Template" from the SoC Blockset, which involves a simple loopback from a DAC to an ADC channel for the ZCU-111 board. I can open and simulate the top-level model successfully. However, when I try to use the "SoC Builder" via the "Configure, Build & Deploy" button, the wizard becomes indefinitely stuck at the "Synthesize design" step. All preceding steps execute without errors. The last few lines in the MATLAB command window indicate an "Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’ as follows:
### Workflow complete.
———- Generating Xilinx Design Tcl File ———-
———- Generating constraints file ———-
———- Creating Vivado project ———-
———- Building Vivado project with 6 parallel jobs ———-
### Using the SoC system information from ‘/home/canisio/Workspace/Simulink_RFSoC/soc_prj/socsysinfo.mat’
Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’
Could not open file /home/canisio/Workspace/Simulink_RFSoC/soc_prj/vivado_build_prj.log. No such file or directory.
Even though the GUI indicates "Project build successfully started in a separate window," no additional window or prompt appears, aside from the "code generation report." I opened the Linux "System Monitor," and judging by the core usage, there’s definitely no synthesis occurring.
I’m utilizing Matlab/Simulink 2024a alongside Vivado tools 2023.1 on Ubuntu 22.04.4 LTS. Vivado has the necessary licenses for the RFSoC board and functions correctly; I’ve successfully opened the created project and generated the respective bitstream. However, this deviates from the anticipated workflow for the SoC Blockset, and I aim to utilize the complete MathWorks framework.
The SD card to boot the board was configured according to the instructions provided in the installation of the "SoC Blockset Support Package for Xilinx Devices" version 24.1.1. I’m able to connect via JTAG and ping to and from the board.
Am I overlooking any additional configurations? Thank you in advance.Hello. I’m attempting to deploy the "RFSoC Template" from the SoC Blockset, which involves a simple loopback from a DAC to an ADC channel for the ZCU-111 board. I can open and simulate the top-level model successfully. However, when I try to use the "SoC Builder" via the "Configure, Build & Deploy" button, the wizard becomes indefinitely stuck at the "Synthesize design" step. All preceding steps execute without errors. The last few lines in the MATLAB command window indicate an "Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’ as follows:
### Workflow complete.
———- Generating Xilinx Design Tcl File ———-
———- Generating constraints file ———-
———- Creating Vivado project ———-
———- Building Vivado project with 6 parallel jobs ———-
### Using the SoC system information from ‘/home/canisio/Workspace/Simulink_RFSoC/soc_prj/socsysinfo.mat’
Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’
Could not open file /home/canisio/Workspace/Simulink_RFSoC/soc_prj/vivado_build_prj.log. No such file or directory.
Even though the GUI indicates "Project build successfully started in a separate window," no additional window or prompt appears, aside from the "code generation report." I opened the Linux "System Monitor," and judging by the core usage, there’s definitely no synthesis occurring.
I’m utilizing Matlab/Simulink 2024a alongside Vivado tools 2023.1 on Ubuntu 22.04.4 LTS. Vivado has the necessary licenses for the RFSoC board and functions correctly; I’ve successfully opened the created project and generated the respective bitstream. However, this deviates from the anticipated workflow for the SoC Blockset, and I aim to utilize the complete MathWorks framework.
The SD card to boot the board was configured according to the instructions provided in the installation of the "SoC Blockset Support Package for Xilinx Devices" version 24.1.1. I’m able to connect via JTAG and ping to and from the board.
Am I overlooking any additional configurations? Thank you in advance. Hello. I’m attempting to deploy the "RFSoC Template" from the SoC Blockset, which involves a simple loopback from a DAC to an ADC channel for the ZCU-111 board. I can open and simulate the top-level model successfully. However, when I try to use the "SoC Builder" via the "Configure, Build & Deploy" button, the wizard becomes indefinitely stuck at the "Synthesize design" step. All preceding steps execute without errors. The last few lines in the MATLAB command window indicate an "Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’ as follows:
### Workflow complete.
———- Generating Xilinx Design Tcl File ———-
———- Generating constraints file ———-
———- Creating Vivado project ———-
———- Building Vivado project with 6 parallel jobs ———-
### Using the SoC system information from ‘/home/canisio/Workspace/Simulink_RFSoC/soc_prj/socsysinfo.mat’
Error while evaluating TimerFcn for timer ‘BuildStatusTimer_soc_rfsoc_top’
Could not open file /home/canisio/Workspace/Simulink_RFSoC/soc_prj/vivado_build_prj.log. No such file or directory.
Even though the GUI indicates "Project build successfully started in a separate window," no additional window or prompt appears, aside from the "code generation report." I opened the Linux "System Monitor," and judging by the core usage, there’s definitely no synthesis occurring.
I’m utilizing Matlab/Simulink 2024a alongside Vivado tools 2023.1 on Ubuntu 22.04.4 LTS. Vivado has the necessary licenses for the RFSoC board and functions correctly; I’ve successfully opened the created project and generated the respective bitstream. However, this deviates from the anticipated workflow for the SoC Blockset, and I aim to utilize the complete MathWorks framework.
The SD card to boot the board was configured according to the instructions provided in the installation of the "SoC Blockset Support Package for Xilinx Devices" version 24.1.1. I’m able to connect via JTAG and ping to and from the board.
Am I overlooking any additional configurations? Thank you in advance. soc, xilinx, zcu, rfsoc, soc builder, synthesis, stuck MATLAB Answers — New Questions
how to take seasoanal mean
I have data with 231x141x6408 dimension, it is daily mean data of January, February, and December from 1950-2020. How to take seasonal mean from the data for each year. so I finally obtain data with dimension 231x141x71, please note there are leap years.
Link of the data
https://drive.google.com/file/d/1PeZKZZIJN7LBXxRn9omSyQN3UU33TBNX/view?usp=sharingI have data with 231x141x6408 dimension, it is daily mean data of January, February, and December from 1950-2020. How to take seasonal mean from the data for each year. so I finally obtain data with dimension 231x141x71, please note there are leap years.
Link of the data
https://drive.google.com/file/d/1PeZKZZIJN7LBXxRn9omSyQN3UU33TBNX/view?usp=sharing I have data with 231x141x6408 dimension, it is daily mean data of January, February, and December from 1950-2020. How to take seasonal mean from the data for each year. so I finally obtain data with dimension 231x141x71, please note there are leap years.
Link of the data
https://drive.google.com/file/d/1PeZKZZIJN7LBXxRn9omSyQN3UU33TBNX/view?usp=sharing mean MATLAB Answers — New Questions
Matlab Online Figures Won’t Close
I have a Simulink / Matlab program that runs scrips and generates many figures. They are generated in a script and then closed in the same script. When I run it on the computer the figures close. When I run it online however, the figure contents close but there is a blank figure left that will not close at all. I have to exit Matlab Online and open a new session to ever get rid of them.
How do I properly get Matlab figures to close online?
figure(101);
hold on;
plot(BASEQ.Time,BASEQ.LSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.RSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.LEAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.REAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.LWAngularWorkonClub);
plot(BASEQ.Time,BASEQ.RWAngularWorkonClub);
ylabel(‘Work (J)’);
grid ‘on’;
%Add Legend to Plot
legend(‘LS Angular Work’,’RS Angular Work’,’LE Angular Work’,’RE Angular Work’,’LW Angular Work’,’RW Angular Work’);
legend(‘Location’,’southeast’);
%Add a Title
title(‘Angular Work on Distal Segment’);
subtitle(‘BASE’);
%Save Figure
savefig(‘BaseData Charts/BASE_Plot – Angular Work’);
%Close Figure
close(101);I have a Simulink / Matlab program that runs scrips and generates many figures. They are generated in a script and then closed in the same script. When I run it on the computer the figures close. When I run it online however, the figure contents close but there is a blank figure left that will not close at all. I have to exit Matlab Online and open a new session to ever get rid of them.
How do I properly get Matlab figures to close online?
figure(101);
hold on;
plot(BASEQ.Time,BASEQ.LSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.RSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.LEAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.REAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.LWAngularWorkonClub);
plot(BASEQ.Time,BASEQ.RWAngularWorkonClub);
ylabel(‘Work (J)’);
grid ‘on’;
%Add Legend to Plot
legend(‘LS Angular Work’,’RS Angular Work’,’LE Angular Work’,’RE Angular Work’,’LW Angular Work’,’RW Angular Work’);
legend(‘Location’,’southeast’);
%Add a Title
title(‘Angular Work on Distal Segment’);
subtitle(‘BASE’);
%Save Figure
savefig(‘BaseData Charts/BASE_Plot – Angular Work’);
%Close Figure
close(101); I have a Simulink / Matlab program that runs scrips and generates many figures. They are generated in a script and then closed in the same script. When I run it on the computer the figures close. When I run it online however, the figure contents close but there is a blank figure left that will not close at all. I have to exit Matlab Online and open a new session to ever get rid of them.
How do I properly get Matlab figures to close online?
figure(101);
hold on;
plot(BASEQ.Time,BASEQ.LSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.RSAngularWorkonArm);
plot(BASEQ.Time,BASEQ.LEAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.REAngularWorkonForearm);
plot(BASEQ.Time,BASEQ.LWAngularWorkonClub);
plot(BASEQ.Time,BASEQ.RWAngularWorkonClub);
ylabel(‘Work (J)’);
grid ‘on’;
%Add Legend to Plot
legend(‘LS Angular Work’,’RS Angular Work’,’LE Angular Work’,’RE Angular Work’,’LW Angular Work’,’RW Angular Work’);
legend(‘Location’,’southeast’);
%Add a Title
title(‘Angular Work on Distal Segment’);
subtitle(‘BASE’);
%Save Figure
savefig(‘BaseData Charts/BASE_Plot – Angular Work’);
%Close Figure
close(101); figures, close, plot MATLAB Answers — New Questions
Is Login Named User available on machines without a display?
I have a machine without a GUI or display. Can I still use the Login Named User license option?I have a machine without a GUI or display. Can I still use the Login Named User license option? I have a machine without a GUI or display. Can I still use the Login Named User license option? MATLAB Answers — New Questions
Is there a list of MatLab tutors?
Is there a list of MatLab tutors somewhere that I can hire on an hourly basis to help me get started?
I prefer someone I can talk to by telephone using one of the screen sharing apps.
I probably only need an hour or two to get started, but may need the occasional hour or two later on as I tackle more advanced tasks.Is there a list of MatLab tutors somewhere that I can hire on an hourly basis to help me get started?
I prefer someone I can talk to by telephone using one of the screen sharing apps.
I probably only need an hour or two to get started, but may need the occasional hour or two later on as I tackle more advanced tasks. Is there a list of MatLab tutors somewhere that I can hire on an hourly basis to help me get started?
I prefer someone I can talk to by telephone using one of the screen sharing apps.
I probably only need an hour or two to get started, but may need the occasional hour or two later on as I tackle more advanced tasks. matlab tutors MATLAB Answers — New Questions
Variable Browser Tab Issue
So I was using the Variable Browser ealier today and for some reason, the tab in the Variable Browser is actually not showing up. Can you tell me if there is a way to get that tab back.
This is the proof btw.So I was using the Variable Browser ealier today and for some reason, the tab in the Variable Browser is actually not showing up. Can you tell me if there is a way to get that tab back.
This is the proof btw. So I was using the Variable Browser ealier today and for some reason, the tab in the Variable Browser is actually not showing up. Can you tell me if there is a way to get that tab back.
This is the proof btw. variable browser MATLAB Answers — New Questions
Offline Documentation works for GUI, but not for CLI
We installed the docuemtation ISO on our RHEL 8 server that is offline and we are able to get to the documentation from the gui by changing the help to localy installed.
However, the >>> doc command bring up nothing – just drops to the promps after typing it.
We are on 2024a.
We also set a startup.m file with the docroot listed for the full path – although, this might not be needed because its locally installed in the Matlab directory.We installed the docuemtation ISO on our RHEL 8 server that is offline and we are able to get to the documentation from the gui by changing the help to localy installed.
However, the >>> doc command bring up nothing – just drops to the promps after typing it.
We are on 2024a.
We also set a startup.m file with the docroot listed for the full path – although, this might not be needed because its locally installed in the Matlab directory. We installed the docuemtation ISO on our RHEL 8 server that is offline and we are able to get to the documentation from the gui by changing the help to localy installed.
However, the >>> doc command bring up nothing – just drops to the promps after typing it.
We are on 2024a.
We also set a startup.m file with the docroot listed for the full path – although, this might not be needed because its locally installed in the Matlab directory. offline documentation, cli MATLAB Answers — New Questions