Tag Archives: matlab
Matlab course
Hi, I went through a course that I found through the mathworks website and I am having trouble finding the link back to the section where it listed all the courses where the course material had been uploaded online. Does anyone know where is is located?Hi, I went through a course that I found through the mathworks website and I am having trouble finding the link back to the section where it listed all the courses where the course material had been uploaded online. Does anyone know where is is located? Hi, I went through a course that I found through the mathworks website and I am having trouble finding the link back to the section where it listed all the courses where the course material had been uploaded online. Does anyone know where is is located? course MATLAB Answers — New Questions
“Error using parpool no space left on device” — even when there is enough space.
When I attempt to run my code, it immidiately fails with the warning:
“`
Error using parpool (line 133)
No space left on device
Error in testing (line 39)
parpool(2)
“`
Even though I have more than enough space available in my tmp folder and storage (>1TB).
What might be the cause of this error?When I attempt to run my code, it immidiately fails with the warning:
“`
Error using parpool (line 133)
No space left on device
Error in testing (line 39)
parpool(2)
“`
Even though I have more than enough space available in my tmp folder and storage (>1TB).
What might be the cause of this error? When I attempt to run my code, it immidiately fails with the warning:
“`
Error using parpool (line 133)
No space left on device
Error in testing (line 39)
parpool(2)
“`
Even though I have more than enough space available in my tmp folder and storage (>1TB).
What might be the cause of this error? parallel computing toolbox, parallel computing MATLAB Answers — New Questions
Linear actuator current simulation model
Hello,
I am trying to model a linear actuator in simscape matlab but have been quite unsuccessful. The way I want the model to work is to apply a load at the end of the lead screw and set a speed at which the motor runs and from that information measure a current that is drawn by the motor.
My main issue is that I am unable to make the BLDC (https://uk.mathworks.com/help/sps/ref/bldc.html) drive my gears. I am using a BLDC current controller with PWM generation to power the gates of a converter that should then power the BLDC. I have attached the part of the circuit I think is the problem but honestly I don’t really know if that is the problem. What I think the problem is that the converter is not getting the correct pulse to drive which is most likely cause by the way i have set up my BLDC controller. I will also attach the whole circuit.
Many thanks in advance.Hello,
I am trying to model a linear actuator in simscape matlab but have been quite unsuccessful. The way I want the model to work is to apply a load at the end of the lead screw and set a speed at which the motor runs and from that information measure a current that is drawn by the motor.
My main issue is that I am unable to make the BLDC (https://uk.mathworks.com/help/sps/ref/bldc.html) drive my gears. I am using a BLDC current controller with PWM generation to power the gates of a converter that should then power the BLDC. I have attached the part of the circuit I think is the problem but honestly I don’t really know if that is the problem. What I think the problem is that the converter is not getting the correct pulse to drive which is most likely cause by the way i have set up my BLDC controller. I will also attach the whole circuit.
Many thanks in advance. Hello,
I am trying to model a linear actuator in simscape matlab but have been quite unsuccessful. The way I want the model to work is to apply a load at the end of the lead screw and set a speed at which the motor runs and from that information measure a current that is drawn by the motor.
My main issue is that I am unable to make the BLDC (https://uk.mathworks.com/help/sps/ref/bldc.html) drive my gears. I am using a BLDC current controller with PWM generation to power the gates of a converter that should then power the BLDC. I have attached the part of the circuit I think is the problem but honestly I don’t really know if that is the problem. What I think the problem is that the converter is not getting the correct pulse to drive which is most likely cause by the way i have set up my BLDC controller. I will also attach the whole circuit.
Many thanks in advance. simscape, simulink, model, electric_motor_control MATLAB Answers — New Questions
How to prevent wraparound using geoplot
I am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surfaceI am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surface I am trying to accomplish something similar to the below post, namely prevent my data from wrapping at the meridians. So far, no luck:
https://www.mathworks.com/matlabcentral/answers/2172159-how-to-wrap-axes-using-geoplot
If I set the lonLim to [-360 360] and call geolimits(latlim,lonlim), the longitude limits do NOT change to [-360 360] but to [-180.3914 181.1743]. Why is this? Is there a bult-in max limit in geolimits? It’s possible that the function is confused by the [-360 360] values, which are effectively equivalent.
But back to the wraparound issue. I am plotting NetCDF-type satellite observation data.
figure
gx = geoaxes;
geobasemap(gx,’usgsimagery’);
hold on
latLim = [-72 85];
lonLim = [-180 180];
geolimits(gx, latLim, lonLim);
lat = ncread(filepath, ‘Latitude’); % read NetCDF-type data
lon = ncread(filepath, ‘Longitude’);
lat1 = double(lat(:,:,1)) ; % read just the 1st of 6 layers
lon1 = double(lon(:,:,1));
lon1 = wrapTo180(lon1); % limit to +/- 180 degrees
k = boundary(lat1(:),lon1(:)); % get just the edge data
pgon = geopolyshape(lat1(k),lon1(k));
geoplot(gx,pgon);
I am able to plot the satellite observation patches on the Mercator projection geoaxes display. However, when a patch crosses the International Date Line, it does not straddle the line but whangs all the way to the right, to the Prime Meridian.
If I use geoplot instead of geopolyshape I get the same effect, only with vectors instead of shapes.When the longitude data reaches -180, the vectors jump all the way to the right instead of straddling the dateline.
geoplot(gx,lat1(k),lon1(k));
How can I massage my NetCDF data to prevent this?
My goal is to collect all the patches and merge them into a single surface as described here:
https://www.mathworks.com/matlabcentral/answers/80524-combine-surfaces-into-one-big-surface geoplot, geopolyshape, netcdf, geoaxes, geolimits MATLAB Answers — New Questions
Error: following inductors are connected with the following voltage source error matlab
Hi,
We are trying to simulate a circuit and we face attached error. Is there any particular reason why this comes and kindly let us know the solution for the same as well.Hi,
We are trying to simulate a circuit and we face attached error. Is there any particular reason why this comes and kindly let us know the solution for the same as well. Hi,
We are trying to simulate a circuit and we face attached error. Is there any particular reason why this comes and kindly let us know the solution for the same as well. simulink, error MATLAB Answers — New Questions
Writing to table in matlab does not appear in a shared workbook?
Trying to write to a excel workbook that has shared privileges. The shared workbook works when two seperate people open it and make changes. Where there is conflict a box appears that allows the users to accept the changes etc…
When i write on the same line using matlab, then use the write command to save it. The changes do not appear on the opened workbook when clicking save. It just saves whatever is in the current workbook at that time with 0 conflicts, even though matlab has already wrote to it.
You only see the changes when you close the workbook and open it again without hitting save.
Is there a way round this ?Trying to write to a excel workbook that has shared privileges. The shared workbook works when two seperate people open it and make changes. Where there is conflict a box appears that allows the users to accept the changes etc…
When i write on the same line using matlab, then use the write command to save it. The changes do not appear on the opened workbook when clicking save. It just saves whatever is in the current workbook at that time with 0 conflicts, even though matlab has already wrote to it.
You only see the changes when you close the workbook and open it again without hitting save.
Is there a way round this ? Trying to write to a excel workbook that has shared privileges. The shared workbook works when two seperate people open it and make changes. Where there is conflict a box appears that allows the users to accept the changes etc…
When i write on the same line using matlab, then use the write command to save it. The changes do not appear on the opened workbook when clicking save. It just saves whatever is in the current workbook at that time with 0 conflicts, even though matlab has already wrote to it.
You only see the changes when you close the workbook and open it again without hitting save.
Is there a way round this ? matlab, excel, writetable MATLAB Answers — New Questions
For a parent variant + referenced subsystem with a child variant subsystem, can I have the variant control choice for the children be unique for each referenced parent?
Hi,
I have a parent variant subsystem with 2 choices. This is also a referenced subsystem and is used in 3 instances, let’s name them: A, B and C.
Within each parent there is a child variant subsystem with also two choices, ie. Parent_A -> Parent_A_Choice_X -> Child -> Child_Choice_Y
, where X is the variant choice for the parent subsystem and Y is the variant choice for the child subsystem.
My isssue is, that when I define the variant choice conditions (I do this in expression mode) for one of the children, the choice propagates to all the referenced parent subsystems A, B and C. The functionality I would like is that I can choose unique expressions for the children in each of the parent subsystems.
Is there any way to do this?
Best regards,
Emil MunkHi,
I have a parent variant subsystem with 2 choices. This is also a referenced subsystem and is used in 3 instances, let’s name them: A, B and C.
Within each parent there is a child variant subsystem with also two choices, ie. Parent_A -> Parent_A_Choice_X -> Child -> Child_Choice_Y
, where X is the variant choice for the parent subsystem and Y is the variant choice for the child subsystem.
My isssue is, that when I define the variant choice conditions (I do this in expression mode) for one of the children, the choice propagates to all the referenced parent subsystems A, B and C. The functionality I would like is that I can choose unique expressions for the children in each of the parent subsystems.
Is there any way to do this?
Best regards,
Emil Munk Hi,
I have a parent variant subsystem with 2 choices. This is also a referenced subsystem and is used in 3 instances, let’s name them: A, B and C.
Within each parent there is a child variant subsystem with also two choices, ie. Parent_A -> Parent_A_Choice_X -> Child -> Child_Choice_Y
, where X is the variant choice for the parent subsystem and Y is the variant choice for the child subsystem.
My isssue is, that when I define the variant choice conditions (I do this in expression mode) for one of the children, the choice propagates to all the referenced parent subsystems A, B and C. The functionality I would like is that I can choose unique expressions for the children in each of the parent subsystems.
Is there any way to do this?
Best regards,
Emil Munk simulink, variant subsystem, referenced subsystem, variant choice MATLAB Answers — New Questions
Band pass filtering of time series data
Hello, I am trying to replicate this study that filters the time series of the H-component of the magnetic field in the period range of 10-45 seconds to see ultralow frequency variations around the time of an earthquake or volcanic event, so may I ask anyone how to use the bandpass function in MATLAB right in this case?
Here’s my silly attempt
fs = 1/60; %since the data is per minute
bandpass(T.DAVH,[0.022 0.1],fs); % period range of 10-45 seconds to frequency in Hz
but it returns
Warning: Specified passband frequency is beyond the Nyquist range so signal has been
filtered with an allstop filter.
> In highpass>designFilter (line 129)
In highpass (line 97)
In bandpass>performHighpassFiltering (line 149)
In bandpass (line 116)
Attached the data below where T.DAVH is the H-component of the magnetic field measured in Davao station.
The description of the data is as follows:
Format IAGA-2002 |
Source of Data Kyushu University (KU) |
Station Name Davao |
IAGA CODE DAV (KU code) |
Geodetic Latitude 007.000 |
Geodetic Longitude 125.400 |
Elevation 8888.88 |
Reported HDZF |
Sensor Orientation HDZ |
Digital Sampling 1 seconds |
Data Interval Type Averaged 1-minute (00:30 – 01:29) |
Data Type Provisional
Thank you to anyone who can help!Hello, I am trying to replicate this study that filters the time series of the H-component of the magnetic field in the period range of 10-45 seconds to see ultralow frequency variations around the time of an earthquake or volcanic event, so may I ask anyone how to use the bandpass function in MATLAB right in this case?
Here’s my silly attempt
fs = 1/60; %since the data is per minute
bandpass(T.DAVH,[0.022 0.1],fs); % period range of 10-45 seconds to frequency in Hz
but it returns
Warning: Specified passband frequency is beyond the Nyquist range so signal has been
filtered with an allstop filter.
> In highpass>designFilter (line 129)
In highpass (line 97)
In bandpass>performHighpassFiltering (line 149)
In bandpass (line 116)
Attached the data below where T.DAVH is the H-component of the magnetic field measured in Davao station.
The description of the data is as follows:
Format IAGA-2002 |
Source of Data Kyushu University (KU) |
Station Name Davao |
IAGA CODE DAV (KU code) |
Geodetic Latitude 007.000 |
Geodetic Longitude 125.400 |
Elevation 8888.88 |
Reported HDZF |
Sensor Orientation HDZ |
Digital Sampling 1 seconds |
Data Interval Type Averaged 1-minute (00:30 – 01:29) |
Data Type Provisional
Thank you to anyone who can help! Hello, I am trying to replicate this study that filters the time series of the H-component of the magnetic field in the period range of 10-45 seconds to see ultralow frequency variations around the time of an earthquake or volcanic event, so may I ask anyone how to use the bandpass function in MATLAB right in this case?
Here’s my silly attempt
fs = 1/60; %since the data is per minute
bandpass(T.DAVH,[0.022 0.1],fs); % period range of 10-45 seconds to frequency in Hz
but it returns
Warning: Specified passband frequency is beyond the Nyquist range so signal has been
filtered with an allstop filter.
> In highpass>designFilter (line 129)
In highpass (line 97)
In bandpass>performHighpassFiltering (line 149)
In bandpass (line 116)
Attached the data below where T.DAVH is the H-component of the magnetic field measured in Davao station.
The description of the data is as follows:
Format IAGA-2002 |
Source of Data Kyushu University (KU) |
Station Name Davao |
IAGA CODE DAV (KU code) |
Geodetic Latitude 007.000 |
Geodetic Longitude 125.400 |
Elevation 8888.88 |
Reported HDZF |
Sensor Orientation HDZ |
Digital Sampling 1 seconds |
Data Interval Type Averaged 1-minute (00:30 – 01:29) |
Data Type Provisional
Thank you to anyone who can help! signal processing, bandpass filtering, bandpass MATLAB Answers — New Questions
Keeping the scale in subplots when on is changed
Hi, I have the following plot. When I usex the option "axis aquare" for figure (b), Figure (c) does not scale properly with figure (b). There is away how to keep the scale similar in the other figures despite I changed the properties of one of them. Thank you for your help.Hi, I have the following plot. When I usex the option "axis aquare" for figure (b), Figure (c) does not scale properly with figure (b). There is away how to keep the scale similar in the other figures despite I changed the properties of one of them. Thank you for your help. Hi, I have the following plot. When I usex the option "axis aquare" for figure (b), Figure (c) does not scale properly with figure (b). There is away how to keep the scale similar in the other figures despite I changed the properties of one of them. Thank you for your help. keeping scale properties of a subplots MATLAB Answers — New Questions
How to find the RMSE?
I have the following code:
clear;clc
ula = phased.ULA(‘NumElements’,10,’ElementSpacing’,0.5);
angs = [40 -20 20; 0 0 0];% angs=[azimuth; elevation]; My desired angles are 40, -20 and 20.
NumSignals = size(angs,2);
c = physconst(‘LightSpeed’);
fc = 300e6; % Operating frequency
lambda = c/fc;
pos = getElementPosition(ula)/lambda;
Nsamp = 1000;
nPower = 0.01;
rs = rng(2007);
signal = sensorsig(pos,Nsamp,angs,nPower);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MUSIC Algorithm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
musicspatialspect = phased.MUSICEstimator(‘SensorArray’,ula,…
‘OperatingFrequency’,fc,’ScanAngles’,-90:90,…
‘DOAOutputPort’,true,’NumSignalsSource’,’Property’,’NumSignals’,NumSignals);
[~,ang] = musicspatialspect(signal)
ymusic = musicspatialspect(signal);
helperPlotDOASpectra(musicspatialspect.ScanAngles,ymusic)% Changed by Me
function helperPlotDOASpectra(x2,y2)% Changed by Me
% Plot spectra in dB normalized to 0 dB at the peak
y2_dB = 20*log10(y2) – max(20*log10(y2));
plot(x2,y2_dB)
xlabel(‘Broadside Angle (degrees)’);
ylabel(‘Power (dB)’);
title(‘DOA Spatial Spectra’)
end
This estimates the angles and displays them in the command window. It also gives me the plot. Now I want to find the RMSE plot i.e., the root mean square error vs number of runs plot , where number of runs=100. The RMSE is between the actual angles i.e., 40 -20 20 assigend to "angs" and the estimated angles in variable "ang". But I don’t know how to do it?I have the following code:
clear;clc
ula = phased.ULA(‘NumElements’,10,’ElementSpacing’,0.5);
angs = [40 -20 20; 0 0 0];% angs=[azimuth; elevation]; My desired angles are 40, -20 and 20.
NumSignals = size(angs,2);
c = physconst(‘LightSpeed’);
fc = 300e6; % Operating frequency
lambda = c/fc;
pos = getElementPosition(ula)/lambda;
Nsamp = 1000;
nPower = 0.01;
rs = rng(2007);
signal = sensorsig(pos,Nsamp,angs,nPower);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MUSIC Algorithm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
musicspatialspect = phased.MUSICEstimator(‘SensorArray’,ula,…
‘OperatingFrequency’,fc,’ScanAngles’,-90:90,…
‘DOAOutputPort’,true,’NumSignalsSource’,’Property’,’NumSignals’,NumSignals);
[~,ang] = musicspatialspect(signal)
ymusic = musicspatialspect(signal);
helperPlotDOASpectra(musicspatialspect.ScanAngles,ymusic)% Changed by Me
function helperPlotDOASpectra(x2,y2)% Changed by Me
% Plot spectra in dB normalized to 0 dB at the peak
y2_dB = 20*log10(y2) – max(20*log10(y2));
plot(x2,y2_dB)
xlabel(‘Broadside Angle (degrees)’);
ylabel(‘Power (dB)’);
title(‘DOA Spatial Spectra’)
end
This estimates the angles and displays them in the command window. It also gives me the plot. Now I want to find the RMSE plot i.e., the root mean square error vs number of runs plot , where number of runs=100. The RMSE is between the actual angles i.e., 40 -20 20 assigend to "angs" and the estimated angles in variable "ang". But I don’t know how to do it? I have the following code:
clear;clc
ula = phased.ULA(‘NumElements’,10,’ElementSpacing’,0.5);
angs = [40 -20 20; 0 0 0];% angs=[azimuth; elevation]; My desired angles are 40, -20 and 20.
NumSignals = size(angs,2);
c = physconst(‘LightSpeed’);
fc = 300e6; % Operating frequency
lambda = c/fc;
pos = getElementPosition(ula)/lambda;
Nsamp = 1000;
nPower = 0.01;
rs = rng(2007);
signal = sensorsig(pos,Nsamp,angs,nPower);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MUSIC Algorithm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
musicspatialspect = phased.MUSICEstimator(‘SensorArray’,ula,…
‘OperatingFrequency’,fc,’ScanAngles’,-90:90,…
‘DOAOutputPort’,true,’NumSignalsSource’,’Property’,’NumSignals’,NumSignals);
[~,ang] = musicspatialspect(signal)
ymusic = musicspatialspect(signal);
helperPlotDOASpectra(musicspatialspect.ScanAngles,ymusic)% Changed by Me
function helperPlotDOASpectra(x2,y2)% Changed by Me
% Plot spectra in dB normalized to 0 dB at the peak
y2_dB = 20*log10(y2) – max(20*log10(y2));
plot(x2,y2_dB)
xlabel(‘Broadside Angle (degrees)’);
ylabel(‘Power (dB)’);
title(‘DOA Spatial Spectra’)
end
This estimates the angles and displays them in the command window. It also gives me the plot. Now I want to find the RMSE plot i.e., the root mean square error vs number of runs plot , where number of runs=100. The RMSE is between the actual angles i.e., 40 -20 20 assigend to "angs" and the estimated angles in variable "ang". But I don’t know how to do it? rmse, root mean sqaure error, music, algorithm MATLAB Answers — New Questions
Minimum of bivariable function
Hi everyone,
I just started using MATLAB and I’m trying to find the minmum of a bivariable function (CT(T1, T2)) and the correspoding 2D plot. Below the code used:
clear all ; clc ;
syms x;
syms T1;
syms T2;
H1=50;
%T2=10;
%T1=11;
Mp1=400;
Mc1=1500;
Mp2= 442.0684;
Mc2=1700;
H=100;
H2=H-H1;
w=0.1;
F1=@(T1)1-exp(-((T1-x)./100)).^2;
F2=@(T2) 1-exp(-((T2-x)./100)).^1.8;
f1=@(T1) 1-exp(-((H1-floor(H1./T1).*T1)-x)./100).^2;
f2=@(T2) 1-exp(-((H2-floor(H2./T2).*T2)-x)./100).^1.8;
A=@(T1)((H1./T1).*((-log(1-int(((30).*exp(-30).*x)*((1-exp(-((T1-x)./100)).^2)),0,T1)).*Mc1+(Mp1))))./H1;
B=@(T1)(-log(1-int((F1*((30).*exp(-30).*x)),0,(H1-(floor(H1./T1)).*T1)).*Mc1)./H1);
C=Mp2./H1;
D=@(T2)((H2./T2).*((-log(1-int(((1-exp(-((T2-x)./100)).^1.8))*((25).*exp(-25).*x),0,T2))).*(Mp1.*exp(w))))./H2;
E=@(T2)((-log(1-int((1-exp(-((H2-((H2./T2)).*T2)-x)./100))*((25).*exp(-25).*x),0,(H2-((H2./T2))).*T2))))*(Mc1.*exp(w))./H2;
CT=@(T1,T2)(A(T1)+B(T1)+C+D(T2)+E(T2))
Thanks.Hi everyone,
I just started using MATLAB and I’m trying to find the minmum of a bivariable function (CT(T1, T2)) and the correspoding 2D plot. Below the code used:
clear all ; clc ;
syms x;
syms T1;
syms T2;
H1=50;
%T2=10;
%T1=11;
Mp1=400;
Mc1=1500;
Mp2= 442.0684;
Mc2=1700;
H=100;
H2=H-H1;
w=0.1;
F1=@(T1)1-exp(-((T1-x)./100)).^2;
F2=@(T2) 1-exp(-((T2-x)./100)).^1.8;
f1=@(T1) 1-exp(-((H1-floor(H1./T1).*T1)-x)./100).^2;
f2=@(T2) 1-exp(-((H2-floor(H2./T2).*T2)-x)./100).^1.8;
A=@(T1)((H1./T1).*((-log(1-int(((30).*exp(-30).*x)*((1-exp(-((T1-x)./100)).^2)),0,T1)).*Mc1+(Mp1))))./H1;
B=@(T1)(-log(1-int((F1*((30).*exp(-30).*x)),0,(H1-(floor(H1./T1)).*T1)).*Mc1)./H1);
C=Mp2./H1;
D=@(T2)((H2./T2).*((-log(1-int(((1-exp(-((T2-x)./100)).^1.8))*((25).*exp(-25).*x),0,T2))).*(Mp1.*exp(w))))./H2;
E=@(T2)((-log(1-int((1-exp(-((H2-((H2./T2)).*T2)-x)./100))*((25).*exp(-25).*x),0,(H2-((H2./T2))).*T2))))*(Mc1.*exp(w))./H2;
CT=@(T1,T2)(A(T1)+B(T1)+C+D(T2)+E(T2))
Thanks. Hi everyone,
I just started using MATLAB and I’m trying to find the minmum of a bivariable function (CT(T1, T2)) and the correspoding 2D plot. Below the code used:
clear all ; clc ;
syms x;
syms T1;
syms T2;
H1=50;
%T2=10;
%T1=11;
Mp1=400;
Mc1=1500;
Mp2= 442.0684;
Mc2=1700;
H=100;
H2=H-H1;
w=0.1;
F1=@(T1)1-exp(-((T1-x)./100)).^2;
F2=@(T2) 1-exp(-((T2-x)./100)).^1.8;
f1=@(T1) 1-exp(-((H1-floor(H1./T1).*T1)-x)./100).^2;
f2=@(T2) 1-exp(-((H2-floor(H2./T2).*T2)-x)./100).^1.8;
A=@(T1)((H1./T1).*((-log(1-int(((30).*exp(-30).*x)*((1-exp(-((T1-x)./100)).^2)),0,T1)).*Mc1+(Mp1))))./H1;
B=@(T1)(-log(1-int((F1*((30).*exp(-30).*x)),0,(H1-(floor(H1./T1)).*T1)).*Mc1)./H1);
C=Mp2./H1;
D=@(T2)((H2./T2).*((-log(1-int(((1-exp(-((T2-x)./100)).^1.8))*((25).*exp(-25).*x),0,T2))).*(Mp1.*exp(w))))./H2;
E=@(T2)((-log(1-int((1-exp(-((H2-((H2./T2)).*T2)-x)./100))*((25).*exp(-25).*x),0,(H2-((H2./T2))).*T2))))*(Mc1.*exp(w))./H2;
CT=@(T1,T2)(A(T1)+B(T1)+C+D(T2)+E(T2))
Thanks. bivariable, optimization MATLAB Answers — New Questions
where can I find the code?
where can I find the code of helperPlotDOASpectra?where can I find the code of helperPlotDOASpectra? where can I find the code of helperPlotDOASpectra? doa, direction of arrival, missing code MATLAB Answers — New Questions
How to keep pressed the SHIFT button on the keyboard?
Hi all! I have two monitors and I need to pass the browser window form the left monitor to the right monitor. The shortcut to do this on the keyboard is: WINDOW + SHIFT + RIGHT ARROW. If i press phisically those 3 buttons on the keyboard the windows is correctly moved to the right monitor, however, if I try to do the same on MATLAB with this code:
import java.awt.*;
import java.awt.event.*;
rob=Robot;
[stat, h, url] = web(‘https://www.google.com’,’-new’);
pause(5)
rob.keyPress(KeyEvent.VK_WINDOWS);
rob.keyPress(KeyEvent.VK_SHIFT);
rob.keyPress(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_SHIFT);
rob.keyRelease(KeyEvent.VK_WINDOWS);
The output is like I press WINDOW + RIGHT ARROW. So, seems like the SHIFT button is pressed and released before the RIGHT ARROW button. Someone can help me? Many thanks!Hi all! I have two monitors and I need to pass the browser window form the left monitor to the right monitor. The shortcut to do this on the keyboard is: WINDOW + SHIFT + RIGHT ARROW. If i press phisically those 3 buttons on the keyboard the windows is correctly moved to the right monitor, however, if I try to do the same on MATLAB with this code:
import java.awt.*;
import java.awt.event.*;
rob=Robot;
[stat, h, url] = web(‘https://www.google.com’,’-new’);
pause(5)
rob.keyPress(KeyEvent.VK_WINDOWS);
rob.keyPress(KeyEvent.VK_SHIFT);
rob.keyPress(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_SHIFT);
rob.keyRelease(KeyEvent.VK_WINDOWS);
The output is like I press WINDOW + RIGHT ARROW. So, seems like the SHIFT button is pressed and released before the RIGHT ARROW button. Someone can help me? Many thanks! Hi all! I have two monitors and I need to pass the browser window form the left monitor to the right monitor. The shortcut to do this on the keyboard is: WINDOW + SHIFT + RIGHT ARROW. If i press phisically those 3 buttons on the keyboard the windows is correctly moved to the right monitor, however, if I try to do the same on MATLAB with this code:
import java.awt.*;
import java.awt.event.*;
rob=Robot;
[stat, h, url] = web(‘https://www.google.com’,’-new’);
pause(5)
rob.keyPress(KeyEvent.VK_WINDOWS);
rob.keyPress(KeyEvent.VK_SHIFT);
rob.keyPress(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_RIGHT);
rob.keyRelease(KeyEvent.VK_SHIFT);
rob.keyRelease(KeyEvent.VK_WINDOWS);
The output is like I press WINDOW + RIGHT ARROW. So, seems like the SHIFT button is pressed and released before the RIGHT ARROW button. Someone can help me? Many thanks! java, keypress MATLAB Answers — New Questions
Is there a function that returns a Bayes Model?
I used the function fitcnb to get a Naive Bayes Classifier but I need to get also a Bayes Classifier (which is the naive without the indipendence hyphotesis). Is there a function, similar to fitcnb, that returns a Bayes Model?I used the function fitcnb to get a Naive Bayes Classifier but I need to get also a Bayes Classifier (which is the naive without the indipendence hyphotesis). Is there a function, similar to fitcnb, that returns a Bayes Model? I used the function fitcnb to get a Naive Bayes Classifier but I need to get also a Bayes Classifier (which is the naive without the indipendence hyphotesis). Is there a function, similar to fitcnb, that returns a Bayes Model? bayes, function MATLAB Answers — New Questions
Binary image feature extraction
I want to perform feature based image registration on two binary images.
What feature extraction algorithm should i use, to extract sufficient features from the binary images.I want to perform feature based image registration on two binary images.
What feature extraction algorithm should i use, to extract sufficient features from the binary images. I want to perform feature based image registration on two binary images.
What feature extraction algorithm should i use, to extract sufficient features from the binary images. binary image, feature extraction MATLAB Answers — New Questions
About converting Spice model to Simscape
I used the command subcircuit2ssc to convert a Spice model for the power diode to Simscape, and an error appears:
Error using subcircuit2ssc
Netlist is not supported. No valid subcircuits found.
The power diode Spice file is as follows:
.MODEL DRFN10RSM2STL1 D
+ IS=192.49E-12
+ N=1.1157
+ RS=4.3285E-3
+ IKF=98.758E-3
+ EG=0.88
+ CJO=168.00E-12
+ M=0.3114
+ VJ=0.5
+ ISR=539.76E-12
+ NR=1.95
+ BV=200
+ TT=26.548E-9
+ TIKF=0.012
I have succesfully converted a power MOSFET model from Spice to Simscape. I wonder why this does not work for diode. Thanks!I used the command subcircuit2ssc to convert a Spice model for the power diode to Simscape, and an error appears:
Error using subcircuit2ssc
Netlist is not supported. No valid subcircuits found.
The power diode Spice file is as follows:
.MODEL DRFN10RSM2STL1 D
+ IS=192.49E-12
+ N=1.1157
+ RS=4.3285E-3
+ IKF=98.758E-3
+ EG=0.88
+ CJO=168.00E-12
+ M=0.3114
+ VJ=0.5
+ ISR=539.76E-12
+ NR=1.95
+ BV=200
+ TT=26.548E-9
+ TIKF=0.012
I have succesfully converted a power MOSFET model from Spice to Simscape. I wonder why this does not work for diode. Thanks! I used the command subcircuit2ssc to convert a Spice model for the power diode to Simscape, and an error appears:
Error using subcircuit2ssc
Netlist is not supported. No valid subcircuits found.
The power diode Spice file is as follows:
.MODEL DRFN10RSM2STL1 D
+ IS=192.49E-12
+ N=1.1157
+ RS=4.3285E-3
+ IKF=98.758E-3
+ EG=0.88
+ CJO=168.00E-12
+ M=0.3114
+ VJ=0.5
+ ISR=539.76E-12
+ NR=1.95
+ BV=200
+ TT=26.548E-9
+ TIKF=0.012
I have succesfully converted a power MOSFET model from Spice to Simscape. I wonder why this does not work for diode. Thanks! spice, model, simscape, convert, power diode, subcircuit2ssc MATLAB Answers — New Questions
XML EDIT attribute value
My question might seem dumb but I can’t seem to find the answer: How can I edit certain values on an xml file that already exists?
I want to edit all the attributes values with values coming from an excel sheet. Is that possible?
Thanks!My question might seem dumb but I can’t seem to find the answer: How can I edit certain values on an xml file that already exists?
I want to edit all the attributes values with values coming from an excel sheet. Is that possible?
Thanks! My question might seem dumb but I can’t seem to find the answer: How can I edit certain values on an xml file that already exists?
I want to edit all the attributes values with values coming from an excel sheet. Is that possible?
Thanks! xml, xmledit MATLAB Answers — New Questions
matlab calculation area circular
I have a signal and want to calculate the area. The problem is that i want to make a loop with decimal step, because the length is 1189,58
Any ideas how to proceed with the loop?I have a signal and want to calculate the area. The problem is that i want to make a loop with decimal step, because the length is 1189,58
Any ideas how to proceed with the loop? I have a signal and want to calculate the area. The problem is that i want to make a loop with decimal step, because the length is 1189,58
Any ideas how to proceed with the loop? range, area MATLAB Answers — New Questions
Is it possible to use MATLAB on slave computer/device for communication to host computer via serial MODBUS (RTU)
Can I communicate with the host/master via serial port (MODBUS ASCII/RTU) using MATLAB on the slave computer, i.e. I need to wait for a request from the host/master, receive it when it comes and send back the requested data to the host. I found how this can implemented for MODBUS TCP/IP, but I did not find how to implement that for MODBUS ASCII/RTU (RS232, RS485). All MATLAB functions for serial port communication seem to be for the case when the code runs on the host computer. My MATLAB code runs on the slave device (processor/computer which controls the analytical instrument) and I need it to send the data when requested to the host (SCADA).Can I communicate with the host/master via serial port (MODBUS ASCII/RTU) using MATLAB on the slave computer, i.e. I need to wait for a request from the host/master, receive it when it comes and send back the requested data to the host. I found how this can implemented for MODBUS TCP/IP, but I did not find how to implement that for MODBUS ASCII/RTU (RS232, RS485). All MATLAB functions for serial port communication seem to be for the case when the code runs on the host computer. My MATLAB code runs on the slave device (processor/computer which controls the analytical instrument) and I need it to send the data when requested to the host (SCADA). Can I communicate with the host/master via serial port (MODBUS ASCII/RTU) using MATLAB on the slave computer, i.e. I need to wait for a request from the host/master, receive it when it comes and send back the requested data to the host. I found how this can implemented for MODBUS TCP/IP, but I did not find how to implement that for MODBUS ASCII/RTU (RS232, RS485). All MATLAB functions for serial port communication seem to be for the case when the code runs on the host computer. My MATLAB code runs on the slave device (processor/computer which controls the analytical instrument) and I need it to send the data when requested to the host (SCADA). serial port, modbus, modbus ascii, modbus rtu, modbus slave, modbus host, rs485, rs232 MATLAB Answers — New Questions
Convergence path error,Variables of this type do not support indexing with points.
I have a new problem, I obtain aspen convergence in the connection operation between aspen and matlab, my code is:
Conv = aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
I also found the corresponding path in aspen, but the code is wrong, At the same time, I have checked that CSDN does not support indexing with points for variables of this type, but when I change the code to:
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
ConvValue = Conv.Value;
I still get an errorI have a new problem, I obtain aspen convergence in the connection operation between aspen and matlab, my code is:
Conv = aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
I also found the corresponding path in aspen, but the code is wrong, At the same time, I have checked that CSDN does not support indexing with points for variables of this type, but when I change the code to:
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
ConvValue = Conv.Value;
I still get an error I have a new problem, I obtain aspen convergence in the connection operation between aspen and matlab, my code is:
Conv = aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
I also found the corresponding path in aspen, but the code is wrong, At the same time, I have checked that CSDN does not support indexing with points for variables of this type, but when I change the code to:
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR");
ConvValue = Conv.Value;
I still get an error aspen,matlab MATLAB Answers — New Questions