Category: Matlab
Category Archives: Matlab
Why is 0.3 – 0.2 – 0.1 not equal to zero?
Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false?Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false? Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false? faqlist, floating point, limited precision, faq_fp MATLAB Answers — New Questions
I have the problem of Error Dialog.
I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24.I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24. I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24. error dialog MATLAB Answers — New Questions
Matlab code does not run past a certain point: i.e. buffers at a certain line of code
So I’m trying to solve a problem (attached below) and I’ve written the code (below) to solve it. When I go to run the code it gets stuck at the following line:
% Solve the ODEs numerically
%[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
It fully ran once, but continues to not run.
This is the problem:
Code:
G = 6.6742e-11; % universal gravitational constant (km^3/kg/s^2)
M = 5.974e24; % Earth mass estimate (kg)
R = 6378; % planet radius (km)
r0 = [3207 5459 2714]; % initial position vector (km)
v0 = [-6.532 0.7835 6.142]; % initial velocity vector (km/s)
t0 = 0; % initial time in seconds
% Define the ODEs
odeFunc = @(t, y) [y(4); y(5); y(6); -G*M*y(1)/(norm(y(1:3))^3); -G*M*y(2)/(norm(y(1:3))^3); -G*M*y(3)/(norm(y(1:3))^3)];
% Set options for ode45 solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-6);
% Solve the ODEs numerically
[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
% Calculate altitude above Earth’s surface
altitudes = sqrt(sum(y(:, 1:3).^2, 2)) – R;
% Find the maximum altitude and the time at which it occurs
[maxAltitude, maxAltitudeIndex] = max(altitudes);
timeOfMaxAltitude = t(maxAltitudeIndex);
% Display the results
fprintf(‘Maximum Altitude: %.2f kmn’, maxAltitude);
fprintf(‘Time of Maximum Altitude: %.2f hoursn’, timeOfMaxAltitude / 3600);So I’m trying to solve a problem (attached below) and I’ve written the code (below) to solve it. When I go to run the code it gets stuck at the following line:
% Solve the ODEs numerically
%[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
It fully ran once, but continues to not run.
This is the problem:
Code:
G = 6.6742e-11; % universal gravitational constant (km^3/kg/s^2)
M = 5.974e24; % Earth mass estimate (kg)
R = 6378; % planet radius (km)
r0 = [3207 5459 2714]; % initial position vector (km)
v0 = [-6.532 0.7835 6.142]; % initial velocity vector (km/s)
t0 = 0; % initial time in seconds
% Define the ODEs
odeFunc = @(t, y) [y(4); y(5); y(6); -G*M*y(1)/(norm(y(1:3))^3); -G*M*y(2)/(norm(y(1:3))^3); -G*M*y(3)/(norm(y(1:3))^3)];
% Set options for ode45 solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-6);
% Solve the ODEs numerically
[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
% Calculate altitude above Earth’s surface
altitudes = sqrt(sum(y(:, 1:3).^2, 2)) – R;
% Find the maximum altitude and the time at which it occurs
[maxAltitude, maxAltitudeIndex] = max(altitudes);
timeOfMaxAltitude = t(maxAltitudeIndex);
% Display the results
fprintf(‘Maximum Altitude: %.2f kmn’, maxAltitude);
fprintf(‘Time of Maximum Altitude: %.2f hoursn’, timeOfMaxAltitude / 3600); So I’m trying to solve a problem (attached below) and I’ve written the code (below) to solve it. When I go to run the code it gets stuck at the following line:
% Solve the ODEs numerically
%[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
It fully ran once, but continues to not run.
This is the problem:
Code:
G = 6.6742e-11; % universal gravitational constant (km^3/kg/s^2)
M = 5.974e24; % Earth mass estimate (kg)
R = 6378; % planet radius (km)
r0 = [3207 5459 2714]; % initial position vector (km)
v0 = [-6.532 0.7835 6.142]; % initial velocity vector (km/s)
t0 = 0; % initial time in seconds
% Define the ODEs
odeFunc = @(t, y) [y(4); y(5); y(6); -G*M*y(1)/(norm(y(1:3))^3); -G*M*y(2)/(norm(y(1:3))^3); -G*M*y(3)/(norm(y(1:3))^3)];
% Set options for ode45 solver
options = odeset(‘RelTol’, 1e-6, ‘AbsTol’, 1e-6);
% Solve the ODEs numerically
[t, y] = ode45(odeFunc, [t0, 1.66*3600], [r0; v0], options);
% Calculate altitude above Earth’s surface
altitudes = sqrt(sum(y(:, 1:3).^2, 2)) – R;
% Find the maximum altitude and the time at which it occurs
[maxAltitude, maxAltitudeIndex] = max(altitudes);
timeOfMaxAltitude = t(maxAltitudeIndex);
% Display the results
fprintf(‘Maximum Altitude: %.2f kmn’, maxAltitude);
fprintf(‘Time of Maximum Altitude: %.2f hoursn’, timeOfMaxAltitude / 3600); ode45 MATLAB Answers — New Questions
Can a system() Command be used Inside a Function Called from Inside a parfor Loop?
Is the following code allowed:
result = zeros(100,1);
parfor ii = 1:100
% do something
result(ii) = myfun(resultfromdoingsomething)
end
function result = myfun(inp)
% do something and write a file based on inp
status = system(command); % command executes an executable that reads in the file that was written and produces an output file
result = % read in the file produced by the executable and grab a value to return
% delete the files
end
Even if allowed, are there any risks to be concerned about?
Would also like to know if there are any differences between 2024a and 2019b in this regard.Is the following code allowed:
result = zeros(100,1);
parfor ii = 1:100
% do something
result(ii) = myfun(resultfromdoingsomething)
end
function result = myfun(inp)
% do something and write a file based on inp
status = system(command); % command executes an executable that reads in the file that was written and produces an output file
result = % read in the file produced by the executable and grab a value to return
% delete the files
end
Even if allowed, are there any risks to be concerned about?
Would also like to know if there are any differences between 2024a and 2019b in this regard. Is the following code allowed:
result = zeros(100,1);
parfor ii = 1:100
% do something
result(ii) = myfun(resultfromdoingsomething)
end
function result = myfun(inp)
% do something and write a file based on inp
status = system(command); % command executes an executable that reads in the file that was written and produces an output file
result = % read in the file produced by the executable and grab a value to return
% delete the files
end
Even if allowed, are there any risks to be concerned about?
Would also like to know if there are any differences between 2024a and 2019b in this regard. parfor, system command MATLAB Answers — New Questions
Prediction based on ClassificationPartitionedModel
Hi all,
I have a predictor matrix X and binary response y (1000 observations) and want to use support vector machine (or other machine learning techniques built in Matlab, i.e., fitctree, fitcdiscr, fitcknn, fitcnet) to train the classifier based on 10-fold cross-validation.
My idea is to use 1-999 observations for cross-validation training and testing, and use the best classifier to predict a single out-of-sample y based on 1000th X. How can I do that?
Without cross-validation, I can simply use predict(.) function in Matlab to predict a single y based on 1000th X. However, this is not allowed when cross-validation is used. For a ClassificationPartitionedModel, the function kfoldPredict(.) should be used. The problem is, I am not allowed to specify the X when using kfoldPredict.
Is there anyone know the answer?
Many thanks.Hi all,
I have a predictor matrix X and binary response y (1000 observations) and want to use support vector machine (or other machine learning techniques built in Matlab, i.e., fitctree, fitcdiscr, fitcknn, fitcnet) to train the classifier based on 10-fold cross-validation.
My idea is to use 1-999 observations for cross-validation training and testing, and use the best classifier to predict a single out-of-sample y based on 1000th X. How can I do that?
Without cross-validation, I can simply use predict(.) function in Matlab to predict a single y based on 1000th X. However, this is not allowed when cross-validation is used. For a ClassificationPartitionedModel, the function kfoldPredict(.) should be used. The problem is, I am not allowed to specify the X when using kfoldPredict.
Is there anyone know the answer?
Many thanks. Hi all,
I have a predictor matrix X and binary response y (1000 observations) and want to use support vector machine (or other machine learning techniques built in Matlab, i.e., fitctree, fitcdiscr, fitcknn, fitcnet) to train the classifier based on 10-fold cross-validation.
My idea is to use 1-999 observations for cross-validation training and testing, and use the best classifier to predict a single out-of-sample y based on 1000th X. How can I do that?
Without cross-validation, I can simply use predict(.) function in Matlab to predict a single y based on 1000th X. However, this is not allowed when cross-validation is used. For a ClassificationPartitionedModel, the function kfoldPredict(.) should be used. The problem is, I am not allowed to specify the X when using kfoldPredict.
Is there anyone know the answer?
Many thanks. machine learning, time series, prediction MATLAB Answers — New Questions
What are my license details?
What are my license details?What are my license details? What are my license details? MATLAB Answers — New Questions
Why is the “mjs” file missing from my installation of MATLAB Parallel Server?
Why is the "mjs" file missing from my installation of MATLAB Parallel Server?Why is the "mjs" file missing from my installation of MATLAB Parallel Server? Why is the "mjs" file missing from my installation of MATLAB Parallel Server? MATLAB Answers — New Questions
Why do I get an unhelpful error message when assigning a “struct” only to the end of the last structure array entry initialized by empty brackets?
I am initializing an empty structure array using empty brackets:
>> myStruct(3).myField = [];
Then, all the initialized structure arrays are of type "double":
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘double’} {‘double’} {‘double’}
Why do I get an unhelpful error of "Conversion to double from struct is not possible" only when appending a "struct" to the end of the last array entry?
For example, the following code snippet executes without an error, which changes the class of the first and second entries of "myStruct" to "struct":
>> myStruct(1).myField(2) = struct(‘myVar’, 3);
>> myStruct(2).myField(2) = struct(‘myVar’, 3);
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘struct’} {‘struct’} {‘double’}
However, executing a similar line of code for the last entry of "myStruct" does throw an error:
>> myStruct(3).myField(2) = struct(‘myVar’, 3);
Conversion to double from struct is not possible.I am initializing an empty structure array using empty brackets:
>> myStruct(3).myField = [];
Then, all the initialized structure arrays are of type "double":
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘double’} {‘double’} {‘double’}
Why do I get an unhelpful error of "Conversion to double from struct is not possible" only when appending a "struct" to the end of the last array entry?
For example, the following code snippet executes without an error, which changes the class of the first and second entries of "myStruct" to "struct":
>> myStruct(1).myField(2) = struct(‘myVar’, 3);
>> myStruct(2).myField(2) = struct(‘myVar’, 3);
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘struct’} {‘struct’} {‘double’}
However, executing a similar line of code for the last entry of "myStruct" does throw an error:
>> myStruct(3).myField(2) = struct(‘myVar’, 3);
Conversion to double from struct is not possible. I am initializing an empty structure array using empty brackets:
>> myStruct(3).myField = [];
Then, all the initialized structure arrays are of type "double":
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘double’} {‘double’} {‘double’}
Why do I get an unhelpful error of "Conversion to double from struct is not possible" only when appending a "struct" to the end of the last array entry?
For example, the following code snippet executes without an error, which changes the class of the first and second entries of "myStruct" to "struct":
>> myStruct(1).myField(2) = struct(‘myVar’, 3);
>> myStruct(2).myField(2) = struct(‘myVar’, 3);
>> {class(myStruct(1).myField), class(myStruct(2).myField), class(myStruct(3).myField)}
ans =
1×3 cell array
{‘struct’} {‘struct’} {‘double’}
However, executing a similar line of code for the last entry of "myStruct" does throw an error:
>> myStruct(3).myField(2) = struct(‘myVar’, 3);
Conversion to double from struct is not possible. structinitialization MATLAB Answers — New Questions
Flipping a matrix diagonally
I would like to flip a matrix that I have diagonally from left to right as shown in the image. Is there a command or a simple way to do this? The other two ends of my matrices have the correct values so I do not want them to moveI would like to flip a matrix that I have diagonally from left to right as shown in the image. Is there a command or a simple way to do this? The other two ends of my matrices have the correct values so I do not want them to move I would like to flip a matrix that I have diagonally from left to right as shown in the image. Is there a command or a simple way to do this? The other two ends of my matrices have the correct values so I do not want them to move flip, matrix manipulation, matrix MATLAB Answers — New Questions
How to replace values in a table with the outputs of another code?
I am attempting to create a table that will display the results gotten from running through another MATLAB code however I just cannot seem to replace the values in the table with the new values.
I have the Table labeled so that I can output it but I don’t understand why I can’t replace the Table values (that I have currently stored as 0’s) with the outputs. I got and error originally saying that the right hand side needed to be a table or an array (Originally i just had the "minPModel" and such but since replaced them with the new table "MinMaxTab" and it still won’t accept it). I don’t understand how to get it to work.
Attached is the MinMax file
Table1 = table([0.50; 0.75; 1; 1.25; 1.5; 1.75; 2],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
‘VariableNames’,{‘R (mmHg*s/ml)’ ‘Pressure Maximum (mmHg)’ ‘Pressure Minimum (mmHg)’ ‘Presure Mean (mmHg)’ ‘Pulse Pressure (max-min) (mmHg)’});
for R = 0.5:.25:2
k = 2;
fprintf("R = %d", R);
run MinMax.m;
MinMaxTab = [minPModel; maxPModel; meanPModel];
Table1(2,k) = MinMaxTab(1,1);
Table1(3,k) = MinMaxTab(1,2);
Table1(4,k) = MinMaxTab(1,3);
Table1(5,k) = Table1(3,k)-Table1(2,k);
k=k+1;
end
Table1I am attempting to create a table that will display the results gotten from running through another MATLAB code however I just cannot seem to replace the values in the table with the new values.
I have the Table labeled so that I can output it but I don’t understand why I can’t replace the Table values (that I have currently stored as 0’s) with the outputs. I got and error originally saying that the right hand side needed to be a table or an array (Originally i just had the "minPModel" and such but since replaced them with the new table "MinMaxTab" and it still won’t accept it). I don’t understand how to get it to work.
Attached is the MinMax file
Table1 = table([0.50; 0.75; 1; 1.25; 1.5; 1.75; 2],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
‘VariableNames’,{‘R (mmHg*s/ml)’ ‘Pressure Maximum (mmHg)’ ‘Pressure Minimum (mmHg)’ ‘Presure Mean (mmHg)’ ‘Pulse Pressure (max-min) (mmHg)’});
for R = 0.5:.25:2
k = 2;
fprintf("R = %d", R);
run MinMax.m;
MinMaxTab = [minPModel; maxPModel; meanPModel];
Table1(2,k) = MinMaxTab(1,1);
Table1(3,k) = MinMaxTab(1,2);
Table1(4,k) = MinMaxTab(1,3);
Table1(5,k) = Table1(3,k)-Table1(2,k);
k=k+1;
end
Table1 I am attempting to create a table that will display the results gotten from running through another MATLAB code however I just cannot seem to replace the values in the table with the new values.
I have the Table labeled so that I can output it but I don’t understand why I can’t replace the Table values (that I have currently stored as 0’s) with the outputs. I got and error originally saying that the right hand side needed to be a table or an array (Originally i just had the "minPModel" and such but since replaced them with the new table "MinMaxTab" and it still won’t accept it). I don’t understand how to get it to work.
Attached is the MinMax file
Table1 = table([0.50; 0.75; 1; 1.25; 1.5; 1.75; 2],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
[0; 0; 0; 0; 0; 0; 0],…
‘VariableNames’,{‘R (mmHg*s/ml)’ ‘Pressure Maximum (mmHg)’ ‘Pressure Minimum (mmHg)’ ‘Presure Mean (mmHg)’ ‘Pulse Pressure (max-min) (mmHg)’});
for R = 0.5:.25:2
k = 2;
fprintf("R = %d", R);
run MinMax.m;
MinMaxTab = [minPModel; maxPModel; meanPModel];
Table1(2,k) = MinMaxTab(1,1);
Table1(3,k) = MinMaxTab(1,2);
Table1(4,k) = MinMaxTab(1,3);
Table1(5,k) = Table1(3,k)-Table1(2,k);
k=k+1;
end
Table1 table, replacement, optimization MATLAB Answers — New Questions
Two Arduinos with Two Simulink Model
Hi,
Please let me know if I am doing something wrong or it is just the limit of Matlab.
I have 2 Arduinos, Uno and Due.
I created two different Simulink model that 1, Uno, is going to be the output as sending digital signal. The second model is going to be the Due as an input to read what is on the pin.
When I open them both, set the Hardware, set the comport, and ran. Only one of them runs not the other.
Once one of them runs then the another Simulink model thinks that it needs to be connected to the currently connected device.
For example, if I run the Uno model, then the Simulink model (A) connects to Uno successfully. However, while the Due is connected, run the Due Simulink model (B) then it shows me an error saying that sorry I can’t connect to Uno. I told the Simulink to connect to Due at a specific port but it is keep doing this.
Has anyone have experience in setting two arduinos and two simulink model separatly?
Thanks!Hi,
Please let me know if I am doing something wrong or it is just the limit of Matlab.
I have 2 Arduinos, Uno and Due.
I created two different Simulink model that 1, Uno, is going to be the output as sending digital signal. The second model is going to be the Due as an input to read what is on the pin.
When I open them both, set the Hardware, set the comport, and ran. Only one of them runs not the other.
Once one of them runs then the another Simulink model thinks that it needs to be connected to the currently connected device.
For example, if I run the Uno model, then the Simulink model (A) connects to Uno successfully. However, while the Due is connected, run the Due Simulink model (B) then it shows me an error saying that sorry I can’t connect to Uno. I told the Simulink to connect to Due at a specific port but it is keep doing this.
Has anyone have experience in setting two arduinos and two simulink model separatly?
Thanks! Hi,
Please let me know if I am doing something wrong or it is just the limit of Matlab.
I have 2 Arduinos, Uno and Due.
I created two different Simulink model that 1, Uno, is going to be the output as sending digital signal. The second model is going to be the Due as an input to read what is on the pin.
When I open them both, set the Hardware, set the comport, and ran. Only one of them runs not the other.
Once one of them runs then the another Simulink model thinks that it needs to be connected to the currently connected device.
For example, if I run the Uno model, then the Simulink model (A) connects to Uno successfully. However, while the Due is connected, run the Due Simulink model (B) then it shows me an error saying that sorry I can’t connect to Uno. I told the Simulink to connect to Due at a specific port but it is keep doing this.
Has anyone have experience in setting two arduinos and two simulink model separatly?
Thanks! arduino, simulink, embedded coder, matlab MATLAB Answers — New Questions
How to resize axes programmatically within a GUI built with uifigure and uigridlayout?
Hi everyone,
I’ve been building a GUI based on a uifigure and the matlab.apps.AppBase tools. It’s not built in App Designer, I do it programmatically. I use a uigridlayout to position my various items; it works quite well for most things, but I’m having trouble with uiaxes.
These uiaxes are located within the uigridlayout, but I need to make a slight size adjustment after they’ve been created. I just need to adjust the width, I know by how many pixels to adjust it. If I run my app by typing "app = appName();" in the command window, the app shows up, the uiaxes are not adjusted. I then issue the command in the command window: "app.myAxes.Position(3) = app.myAxes.Position(3) – boxWidth;", which does exactly what I need it to do.
However, adding that line of code in the code that builds the actual GUI does not work, no matter where I try to put it. I’ve set AutoResizeChildren of the uifigure to off, no luck. I’ve searched here, but nothing I found seems to work.
So how do I get my app to execute that particular line of code?
Cheers,
ChristianeHi everyone,
I’ve been building a GUI based on a uifigure and the matlab.apps.AppBase tools. It’s not built in App Designer, I do it programmatically. I use a uigridlayout to position my various items; it works quite well for most things, but I’m having trouble with uiaxes.
These uiaxes are located within the uigridlayout, but I need to make a slight size adjustment after they’ve been created. I just need to adjust the width, I know by how many pixels to adjust it. If I run my app by typing "app = appName();" in the command window, the app shows up, the uiaxes are not adjusted. I then issue the command in the command window: "app.myAxes.Position(3) = app.myAxes.Position(3) – boxWidth;", which does exactly what I need it to do.
However, adding that line of code in the code that builds the actual GUI does not work, no matter where I try to put it. I’ve set AutoResizeChildren of the uifigure to off, no luck. I’ve searched here, but nothing I found seems to work.
So how do I get my app to execute that particular line of code?
Cheers,
Christiane Hi everyone,
I’ve been building a GUI based on a uifigure and the matlab.apps.AppBase tools. It’s not built in App Designer, I do it programmatically. I use a uigridlayout to position my various items; it works quite well for most things, but I’m having trouble with uiaxes.
These uiaxes are located within the uigridlayout, but I need to make a slight size adjustment after they’ve been created. I just need to adjust the width, I know by how many pixels to adjust it. If I run my app by typing "app = appName();" in the command window, the app shows up, the uiaxes are not adjusted. I then issue the command in the command window: "app.myAxes.Position(3) = app.myAxes.Position(3) – boxWidth;", which does exactly what I need it to do.
However, adding that line of code in the code that builds the actual GUI does not work, no matter where I try to put it. I’ve set AutoResizeChildren of the uifigure to off, no luck. I’ve searched here, but nothing I found seems to work.
So how do I get my app to execute that particular line of code?
Cheers,
Christiane uiaxes uigridlayout MATLAB Answers — New Questions
I want to convert the large datetime data into double format.
I used datenum command, but its changing the value. The code and the values are attached below. Here TimestampHide is the data from an excel sheet.
MATLAB Code:
>> T=TimestampHide;
>> T.Format = ‘yyyy-MM-dd HH:mm:ss.SSS’;
>> Z=datenum(T);
The value of ZI used datenum command, but its changing the value. The code and the values are attached below. Here TimestampHide is the data from an excel sheet.
MATLAB Code:
>> T=TimestampHide;
>> T.Format = ‘yyyy-MM-dd HH:mm:ss.SSS’;
>> Z=datenum(T);
The value of Z I used datenum command, but its changing the value. The code and the values are attached below. Here TimestampHide is the data from an excel sheet.
MATLAB Code:
>> T=TimestampHide;
>> T.Format = ‘yyyy-MM-dd HH:mm:ss.SSS’;
>> Z=datenum(T);
The value of Z timestamp, datetime MATLAB Answers — New Questions
How can I adjust boxchart to have different number of groups for different nr of classes?
I would like to change this graph by keeping 4 boxplots for 4 and 6 classes, and then having only blue and red boxplots for 8 classes.I would like to change this graph by keeping 4 boxplots for 4 and 6 classes, and then having only blue and red boxplots for 8 classes. I would like to change this graph by keeping 4 boxplots for 4 and 6 classes, and then having only blue and red boxplots for 8 classes. matlab, graph, plot MATLAB Answers — New Questions
Matlab function only giving me 1 output
I have a function but its only giving me 1 output as an answer.
>> theta = 0:0.01:90;
>> Vmax = sqrt((0.25.*cos(theta).*9.8.*(sin(theta)+0.2.*cos(theta)))/(cos(theta)-0.2.*sin(theta)))
Vmax =
0.1514
I want to plot this on a graph but it only interprets the function as having 1 value. I’ve done functions this way before like if i just say
>> x = 0:0.01:pi;
>> y = sin(x);
it works fine so why is my Vmax just giving me 1 value.I have a function but its only giving me 1 output as an answer.
>> theta = 0:0.01:90;
>> Vmax = sqrt((0.25.*cos(theta).*9.8.*(sin(theta)+0.2.*cos(theta)))/(cos(theta)-0.2.*sin(theta)))
Vmax =
0.1514
I want to plot this on a graph but it only interprets the function as having 1 value. I’ve done functions this way before like if i just say
>> x = 0:0.01:pi;
>> y = sin(x);
it works fine so why is my Vmax just giving me 1 value. I have a function but its only giving me 1 output as an answer.
>> theta = 0:0.01:90;
>> Vmax = sqrt((0.25.*cos(theta).*9.8.*(sin(theta)+0.2.*cos(theta)))/(cos(theta)-0.2.*sin(theta)))
Vmax =
0.1514
I want to plot this on a graph but it only interprets the function as having 1 value. I’ve done functions this way before like if i just say
>> x = 0:0.01:pi;
>> y = sin(x);
it works fine so why is my Vmax just giving me 1 value. help, function MATLAB Answers — New Questions
Error when buliding PX4 firmware with some deactivated modules
Dear all,
I am currently using simulink to impememt my filght controller into Pixhawk 6x. At the step of building PX4 firmware I followed this tutorial https://ch.mathworks.com/help/uav/px4/ug/disable-control-modules.html. to avoid flash memory overflow issues, since building a default PX4 firmware itself takes already 99% of the total flash usage.
I change the code
CONFIG_MODULES_MC_ATT_CONTROL=y
to
CONFIG_MODULES_MC_ATT_CONTROL=n
in the file default.px4board.original and resave it as a new file hil.px4board. in the same folder.
In the Hardware Setup screen I tried to build ths new firmware but there is then an Error in cmd window,saying:
[706/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -c ../../src/modules/flight_mode_manager/FlightModeManager.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from ../../src/modules/flight_mode_manager/FlightModeManager.cpp:34:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
and
[707/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -c src/modules/flight_mode_manager/FlightTasks_generated.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from src/modules/flight_mode_manager/FlightTasks_generated.cpp:42:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Have you met this issue before and how did you solve it?
any suggestions or advices are welcome.
Thanks in advance.
Y.Z.Dear all,
I am currently using simulink to impememt my filght controller into Pixhawk 6x. At the step of building PX4 firmware I followed this tutorial https://ch.mathworks.com/help/uav/px4/ug/disable-control-modules.html. to avoid flash memory overflow issues, since building a default PX4 firmware itself takes already 99% of the total flash usage.
I change the code
CONFIG_MODULES_MC_ATT_CONTROL=y
to
CONFIG_MODULES_MC_ATT_CONTROL=n
in the file default.px4board.original and resave it as a new file hil.px4board. in the same folder.
In the Hardware Setup screen I tried to build ths new firmware but there is then an Error in cmd window,saying:
[706/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -c ../../src/modules/flight_mode_manager/FlightModeManager.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from ../../src/modules/flight_mode_manager/FlightModeManager.cpp:34:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
and
[707/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -c src/modules/flight_mode_manager/FlightTasks_generated.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from src/modules/flight_mode_manager/FlightTasks_generated.cpp:42:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Have you met this issue before and how did you solve it?
any suggestions or advices are welcome.
Thanks in advance.
Y.Z. Dear all,
I am currently using simulink to impememt my filght controller into Pixhawk 6x. At the step of building PX4 firmware I followed this tutorial https://ch.mathworks.com/help/uav/px4/ug/disable-control-modules.html. to avoid flash memory overflow issues, since building a default PX4 firmware itself takes already 99% of the total flash usage.
I change the code
CONFIG_MODULES_MC_ATT_CONTROL=y
to
CONFIG_MODULES_MC_ATT_CONTROL=n
in the file default.px4board.original and resave it as a new file hil.px4board. in the same folder.
In the Hardware Setup screen I tried to build ths new firmware but there is then an Error in cmd window,saying:
[706/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightModeManager.cpp.obj -c ../../src/modules/flight_mode_manager/FlightModeManager.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from ../../src/modules/flight_mode_manager/FlightModeManager.cpp:34:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
and
[707/1094] Building CXX object src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
FAILED: src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj
/usr/bin/ccache /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -DCONFIG_ARCH_BOARD_PX4_FMU_V6X -DMODULE_NAME="flight_mode_manager" -DPX4_MAIN=flight_mode_manager_app_main -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/px4/fmu-v6x/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/armv7-m -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/chip -I../../platforms/nuttx/NuttX/nuttx/arch/arm/src/common -I../../platforms/nuttx/NuttX/apps/include -Iexternal/Install/include -I../../src/modules/flight_mode_manager -Isrc/modules/flight_mode_manager -I../../src/modules/flight_mode_manager/tasks/Auto -I../../src/modules/flight_mode_manager/tasks/FlightTask -I../../src/modules/flight_mode_manager/tasks/Utility -I../../src/lib/slew_rate -I../../src/lib/motion_planning -I../../src/modules/flight_mode_manager/tasks/Descend -I../../src/modules/flight_mode_manager/tasks/Failsafe -I../../src/modules/flight_mode_manager/tasks/ManualAcceleration -I../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel -I../../src/modules/flight_mode_manager/tasks/ManualAltitude -I../../src/modules/flight_mode_manager/tasks/ManualPosition -I../../src/modules/flight_mode_manager/tasks/ManualPositionSmoothVel -I../../src/modules/flight_mode_manager/tasks/Transition -I../../src/modules/flight_mode_manager/tasks/AutoFollowTarget -I../../src/modules/flight_mode_manager/tasks/Orbit -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include/cxx -isystem ../../platforms/nuttx/NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -DNDEBUG -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -fno-rtti -fno-exceptions -fno-sized-deallocation -fno-threadsafe-statics -nostdinc++ -Wno-cast-align -Wframe-larger-than=2048 -D__KERNEL__ -std=gnu++14 -MD -MT src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -MF src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj.d -o src/modules/flight_mode_manager/CMakeFiles/modules__flight_mode_manager.dir/FlightTasks_generated.cpp.obj -c src/modules/flight_mode_manager/FlightTasks_generated.cpp
In file included from ../../platforms/common/include/px4_platform_common/param.h:42,
from ../../platforms/common/include/px4_platform_common/module_params.h:44,
from ../../src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.hpp:44,
from ../../src/modules/flight_mode_manager/FlightModeManager.hpp:36,
from src/modules/flight_mode_manager/FlightTasks_generated.cpp:42:
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:70:28: error: ‘MC_MAN_TILT_TAU’ is not a member of ‘px4::params’; did you mean ‘MPC_MAN_TILT_MAX’?
70 | (ParamFloat<px4::params::MC_MAN_TILT_TAU>) _param_mc_man_tilt_tau ///< time constant for stick filter
| ^~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:239:18: note: in definition of macro ‘REM’
239 | #define REM(…) __VA_ARGS__
| ^~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:60:40: note: in expansion of macro ‘PAIR’
60 | do_not_explicitly_use_this_namespace::PAIR(x);
| ^~~~
../../platforms/common/include/px4_platform_common/param_macros.h:45:36: note: in expansion of macro ‘_DEFINE_SINGLE_PARAMETER’
45 | #define APPLY2(t, aaa, aab) t(aaa) t(aab)
| ^
../../platforms/common/include/px4_platform_common/param_macros.h:197:33: note: in expansion of macro ‘APPLY2’
197 | #define APPLY_ALL_H3(t, n, …) APPLY##n(t, __VA_ARGS__)
| ^~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:198:33: note: in expansion of macro ‘APPLY_ALL_H3’
198 | #define APPLY_ALL_H2(t, n, …) APPLY_ALL_H3(t, n, __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param_macros.h:199:27: note: in expansion of macro ‘APPLY_ALL_H2’
199 | #define APPLY_ALL(t, …) APPLY_ALL_H2(t, NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
| ^~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:81:2: note: in expansion of macro ‘APPLY_ALL’
81 | APPLY_ALL(_DEFINE_SINGLE_PARAMETER, __VA_ARGS__)
| ^~~~~~~~~
../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.hpp:68:2: note: in expansion of macro ‘DEFINE_PARAMETERS’
68 | DEFINE_PARAMETERS(
| ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Have you met this issue before and how did you solve it?
any suggestions or advices are welcome.
Thanks in advance.
Y.Z. px4, simulink, pixhawk, uav, firmware MATLAB Answers — New Questions
Looking for help with labelling groups
Hey everyone,
so far I’ve read all Matlab entrys on adding/creating categories and/or labels but I haven’t found something fitting that works for me. I have a set of data in 178×13 double format, the variable names in a 1×13 cell format and the group classification in a 178×1 double, which ist just 1 2 and 3. In different projects I had a 178×1 cell instead containing the names of the groups and I would use that to generate a double using findgroups. However, now I would like to do the reverse action and generate a 178×1 cell value with the names instead of numbers. Num2Cell does not work here of course because I would like to tell Matlab to put "GroupA" for every 1 in the group classification 178×1 double and "GroupB" for every 2 and GroupC for every 3. I have information that the first 59 belog to GroupA etc, but I don’t know how to implement that either. Maybe it’s the language barrier but I really don’t even know what to search for anymore. Any help is much appreciated!Hey everyone,
so far I’ve read all Matlab entrys on adding/creating categories and/or labels but I haven’t found something fitting that works for me. I have a set of data in 178×13 double format, the variable names in a 1×13 cell format and the group classification in a 178×1 double, which ist just 1 2 and 3. In different projects I had a 178×1 cell instead containing the names of the groups and I would use that to generate a double using findgroups. However, now I would like to do the reverse action and generate a 178×1 cell value with the names instead of numbers. Num2Cell does not work here of course because I would like to tell Matlab to put "GroupA" for every 1 in the group classification 178×1 double and "GroupB" for every 2 and GroupC for every 3. I have information that the first 59 belog to GroupA etc, but I don’t know how to implement that either. Maybe it’s the language barrier but I really don’t even know what to search for anymore. Any help is much appreciated! Hey everyone,
so far I’ve read all Matlab entrys on adding/creating categories and/or labels but I haven’t found something fitting that works for me. I have a set of data in 178×13 double format, the variable names in a 1×13 cell format and the group classification in a 178×1 double, which ist just 1 2 and 3. In different projects I had a 178×1 cell instead containing the names of the groups and I would use that to generate a double using findgroups. However, now I would like to do the reverse action and generate a 178×1 cell value with the names instead of numbers. Num2Cell does not work here of course because I would like to tell Matlab to put "GroupA" for every 1 in the group classification 178×1 double and "GroupB" for every 2 and GroupC for every 3. I have information that the first 59 belog to GroupA etc, but I don’t know how to implement that either. Maybe it’s the language barrier but I really don’t even know what to search for anymore. Any help is much appreciated! groups, classes, label MATLAB Answers — New Questions
大学とMathworks間のライセンスでmatlabをserver上で動作させていましたが、突然、ライセンスexpireとのmessage(License Manager Error -10)が出て動作しません。
東京大学ーMathworks間のライセンスの下で私のアカウントで稼働していたmatlabが急に以下のmessageが出て動かなくなりました。
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$ matlab
License checkout failed.
License Manager Error -10
Your license for MATLAB has expired.
If you are not using a trial license contact your License Administrator to obtain an updated license.
Otherwise, contact your Sales Representative for a trial extension.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/10
Diagnostic Information:
Feature: MATLAB
License path: /home/sekigh/.matlab/R2023a_licenses/license_1de7b0766802_40790257_R2023a.lic:/usr/local/MATLAB/R2023a/licenses/license.dat:/usr/local/MATLAB/R2023a/licenses
Licensing error: -10,32.
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$
このserver以外でも私のアカウントでmatlabが2台installされており、それは正常に稼働しています。ライセンスをactivateする方法を教授ください。東京大学ーMathworks間のライセンスの下で私のアカウントで稼働していたmatlabが急に以下のmessageが出て動かなくなりました。
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$ matlab
License checkout failed.
License Manager Error -10
Your license for MATLAB has expired.
If you are not using a trial license contact your License Administrator to obtain an updated license.
Otherwise, contact your Sales Representative for a trial extension.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/10
Diagnostic Information:
Feature: MATLAB
License path: /home/sekigh/.matlab/R2023a_licenses/license_1de7b0766802_40790257_R2023a.lic:/usr/local/MATLAB/R2023a/licenses/license.dat:/usr/local/MATLAB/R2023a/licenses
Licensing error: -10,32.
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$
このserver以外でも私のアカウントでmatlabが2台installされており、それは正常に稼働しています。ライセンスをactivateする方法を教授ください。 東京大学ーMathworks間のライセンスの下で私のアカウントで稼働していたmatlabが急に以下のmessageが出て動かなくなりました。
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$ matlab
License checkout failed.
License Manager Error -10
Your license for MATLAB has expired.
If you are not using a trial license contact your License Administrator to obtain an updated license.
Otherwise, contact your Sales Representative for a trial extension.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/10
Diagnostic Information:
Feature: MATLAB
License path: /home/sekigh/.matlab/R2023a_licenses/license_1de7b0766802_40790257_R2023a.lic:/usr/local/MATLAB/R2023a/licenses/license.dat:/usr/local/MATLAB/R2023a/licenses
Licensing error: -10,32.
(anaconda3-2022.05)sekigh@1de7b0766802:/external_disk_3/container_3/home/sekigh/Windowsfolder$
このserver以外でも私のアカウントでmatlabが2台installされており、それは正常に稼働しています。ライセンスをactivateする方法を教授ください。 ライセンス エクスパイア MATLAB Answers — New Questions
Control quiver arrow head width vs height.
Hi, I have a quiver plot where the arrow heads are incredibly wide by default, so I used "MaxHeadSize" to shrink them to a reasonable size. Also, the scaling behavior is set to 0 because I want them to connect the way they do currently. The downside is that now, instead of looking like arrowheads, they almost look like horizontal bars. I’m wondering if there is a way to control the head length independently of the head width.Hi, I have a quiver plot where the arrow heads are incredibly wide by default, so I used "MaxHeadSize" to shrink them to a reasonable size. Also, the scaling behavior is set to 0 because I want them to connect the way they do currently. The downside is that now, instead of looking like arrowheads, they almost look like horizontal bars. I’m wondering if there is a way to control the head length independently of the head width. Hi, I have a quiver plot where the arrow heads are incredibly wide by default, so I used "MaxHeadSize" to shrink them to a reasonable size. Also, the scaling behavior is set to 0 because I want them to connect the way they do currently. The downside is that now, instead of looking like arrowheads, they almost look like horizontal bars. I’m wondering if there is a way to control the head length independently of the head width. quiver, matlab, graph MATLAB Answers — New Questions
How to search array in array same values?
Hello,
I create an array below;
bigArray = rand(1,150);
bigArray(1,15:19) = [1 1 1 1 1]’;
bigArray(1,25:29) = [1 1 1 1 1]’;
bigArray(1,75:79) = [1 1 1 1 1]’;
bigArray(1,105:109) = [1 1 1 1 1]’;
bigArray(1,65) = 1;
bigArray(1,5:6) = [1 1]’;
I want to find [1 1 1 1 1]’ array indexes. But I run the code;
idx = find(ismember(bigArray,[1 1 1 1 1]’))
I want to see as an output; [15 16 17 18 19 25 26 27 28 29 75 76 77 78 79 105 106 107 108 109]Hello,
I create an array below;
bigArray = rand(1,150);
bigArray(1,15:19) = [1 1 1 1 1]’;
bigArray(1,25:29) = [1 1 1 1 1]’;
bigArray(1,75:79) = [1 1 1 1 1]’;
bigArray(1,105:109) = [1 1 1 1 1]’;
bigArray(1,65) = 1;
bigArray(1,5:6) = [1 1]’;
I want to find [1 1 1 1 1]’ array indexes. But I run the code;
idx = find(ismember(bigArray,[1 1 1 1 1]’))
I want to see as an output; [15 16 17 18 19 25 26 27 28 29 75 76 77 78 79 105 106 107 108 109] Hello,
I create an array below;
bigArray = rand(1,150);
bigArray(1,15:19) = [1 1 1 1 1]’;
bigArray(1,25:29) = [1 1 1 1 1]’;
bigArray(1,75:79) = [1 1 1 1 1]’;
bigArray(1,105:109) = [1 1 1 1 1]’;
bigArray(1,65) = 1;
bigArray(1,5:6) = [1 1]’;
I want to find [1 1 1 1 1]’ array indexes. But I run the code;
idx = find(ismember(bigArray,[1 1 1 1 1]’))
I want to see as an output; [15 16 17 18 19 25 26 27 28 29 75 76 77 78 79 105 106 107 108 109] matlab, array, find, indexing MATLAB Answers — New Questions