Tag Archives: matlab
Trail Version – Invalid Activation Key(379)
I am trying to use the trail version but I am getting this Invalid Activation Key (379) error.
I just created a new gmail for the trail and never installed on any other device. I created matlab account and downloaded the trail version installer which gave me this error when trying to login to installI am trying to use the trail version but I am getting this Invalid Activation Key (379) error.
I just created a new gmail for the trail and never installed on any other device. I created matlab account and downloaded the trail version installer which gave me this error when trying to login to install I am trying to use the trail version but I am getting this Invalid Activation Key (379) error.
I just created a new gmail for the trail and never installed on any other device. I created matlab account and downloaded the trail version installer which gave me this error when trying to login to install trail, invalid licence key, 379, error 379 MATLAB Answers — New Questions
How correctly use Simple Variable Mass 3DOF (Body Axes) block?
Hello,
As in the title, I need to simulate an aircraft mission with varying mass. In the Aerospace Blockset, I’ve so found the Simple Variable Mass (3DOF). I have some problems in interpreting these inertia definitions:
Empty inertia — Body inertia when fuel tank is full
0.5 (default) | scalar
Body inertia when the fuel tank is full, specified as a double scalar.
and
Full inertia — Full inertia
3.0 (default) | scalar
Full inertia of the body, specified as a scalar.
My concerns involves the difference between Empty and full inertia. From the documentation, they seem to be the same. Can anyone help me?
Thanks.Hello,
As in the title, I need to simulate an aircraft mission with varying mass. In the Aerospace Blockset, I’ve so found the Simple Variable Mass (3DOF). I have some problems in interpreting these inertia definitions:
Empty inertia — Body inertia when fuel tank is full
0.5 (default) | scalar
Body inertia when the fuel tank is full, specified as a double scalar.
and
Full inertia — Full inertia
3.0 (default) | scalar
Full inertia of the body, specified as a scalar.
My concerns involves the difference between Empty and full inertia. From the documentation, they seem to be the same. Can anyone help me?
Thanks. Hello,
As in the title, I need to simulate an aircraft mission with varying mass. In the Aerospace Blockset, I’ve so found the Simple Variable Mass (3DOF). I have some problems in interpreting these inertia definitions:
Empty inertia — Body inertia when fuel tank is full
0.5 (default) | scalar
Body inertia when the fuel tank is full, specified as a double scalar.
and
Full inertia — Full inertia
3.0 (default) | scalar
Full inertia of the body, specified as a scalar.
My concerns involves the difference between Empty and full inertia. From the documentation, they seem to be the same. Can anyone help me?
Thanks. 3dof, varying mass, aerospace, simulink, simulation MATLAB Answers — New Questions
Simulink Variable Time Logging
Hi,
is it possible to get a simulink "to workspace" block to log the data with variable time steps? I have a model in which some parameters are used to send it to hardware and the testrig is basically controlled with my model. For some commands I send to the testrig it is not really useful to have the logged within the sample time I have for my model, for example some preparation steps when I change the temperature, which could take quite long. I tried to have the different sample times in a varaible in the base workspace and after the command in simulink/ stateflow is processed the variable is changed. I had the variable of the sample time in my "to workspace" block, and it seemed to work sometimes to refresh the block and it changed to a new sample time, but it kept it that way for the whole simulation. Do you have any suggestions on how I could do this or maybe a better way to do this?Hi,
is it possible to get a simulink "to workspace" block to log the data with variable time steps? I have a model in which some parameters are used to send it to hardware and the testrig is basically controlled with my model. For some commands I send to the testrig it is not really useful to have the logged within the sample time I have for my model, for example some preparation steps when I change the temperature, which could take quite long. I tried to have the different sample times in a varaible in the base workspace and after the command in simulink/ stateflow is processed the variable is changed. I had the variable of the sample time in my "to workspace" block, and it seemed to work sometimes to refresh the block and it changed to a new sample time, but it kept it that way for the whole simulation. Do you have any suggestions on how I could do this or maybe a better way to do this? Hi,
is it possible to get a simulink "to workspace" block to log the data with variable time steps? I have a model in which some parameters are used to send it to hardware and the testrig is basically controlled with my model. For some commands I send to the testrig it is not really useful to have the logged within the sample time I have for my model, for example some preparation steps when I change the temperature, which could take quite long. I tried to have the different sample times in a varaible in the base workspace and after the command in simulink/ stateflow is processed the variable is changed. I had the variable of the sample time in my "to workspace" block, and it seemed to work sometimes to refresh the block and it changed to a new sample time, but it kept it that way for the whole simulation. Do you have any suggestions on how I could do this or maybe a better way to do this? variable logging time, sample time, simulink MATLAB Answers — New Questions
Robot arms 3RRR Kinematics and forward kinematics
Hey i need a help or some file with Kinematics and forward kinematics for
manipulator arm i mean 3RRR
i will really happy when someone can help me
wait for answerHey i need a help or some file with Kinematics and forward kinematics for
manipulator arm i mean 3RRR
i will really happy when someone can help me
wait for answer Hey i need a help or some file with Kinematics and forward kinematics for
manipulator arm i mean 3RRR
i will really happy when someone can help me
wait for answer rrr, kinematics, 3rrr, forward kinematics, rrr kinematics matlab MATLAB Answers — New Questions
acousticLoudness() function incorrect?
I decided to verify acousticLoudness function using ISO532-1 test method using ISO provided test signals and compare to stated sone levels.
According to ISO532-1 test signal wav data should be calibrated: " For the calibration of the WAVE files, 0 dB (relative to full scale) shall correspond to a sound pressure level of 100 dB." The calibration factor works out to be =2. This could be immediately verified by comparing test frequency amplitude after calibration with file name e.g. "Test signal 6 (tone 250 Hz 30 dB – 80 dB).wav". The max amplitude is 0.2 Pa (80dB).
I used these function parameters to calculate loudness of time varying noise signals:
LoudnessISO532=acousticLoudness(signal,48000,’SoundField’,’free’,’TimeVarying’,true);
acousticLoudness() produces loudness nearly twice the value of the ISO calculation. I discovered, however, that if I do not calibrate the wav file, function produces correct results.
Thus, it seems to me, to obtain correct results, calibrated SPL (Pa) signal should be reduced by half.
Did anybody try to verify the function using ISO532-1 test wav files? Did you calibrate them?
Thanks!I decided to verify acousticLoudness function using ISO532-1 test method using ISO provided test signals and compare to stated sone levels.
According to ISO532-1 test signal wav data should be calibrated: " For the calibration of the WAVE files, 0 dB (relative to full scale) shall correspond to a sound pressure level of 100 dB." The calibration factor works out to be =2. This could be immediately verified by comparing test frequency amplitude after calibration with file name e.g. "Test signal 6 (tone 250 Hz 30 dB – 80 dB).wav". The max amplitude is 0.2 Pa (80dB).
I used these function parameters to calculate loudness of time varying noise signals:
LoudnessISO532=acousticLoudness(signal,48000,’SoundField’,’free’,’TimeVarying’,true);
acousticLoudness() produces loudness nearly twice the value of the ISO calculation. I discovered, however, that if I do not calibrate the wav file, function produces correct results.
Thus, it seems to me, to obtain correct results, calibrated SPL (Pa) signal should be reduced by half.
Did anybody try to verify the function using ISO532-1 test wav files? Did you calibrate them?
Thanks! I decided to verify acousticLoudness function using ISO532-1 test method using ISO provided test signals and compare to stated sone levels.
According to ISO532-1 test signal wav data should be calibrated: " For the calibration of the WAVE files, 0 dB (relative to full scale) shall correspond to a sound pressure level of 100 dB." The calibration factor works out to be =2. This could be immediately verified by comparing test frequency amplitude after calibration with file name e.g. "Test signal 6 (tone 250 Hz 30 dB – 80 dB).wav". The max amplitude is 0.2 Pa (80dB).
I used these function parameters to calculate loudness of time varying noise signals:
LoudnessISO532=acousticLoudness(signal,48000,’SoundField’,’free’,’TimeVarying’,true);
acousticLoudness() produces loudness nearly twice the value of the ISO calculation. I discovered, however, that if I do not calibrate the wav file, function produces correct results.
Thus, it seems to me, to obtain correct results, calibrated SPL (Pa) signal should be reduced by half.
Did anybody try to verify the function using ISO532-1 test wav files? Did you calibrate them?
Thanks! acousticloudness MATLAB Answers — New Questions
Is it possible to remove 2-3 endmember spectral lines from a spectral plot, and how?
I plotted a spectral plot of 9 endmembers, from this I need to remove spectral lines 2, 4 and 5 or select other lines.
.I plotted a spectral plot of 9 endmembers, from this I need to remove spectral lines 2, 4 and 5 or select other lines.
. I plotted a spectral plot of 9 endmembers, from this I need to remove spectral lines 2, 4 and 5 or select other lines.
. hyperspectral image processing MATLAB Answers — New Questions
Write script matlab for solving the convection-diffusion equation of a compound in a 3D annular reactor (diffusion in two directions with convection)
hello,
I would like help to write a matlab for solving the convection-diffusion equation of a compound in a 3D annular reactor (diffusion in two directions r and teta with convective transport in the main direction, see figure below) with a reaction on the surface of inner cylinder. The elements of the problem are as follows:
a 3D model is proposed. This model is based on a convection / radial diffusion principle in the annular space of the reactor. The mass balance in the gas phase can be written (eq. (1)):
(1)
0 < z < L
Inlet concentration : C0=4.5 10-5 mol.m-3
Where r is radial coordinate (m), z is axial coordinate, u is flow velocity (m s-1) and C, is the concentration of NCl3 (mol m-3).
The model takes the velocity profile developed in the annular space into account, as expressed by the following relationship:
(2)
With
(3)
z=1m
Um=0.5m s-1
ri=0.04m, the internal radius
re=0.05m, the external radius of reactor (m).
Boundary conditions are:
at the inner surface of the external cylinder, r=re:
(4)
at the catalyst surface, r=ri,
(5)
Where rp is the photocatalytic rate (mol m-2 s-1).
(6)
I=9.8 W m-2, n =1, kp = 2.6×10-6 mol s-1 W-1and Kp = 3x103m3 mol-1.
and for and
Thank you very much for your helphello,
I would like help to write a matlab for solving the convection-diffusion equation of a compound in a 3D annular reactor (diffusion in two directions r and teta with convective transport in the main direction, see figure below) with a reaction on the surface of inner cylinder. The elements of the problem are as follows:
a 3D model is proposed. This model is based on a convection / radial diffusion principle in the annular space of the reactor. The mass balance in the gas phase can be written (eq. (1)):
(1)
0 < z < L
Inlet concentration : C0=4.5 10-5 mol.m-3
Where r is radial coordinate (m), z is axial coordinate, u is flow velocity (m s-1) and C, is the concentration of NCl3 (mol m-3).
The model takes the velocity profile developed in the annular space into account, as expressed by the following relationship:
(2)
With
(3)
z=1m
Um=0.5m s-1
ri=0.04m, the internal radius
re=0.05m, the external radius of reactor (m).
Boundary conditions are:
at the inner surface of the external cylinder, r=re:
(4)
at the catalyst surface, r=ri,
(5)
Where rp is the photocatalytic rate (mol m-2 s-1).
(6)
I=9.8 W m-2, n =1, kp = 2.6×10-6 mol s-1 W-1and Kp = 3x103m3 mol-1.
and for and
Thank you very much for your help hello,
I would like help to write a matlab for solving the convection-diffusion equation of a compound in a 3D annular reactor (diffusion in two directions r and teta with convective transport in the main direction, see figure below) with a reaction on the surface of inner cylinder. The elements of the problem are as follows:
a 3D model is proposed. This model is based on a convection / radial diffusion principle in the annular space of the reactor. The mass balance in the gas phase can be written (eq. (1)):
(1)
0 < z < L
Inlet concentration : C0=4.5 10-5 mol.m-3
Where r is radial coordinate (m), z is axial coordinate, u is flow velocity (m s-1) and C, is the concentration of NCl3 (mol m-3).
The model takes the velocity profile developed in the annular space into account, as expressed by the following relationship:
(2)
With
(3)
z=1m
Um=0.5m s-1
ri=0.04m, the internal radius
re=0.05m, the external radius of reactor (m).
Boundary conditions are:
at the inner surface of the external cylinder, r=re:
(4)
at the catalyst surface, r=ri,
(5)
Where rp is the photocatalytic rate (mol m-2 s-1).
(6)
I=9.8 W m-2, n =1, kp = 2.6×10-6 mol s-1 W-1and Kp = 3x103m3 mol-1.
and for and
Thank you very much for your help convection_diffusin model, annular reactor 3d MATLAB Answers — New Questions
How to create 3D contour plot of a set of data consisting of series of points x,y,z with a quantity V(x,yz)?
I have a set of data consisting of coordinates x,y,z and the value of a quantity V at each of these points.
like
x,y,z,V
1,3,5,9
3,5,7,-9
……
-4,6,2,1
I need to plot contours of V at the coordinates x,y,z. the number of different x values is NOT equal to the number of different y values.
Any help would be appriciated.
Thank youI have a set of data consisting of coordinates x,y,z and the value of a quantity V at each of these points.
like
x,y,z,V
1,3,5,9
3,5,7,-9
……
-4,6,2,1
I need to plot contours of V at the coordinates x,y,z. the number of different x values is NOT equal to the number of different y values.
Any help would be appriciated.
Thank you I have a set of data consisting of coordinates x,y,z and the value of a quantity V at each of these points.
like
x,y,z,V
1,3,5,9
3,5,7,-9
……
-4,6,2,1
I need to plot contours of V at the coordinates x,y,z. the number of different x values is NOT equal to the number of different y values.
Any help would be appriciated.
Thank you contour, 3d plots MATLAB Answers — New Questions
How do I get num, txt and raw as a cell array or matrix or table from the “readtable(file_name)” command, without using “[num,txt,raw]=xlsread(file_name)”
How do I get num, txt and raw as a cell array/matrix/table from the “readtable(file_name)” command. The alternative command “[num,txt,raw]=xlsread(file_name)” couldn’t be used as it is not recommended by Matlab and requires basic excel (which is decommissioned in our company). So please guide me in this case, Thankyou.
[num,txt,raw] = xlsread(___): num returns the numeric data in a matrix. additionally returns the text fields in cell array txt, and both numeric and text data in cell array raw.How do I get num, txt and raw as a cell array/matrix/table from the “readtable(file_name)” command. The alternative command “[num,txt,raw]=xlsread(file_name)” couldn’t be used as it is not recommended by Matlab and requires basic excel (which is decommissioned in our company). So please guide me in this case, Thankyou.
[num,txt,raw] = xlsread(___): num returns the numeric data in a matrix. additionally returns the text fields in cell array txt, and both numeric and text data in cell array raw. How do I get num, txt and raw as a cell array/matrix/table from the “readtable(file_name)” command. The alternative command “[num,txt,raw]=xlsread(file_name)” couldn’t be used as it is not recommended by Matlab and requires basic excel (which is decommissioned in our company). So please guide me in this case, Thankyou.
[num,txt,raw] = xlsread(___): num returns the numeric data in a matrix. additionally returns the text fields in cell array txt, and both numeric and text data in cell array raw. readtable, xlsread, importing excel data MATLAB Answers — New Questions
How to set timeout to a function
Hi everyone, I need to stop the execution of a function if finish a specific time. Specifically the part of the program where i need to implement it is when i call a function to create a regressor:
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
I have left the program running and it never finish the function so i wanted to exit the function and continue the rest of the program. The function works because i change the data "T" that i insert in the function and i get a trainedModel with its value but with long data T i think no works.
There is a example that i need to do but with try- catch doesnt work:
try
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
catch (*time out finish*)
validationRMSE = "Error";
trainedModel = [];
end
I find some information how said that i need to use parallel pool, batch(), parfeval() or a timer but i dont understand what function is useful for my situation. I already use parallel pool with 4 workers because is better to train regressor but to apply the time out no idea.
Thanks so much for the help and sorry if I have explained badly because the english is not my native language.Hi everyone, I need to stop the execution of a function if finish a specific time. Specifically the part of the program where i need to implement it is when i call a function to create a regressor:
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
I have left the program running and it never finish the function so i wanted to exit the function and continue the rest of the program. The function works because i change the data "T" that i insert in the function and i get a trainedModel with its value but with long data T i think no works.
There is a example that i need to do but with try- catch doesnt work:
try
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
catch (*time out finish*)
validationRMSE = "Error";
trainedModel = [];
end
I find some information how said that i need to use parallel pool, batch(), parfeval() or a timer but i dont understand what function is useful for my situation. I already use parallel pool with 4 workers because is better to train regressor but to apply the time out no idea.
Thanks so much for the help and sorry if I have explained badly because the english is not my native language. Hi everyone, I need to stop the execution of a function if finish a specific time. Specifically the part of the program where i need to implement it is when i call a function to create a regressor:
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
I have left the program running and it never finish the function so i wanted to exit the function and continue the rest of the program. The function works because i change the data "T" that i insert in the function and i get a trainedModel with its value but with long data T i think no works.
There is a example that i need to do but with try- catch doesnt work:
try
[trainedModel, validationRMSE] = trainRegressionModelLinear(T, KFolds);
catch (*time out finish*)
validationRMSE = "Error";
trainedModel = [];
end
I find some information how said that i need to use parallel pool, batch(), parfeval() or a timer but i dont understand what function is useful for my situation. I already use parallel pool with 4 workers because is better to train regressor but to apply the time out no idea.
Thanks so much for the help and sorry if I have explained badly because the english is not my native language. time, regressor, time out, timer, train regressor MATLAB Answers — New Questions
How to control PWM servo driver for arduino from Simulink?
I’m looking for libraries/support to control a PWM driver module (PCA9685) connected to arduino from Simulink. I’m not very skilled with the Arduino add on, so I don’t really know how to send I2C commands to the module fromSimulink.I’m looking for libraries/support to control a PWM driver module (PCA9685) connected to arduino from Simulink. I’m not very skilled with the Arduino add on, so I don’t really know how to send I2C commands to the module fromSimulink. I’m looking for libraries/support to control a PWM driver module (PCA9685) connected to arduino from Simulink. I’m not very skilled with the Arduino add on, so I don’t really know how to send I2C commands to the module fromSimulink. pca9685, simulink MATLAB Answers — New Questions
Is there any command for .xlsx file to import directly to Signal Builder.
I have some inputs recived from user in .xlsx file need to import it into Signal Builder using commands. It can be done manually but i need it with commands which can be done automatically.
Steps:
a. xlsx file needs to be imported from other folders of Desktop.
b. While importing .xlsx file which needs path.
c. Then it should select sheets and replace existing data–> apply –> ok.I have some inputs recived from user in .xlsx file need to import it into Signal Builder using commands. It can be done manually but i need it with commands which can be done automatically.
Steps:
a. xlsx file needs to be imported from other folders of Desktop.
b. While importing .xlsx file which needs path.
c. Then it should select sheets and replace existing data–> apply –> ok. I have some inputs recived from user in .xlsx file need to import it into Signal Builder using commands. It can be done manually but i need it with commands which can be done automatically.
Steps:
a. xlsx file needs to be imported from other folders of Desktop.
b. While importing .xlsx file which needs path.
c. Then it should select sheets and replace existing data–> apply –> ok. m-scripting, signal builder, simulink, matlab MATLAB Answers — New Questions
tic toc delayed output inside for loop
I want to use the tic toc function to time each iteration of a for loop. Usually, this outputs the time as "Elapsed time is … seconds." in the command window after each loop iteration. So for the following example code there would be an output approximately every 0.1 seconds on my machine.
for j = 1:20
tic
eig(rand(500));
toc
end
However, since a few days the outputs to the command window are only made after the loop finishes and I get all the 20 outputs for the 20 iterations at once in the end. I don’t understand why this changed, I didn’t (knowingly) change any settings and couldn’t find anything, so maybe it is a bug? I updated my release version hoping that would fix it, but it didn’t. I know that this behavior happens when you use tic toc inside a for loop, while a parallel pool is open, but in this case there is no parallel pool. Is there something I can do to get the old behavior where the elapsed time is printed to the command window after each iteration?I want to use the tic toc function to time each iteration of a for loop. Usually, this outputs the time as "Elapsed time is … seconds." in the command window after each loop iteration. So for the following example code there would be an output approximately every 0.1 seconds on my machine.
for j = 1:20
tic
eig(rand(500));
toc
end
However, since a few days the outputs to the command window are only made after the loop finishes and I get all the 20 outputs for the 20 iterations at once in the end. I don’t understand why this changed, I didn’t (knowingly) change any settings and couldn’t find anything, so maybe it is a bug? I updated my release version hoping that would fix it, but it didn’t. I know that this behavior happens when you use tic toc inside a for loop, while a parallel pool is open, but in this case there is no parallel pool. Is there something I can do to get the old behavior where the elapsed time is printed to the command window after each iteration? I want to use the tic toc function to time each iteration of a for loop. Usually, this outputs the time as "Elapsed time is … seconds." in the command window after each loop iteration. So for the following example code there would be an output approximately every 0.1 seconds on my machine.
for j = 1:20
tic
eig(rand(500));
toc
end
However, since a few days the outputs to the command window are only made after the loop finishes and I get all the 20 outputs for the 20 iterations at once in the end. I don’t understand why this changed, I didn’t (knowingly) change any settings and couldn’t find anything, so maybe it is a bug? I updated my release version hoping that would fix it, but it didn’t. I know that this behavior happens when you use tic toc inside a for loop, while a parallel pool is open, but in this case there is no parallel pool. Is there something I can do to get the old behavior where the elapsed time is printed to the command window after each iteration? timing, for loop MATLAB Answers — New Questions
How to log out of matlab drive account?
I have two matlab accounts and two PCs, each PC with an account. Recently I need to synchronize my m files, so I tried to use matlab drive. I logged out of my first account from one PC and logged in another one, but the account on matlab drive (which should also log out) remained unchanged even if I had restarted the PC. There also seems no setup on Matlab Connector for log in and out.I have two matlab accounts and two PCs, each PC with an account. Recently I need to synchronize my m files, so I tried to use matlab drive. I logged out of my first account from one PC and logged in another one, but the account on matlab drive (which should also log out) remained unchanged even if I had restarted the PC. There also seems no setup on Matlab Connector for log in and out. I have two matlab accounts and two PCs, each PC with an account. Recently I need to synchronize my m files, so I tried to use matlab drive. I logged out of my first account from one PC and logged in another one, but the account on matlab drive (which should also log out) remained unchanged even if I had restarted the PC. There also seems no setup on Matlab Connector for log in and out. matlab drive, account, matlab connector MATLAB Answers — New Questions
How to set YLim for multiple Yaxis on UIaxes
I am plotting a figure using uiaxes in app designer with 2 y axis one on the left and other on the right. And I am trying to set YLim for both left and right. But the code I wrote was wrong. The one I right for the right is overwriting the one on the left. So technically I am only setting YLim for the left one.
yyaxis(app.UIAxes_4,’left’);
plot(app.UIAxes_4,app.actualTime,app.Charge_Current);
app.UIAxes_4.XMinorGrid ="on";
app.UIAxes_4.YMinorGrid ="on";
app.UIAxes_4.YLabel.String = ‘Current [A]’;
app.UIAxes_4.YLabel.FontSize = 12;
app.UIAxes_4.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y1min app.Y1max]; % This sets the YLim correctly for the left side
yyaxis(app.UIAxes,’right’);
plot(app.UIAxes,app.actualTime,voltage);
app.UIAxes.XMinorGrid ="on";
app.UIAxes.YMinorGrid ="on";
app.UIAxes.YLabel.String = ‘Current [A]’;
app.UIAxes.YLabel.FontSize = 12;
app.UIAxes.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y2min app.Y2max]; % This overrides the Ylim set earlier and sets a new YLim for
% left side without setting
% Ylim for the right side.
What is the way to set Ylim on both left and right. Thank you.I am plotting a figure using uiaxes in app designer with 2 y axis one on the left and other on the right. And I am trying to set YLim for both left and right. But the code I wrote was wrong. The one I right for the right is overwriting the one on the left. So technically I am only setting YLim for the left one.
yyaxis(app.UIAxes_4,’left’);
plot(app.UIAxes_4,app.actualTime,app.Charge_Current);
app.UIAxes_4.XMinorGrid ="on";
app.UIAxes_4.YMinorGrid ="on";
app.UIAxes_4.YLabel.String = ‘Current [A]’;
app.UIAxes_4.YLabel.FontSize = 12;
app.UIAxes_4.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y1min app.Y1max]; % This sets the YLim correctly for the left side
yyaxis(app.UIAxes,’right’);
plot(app.UIAxes,app.actualTime,voltage);
app.UIAxes.XMinorGrid ="on";
app.UIAxes.YMinorGrid ="on";
app.UIAxes.YLabel.String = ‘Current [A]’;
app.UIAxes.YLabel.FontSize = 12;
app.UIAxes.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y2min app.Y2max]; % This overrides the Ylim set earlier and sets a new YLim for
% left side without setting
% Ylim for the right side.
What is the way to set Ylim on both left and right. Thank you. I am plotting a figure using uiaxes in app designer with 2 y axis one on the left and other on the right. And I am trying to set YLim for both left and right. But the code I wrote was wrong. The one I right for the right is overwriting the one on the left. So technically I am only setting YLim for the left one.
yyaxis(app.UIAxes_4,’left’);
plot(app.UIAxes_4,app.actualTime,app.Charge_Current);
app.UIAxes_4.XMinorGrid ="on";
app.UIAxes_4.YMinorGrid ="on";
app.UIAxes_4.YLabel.String = ‘Current [A]’;
app.UIAxes_4.YLabel.FontSize = 12;
app.UIAxes_4.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y1min app.Y1max]; % This sets the YLim correctly for the left side
yyaxis(app.UIAxes,’right’);
plot(app.UIAxes,app.actualTime,voltage);
app.UIAxes.XMinorGrid ="on";
app.UIAxes.YMinorGrid ="on";
app.UIAxes.YLabel.String = ‘Current [A]’;
app.UIAxes.YLabel.FontSize = 12;
app.UIAxes.YLabel.FontWeight ="bold";
app.UIAxes_4.YLim = [app.Y2min app.Y2max]; % This overrides the Ylim set earlier and sets a new YLim for
% left side without setting
% Ylim for the right side.
What is the way to set Ylim on both left and right. Thank you. matlab, appdesigner MATLAB Answers — New Questions
Inline equation in MATLAB Document object
Hi everyone,
The MATLAB RPT doc example shows how to put inline equation into a Report.
However, I am not using Report. I am just using Document. Can I do inline equation in a Document object?
Thanks
KevinHi everyone,
The MATLAB RPT doc example shows how to put inline equation into a Report.
However, I am not using Report. I am just using Document. Can I do inline equation in a Document object?
Thanks
Kevin Hi everyone,
The MATLAB RPT doc example shows how to put inline equation into a Report.
However, I am not using Report. I am just using Document. Can I do inline equation in a Document object?
Thanks
Kevin inline equation MATLAB Answers — New Questions
Label more than 7 lines in a plot
Hi,
I am realizing that after 7 lines, Matlab seems to run out of colors for graphs and legends..is that
correct? Currently I am plotting the following:
plot(matA);
legend(‘1.’,’2.’,’3.’,’4.’,’5.’,’6.’,’7.’,’8.’);
xlabel(‘Timepoints’);
ylabel(‘Sources’);
matA is a 200×8 matrix, but after plotting I see that the lines 1 and 8 both have the same colors..what
is the easiest way out?
ThanksHi,
I am realizing that after 7 lines, Matlab seems to run out of colors for graphs and legends..is that
correct? Currently I am plotting the following:
plot(matA);
legend(‘1.’,’2.’,’3.’,’4.’,’5.’,’6.’,’7.’,’8.’);
xlabel(‘Timepoints’);
ylabel(‘Sources’);
matA is a 200×8 matrix, but after plotting I see that the lines 1 and 8 both have the same colors..what
is the easiest way out?
Thanks Hi,
I am realizing that after 7 lines, Matlab seems to run out of colors for graphs and legends..is that
correct? Currently I am plotting the following:
plot(matA);
legend(‘1.’,’2.’,’3.’,’4.’,’5.’,’6.’,’7.’,’8.’);
xlabel(‘Timepoints’);
ylabel(‘Sources’);
matA is a 200×8 matrix, but after plotting I see that the lines 1 and 8 both have the same colors..what
is the easiest way out?
Thanks plot MATLAB Answers — New Questions
Contour plot with polar stereoghapic projection in north hemispehere above 60 degree latitude
Hi,
I have ut(24), lat(24) and z (24×24); data attached as .mat. I want to plot a contour plot in polar stereographic projection for northern hemisphere above 60 degree latitude (something like attached ). I tried with m_map polar sterographic projection.
m_proj(‘stereographic’,’lat’,90,’long’,30,’radius’,60);
m_elev(‘contour’,[0:0.00009:1],’edgecolor’,’b’);
m_grid(‘xtick’,12,’tickdir’,’in’,’ytick’,[60:10:90],’linest’,’-‘);
m_coast(‘linewidth’,1,’linestyle’,’-‘,’color’,’k’);
I got the image as completely different.
I also tried using like https://jp.mathworks.com/matlabcentral/answers/170145-how-to-plot-contourf-data-on-m-map-polar-stereographic-projection, the plot it is not in sterographic projection. Can anyone help.Hi,
I have ut(24), lat(24) and z (24×24); data attached as .mat. I want to plot a contour plot in polar stereographic projection for northern hemisphere above 60 degree latitude (something like attached ). I tried with m_map polar sterographic projection.
m_proj(‘stereographic’,’lat’,90,’long’,30,’radius’,60);
m_elev(‘contour’,[0:0.00009:1],’edgecolor’,’b’);
m_grid(‘xtick’,12,’tickdir’,’in’,’ytick’,[60:10:90],’linest’,’-‘);
m_coast(‘linewidth’,1,’linestyle’,’-‘,’color’,’k’);
I got the image as completely different.
I also tried using like https://jp.mathworks.com/matlabcentral/answers/170145-how-to-plot-contourf-data-on-m-map-polar-stereographic-projection, the plot it is not in sterographic projection. Can anyone help. Hi,
I have ut(24), lat(24) and z (24×24); data attached as .mat. I want to plot a contour plot in polar stereographic projection for northern hemisphere above 60 degree latitude (something like attached ). I tried with m_map polar sterographic projection.
m_proj(‘stereographic’,’lat’,90,’long’,30,’radius’,60);
m_elev(‘contour’,[0:0.00009:1],’edgecolor’,’b’);
m_grid(‘xtick’,12,’tickdir’,’in’,’ytick’,[60:10:90],’linest’,’-‘);
m_coast(‘linewidth’,1,’linestyle’,’-‘,’color’,’k’);
I got the image as completely different.
I also tried using like https://jp.mathworks.com/matlabcentral/answers/170145-how-to-plot-contourf-data-on-m-map-polar-stereographic-projection, the plot it is not in sterographic projection. Can anyone help. contourf, stereographic, polar, matlab2023a MATLAB Answers — New Questions
Issue with DTC of PMSM at 40kHz PWM Frequency
I are currently using "Direct Torque Control of PMSM Using Quadrature Encoder or Sensorless Flux Observer" example for high-speed PMSM motor control. The system works perfectly at 20kHz, but when I increase the PWM frequency to 40kHz, I encounter an issue with the reference speed in the host model.
For example, when I set the reference speed to 500 RPM, the host model incorrectly shows 6500 RPM. It appears that the instructed or reference speed is getting corrupted during transmission or processing. I’ve attempted various solutions, including adjusting the baud rate, hardware interrupts, and hardware initialization settings, but the issue persists.I are currently using "Direct Torque Control of PMSM Using Quadrature Encoder or Sensorless Flux Observer" example for high-speed PMSM motor control. The system works perfectly at 20kHz, but when I increase the PWM frequency to 40kHz, I encounter an issue with the reference speed in the host model.
For example, when I set the reference speed to 500 RPM, the host model incorrectly shows 6500 RPM. It appears that the instructed or reference speed is getting corrupted during transmission or processing. I’ve attempted various solutions, including adjusting the baud rate, hardware interrupts, and hardware initialization settings, but the issue persists. I are currently using "Direct Torque Control of PMSM Using Quadrature Encoder or Sensorless Flux Observer" example for high-speed PMSM motor control. The system works perfectly at 20kHz, but when I increase the PWM frequency to 40kHz, I encounter an issue with the reference speed in the host model.
For example, when I set the reference speed to 500 RPM, the host model incorrectly shows 6500 RPM. It appears that the instructed or reference speed is getting corrupted during transmission or processing. I’ve attempted various solutions, including adjusting the baud rate, hardware interrupts, and hardware initialization settings, but the issue persists. dtc, 40khz pwm MATLAB Answers — New Questions
Trying to implement Vulnerable Road User scenario using SIMULINK
Hello Programmers,
Having gone through YouTube and ChatGpt, I observed there is no much details on using the ‘Autonomous Vehicle’ toolbox especially for VRU scenario. I was thinking of learning this for scenarios in the C-v2x. Any help?Hello Programmers,
Having gone through YouTube and ChatGpt, I observed there is no much details on using the ‘Autonomous Vehicle’ toolbox especially for VRU scenario. I was thinking of learning this for scenarios in the C-v2x. Any help? Hello Programmers,
Having gone through YouTube and ChatGpt, I observed there is no much details on using the ‘Autonomous Vehicle’ toolbox especially for VRU scenario. I was thinking of learning this for scenarios in the C-v2x. Any help? autonomous vehicle, vulnerable road user, simulink, c-v2x MATLAB Answers — New Questions