Category: Matlab
Category Archives: Matlab
What is the proper syntax used to enter a vertical intercept?
Im having issues entering the y intercept of a graph. It is clearly the point (0,-3). I have tried -3, (-3), y=-3, (0,-3) and all of them have an error code of . (:span class="AMHnotice":)Invalid notation. (:/span:)Im having issues entering the y intercept of a graph. It is clearly the point (0,-3). I have tried -3, (-3), y=-3, (0,-3) and all of them have an error code of . (:span class="AMHnotice":)Invalid notation. (:/span:) Im having issues entering the y intercept of a graph. It is clearly the point (0,-3). I have tried -3, (-3), y=-3, (0,-3) and all of them have an error code of . (:span class="AMHnotice":)Invalid notation. (:/span:) syntax error, intercepts MATLAB Answers — New Questions
vpa(4503599627370491.5)
vpa(4503599627370491.5)
produces
4503599627370496.0
in 2017b.
Why?
Further,
sym(4503599627370491.5)-sym(4503599627370496)
produces
0.vpa(4503599627370491.5)
produces
4503599627370496.0
in 2017b.
Why?
Further,
sym(4503599627370491.5)-sym(4503599627370496)
produces
0. vpa(4503599627370491.5)
produces
4503599627370496.0
in 2017b.
Why?
Further,
sym(4503599627370491.5)-sym(4503599627370496)
produces
0. vpa, sym MATLAB Answers — New Questions
Extract individual curve from a multiple curve plot
I have plottedthe attached data using
figure; scatter(data(:,1),data(:,2)); It gives me plot as shown below
As can be seen from the figure that we have 11 curves in this plot. How can I trace each curve and get (X,Y) value and so that I have X and Y values for all 11 curves?I have plottedthe attached data using
figure; scatter(data(:,1),data(:,2)); It gives me plot as shown below
As can be seen from the figure that we have 11 curves in this plot. How can I trace each curve and get (X,Y) value and so that I have X and Y values for all 11 curves? I have plottedthe attached data using
figure; scatter(data(:,1),data(:,2)); It gives me plot as shown below
As can be seen from the figure that we have 11 curves in this plot. How can I trace each curve and get (X,Y) value and so that I have X and Y values for all 11 curves? curve tracing, ploting, image processing, data analysis, clustering, plot MATLAB Answers — New Questions
How can I access files in my Microsoft OneDrive using MATLAB Online?
I am trying to access files in my Microsoft OneDrive while using MATLAB Online. How do I enable MATLAB Online to access Microsoft OneDrive?I am trying to access files in my Microsoft OneDrive while using MATLAB Online. How do I enable MATLAB Online to access Microsoft OneDrive? I am trying to access files in my Microsoft OneDrive while using MATLAB Online. How do I enable MATLAB Online to access Microsoft OneDrive? microsoft, onedrive, matlab-online MATLAB Answers — New Questions
Calculate when to detach a small rocket
Hello,
I have a big Matlab asignment, which is due soon. The project is devided into several parts, a,b, c and d. Problem a is to calculate maximum height if we only have one rocket. Problem b is to calculate where this rocket will launch. I have solved these using Runge kutta method. I am currently stuck on problem c, which is calculating when to release a seccond rocket to obtain maximal distance.
Is anyone able to help with this? Any help is greatly appriciated.
Files in link, (sadly wasnt able to upload directly) Matlab_filesHello,
I have a big Matlab asignment, which is due soon. The project is devided into several parts, a,b, c and d. Problem a is to calculate maximum height if we only have one rocket. Problem b is to calculate where this rocket will launch. I have solved these using Runge kutta method. I am currently stuck on problem c, which is calculating when to release a seccond rocket to obtain maximal distance.
Is anyone able to help with this? Any help is greatly appriciated.
Files in link, (sadly wasnt able to upload directly) Matlab_files Hello,
I have a big Matlab asignment, which is due soon. The project is devided into several parts, a,b, c and d. Problem a is to calculate maximum height if we only have one rocket. Problem b is to calculate where this rocket will launch. I have solved these using Runge kutta method. I am currently stuck on problem c, which is calculating when to release a seccond rocket to obtain maximal distance.
Is anyone able to help with this? Any help is greatly appriciated.
Files in link, (sadly wasnt able to upload directly) Matlab_files matlab, differential equations, trajectory MATLAB Answers — New Questions
How to Configure your Student Competition License
How to Configure your Student Competition LicenseHow to Configure your Student Competition License How to Configure your Student Competition License student, competition MATLAB Answers — New Questions
How can I filter a FFt signal to only show the main frequency?
I have the following code (a sample data file is attached).
load("sample_signal.mat");
whos
figure
subplot(2,1,1)
hold on; grid minor
plot(signals.signal_01.signal)
plot(signals.signal_02.signal)
plot(signals.signal_03.time, signals.signal_03.theta, ‘k’)
title("Signal");
subplot(2,1,2)
hold on; grid minor
fs = 1;
[freq, amplitude, phase] = generic_fft(signals.signal_01.signal, fs);
plot(freq, amplitude)
[freq, amplitude, phase] = generic_fft(signals.signal_02.signal, fs);
plot(freq, amplitude)
fs = 10;
[freq, amplitude, phase] = generic_fft(signals.signal_03.theta, fs);
plot(freq, amplitude, ‘k’)
xlim([0 0.5])
xlabel("$omega$ [rad/s]")
ylabel("fft")
title("FFT");
% fft function
function [freq, amplitude, phase] = generic_fft(signal, fs)
% Remove NaNs
signal = signal(~isnan(signal));
% Length of the signal
n = length(signal);
% Perform FFT
fft_values = fft(signal);
% Compute single-sided amplitude spectrum
amplitude = abs(fft_values / n); % Normalize by length
amplitude = amplitude(1:floor(n / 2) + 1); % Keep positive frequencies
amplitude(2:end-1) = 2 * amplitude(2:end-1);
% Compute single-sided phase spectrum
phase = angle(fft_values(1:floor(n / 2) + 1));
% Frequency vector
freq = (0:(n / 2)) * (fs / n);
end
Now, the signal plotted in black shows a clear, dominant frequency in the FFt, but the other two signals show additional "noise" (see, after 0.1 rad/s). Is it possible to maybe filter these out or only show the dominant frequency?
The code is rough and the data structure is also not ideal (I saved the data mid-simulation for this question 🙂 ). Also, any tips to improve the fft function is also very appreciated. TIA!I have the following code (a sample data file is attached).
load("sample_signal.mat");
whos
figure
subplot(2,1,1)
hold on; grid minor
plot(signals.signal_01.signal)
plot(signals.signal_02.signal)
plot(signals.signal_03.time, signals.signal_03.theta, ‘k’)
title("Signal");
subplot(2,1,2)
hold on; grid minor
fs = 1;
[freq, amplitude, phase] = generic_fft(signals.signal_01.signal, fs);
plot(freq, amplitude)
[freq, amplitude, phase] = generic_fft(signals.signal_02.signal, fs);
plot(freq, amplitude)
fs = 10;
[freq, amplitude, phase] = generic_fft(signals.signal_03.theta, fs);
plot(freq, amplitude, ‘k’)
xlim([0 0.5])
xlabel("$omega$ [rad/s]")
ylabel("fft")
title("FFT");
% fft function
function [freq, amplitude, phase] = generic_fft(signal, fs)
% Remove NaNs
signal = signal(~isnan(signal));
% Length of the signal
n = length(signal);
% Perform FFT
fft_values = fft(signal);
% Compute single-sided amplitude spectrum
amplitude = abs(fft_values / n); % Normalize by length
amplitude = amplitude(1:floor(n / 2) + 1); % Keep positive frequencies
amplitude(2:end-1) = 2 * amplitude(2:end-1);
% Compute single-sided phase spectrum
phase = angle(fft_values(1:floor(n / 2) + 1));
% Frequency vector
freq = (0:(n / 2)) * (fs / n);
end
Now, the signal plotted in black shows a clear, dominant frequency in the FFt, but the other two signals show additional "noise" (see, after 0.1 rad/s). Is it possible to maybe filter these out or only show the dominant frequency?
The code is rough and the data structure is also not ideal (I saved the data mid-simulation for this question 🙂 ). Also, any tips to improve the fft function is also very appreciated. TIA! I have the following code (a sample data file is attached).
load("sample_signal.mat");
whos
figure
subplot(2,1,1)
hold on; grid minor
plot(signals.signal_01.signal)
plot(signals.signal_02.signal)
plot(signals.signal_03.time, signals.signal_03.theta, ‘k’)
title("Signal");
subplot(2,1,2)
hold on; grid minor
fs = 1;
[freq, amplitude, phase] = generic_fft(signals.signal_01.signal, fs);
plot(freq, amplitude)
[freq, amplitude, phase] = generic_fft(signals.signal_02.signal, fs);
plot(freq, amplitude)
fs = 10;
[freq, amplitude, phase] = generic_fft(signals.signal_03.theta, fs);
plot(freq, amplitude, ‘k’)
xlim([0 0.5])
xlabel("$omega$ [rad/s]")
ylabel("fft")
title("FFT");
% fft function
function [freq, amplitude, phase] = generic_fft(signal, fs)
% Remove NaNs
signal = signal(~isnan(signal));
% Length of the signal
n = length(signal);
% Perform FFT
fft_values = fft(signal);
% Compute single-sided amplitude spectrum
amplitude = abs(fft_values / n); % Normalize by length
amplitude = amplitude(1:floor(n / 2) + 1); % Keep positive frequencies
amplitude(2:end-1) = 2 * amplitude(2:end-1);
% Compute single-sided phase spectrum
phase = angle(fft_values(1:floor(n / 2) + 1));
% Frequency vector
freq = (0:(n / 2)) * (fs / n);
end
Now, the signal plotted in black shows a clear, dominant frequency in the FFt, but the other two signals show additional "noise" (see, after 0.1 rad/s). Is it possible to maybe filter these out or only show the dominant frequency?
The code is rough and the data structure is also not ideal (I saved the data mid-simulation for this question 🙂 ). Also, any tips to improve the fft function is also very appreciated. TIA! fft, filter, plot MATLAB Answers — New Questions
Errors encountered when implementing the code of “Train Voice Activity Detection in Noise Model Using Deep Learning”
Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you!Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you! Hello,I encountered an error while running the example code from the MathWorks tutorial "Train Voice Activity Detection in Noise Model Using Deep Learning". I am using MATLAB Online and did not modify the original code.The error occurs at line 150 when calling the trainnet function:
noisyvadnet = trainnet(XTrain, TTrain, net, "mse", options);
The error message is:
Error using trainnet (line 54)
Execution failed during layer(s) "cnn2.norm1".
Caused by:
Arrays have incompatible sizes for this operation.
Error in deep.internal.recording.operations.TimesBroadcastOp/forward (line 31)
x = x .* y;
^
Error in .* (line 39)
zdata = matlab.lang.internal.move(xdata) .* matlab.lang.internal.move(ydata);
^
Error in audio.ai.vadnet.layers.layerNormalizationElementwiseLayer/predict (line 59)
Z = layer.Scale.*Xn + layer.Bias;
^
Error in nnet.layer.Layer/forward (line 129)
[varargout{1:layer.NumOutputs+layer.PrivateNumStates}] = predict( layer, varargin{:} );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since many functions related to this error are read-only, I cannot insert debugging code to investigate further.Could you please help me understand why this error occurs and how to resolve it?Thank you! incompatible sizes, tutorial code MATLAB Answers — New Questions
MINLP problem in MATLAB with both integer constraints and nonlinear equality constraints
Knowing that: “When there are integer constraints, ga and gamultiobj do not accept nonlinear equality constraints, only nonlinear inequality constraints.”, How do you solve MINLP problems of the following form in MATLAB?Knowing that: “When there are integer constraints, ga and gamultiobj do not accept nonlinear equality constraints, only nonlinear inequality constraints.”, How do you solve MINLP problems of the following form in MATLAB? Knowing that: “When there are integer constraints, ga and gamultiobj do not accept nonlinear equality constraints, only nonlinear inequality constraints.”, How do you solve MINLP problems of the following form in MATLAB? minlp MATLAB Answers — New Questions
Configuration of ROS Toolbox through CLI?
Hello everyone,
my main question is in the title. For reference, I want to create a docker container running matlab to generate some standalone ROS2 nodes. This works fine until I have to set the path to the Python-executable. It seems to be only possible through the GUI. Am I mistaken here and is there maybe a way to set the executable and create the venv via CLI commands?
Best regards,
SönkeHello everyone,
my main question is in the title. For reference, I want to create a docker container running matlab to generate some standalone ROS2 nodes. This works fine until I have to set the path to the Python-executable. It seems to be only possible through the GUI. Am I mistaken here and is there maybe a way to set the executable and create the venv via CLI commands?
Best regards,
Sönke Hello everyone,
my main question is in the title. For reference, I want to create a docker container running matlab to generate some standalone ROS2 nodes. This works fine until I have to set the path to the Python-executable. It seems to be only possible through the GUI. Am I mistaken here and is there maybe a way to set the executable and create the venv via CLI commands?
Best regards,
Sönke ros2, cli, container, docker MATLAB Answers — New Questions
Is it possible to export Tool-coupling FMU from Simulink model with compiled MEX S function? [r2019b]
hi, i try to export a FMU from Simulink model in which has a compiled MEX S function. I import the generated FMU to Simulink and it could not run successfully.
Is this only possible to export FMU with white box model?
Thanks in advance.hi, i try to export a FMU from Simulink model in which has a compiled MEX S function. I import the generated FMU to Simulink and it could not run successfully.
Is this only possible to export FMU with white box model?
Thanks in advance. hi, i try to export a FMU from Simulink model in which has a compiled MEX S function. I import the generated FMU to Simulink and it could not run successfully.
Is this only possible to export FMU with white box model?
Thanks in advance. fmu export MATLAB Answers — New Questions
Class Property Validation for the Contents of a Cell Array Property?
I’m writing a class that stores its data in the form of cell arrays, matching values to their units. An example property definition might look something like:
classdef myClass
properties (SetAccess = private)
prop1 (2, 2) cell = { 1000, "m" ; 1, "km" }
end
end
In the class definition, I’d like to use property validation to restrict the values in column 1 to valid distances, nonnegative for example, and column 2 to valid strings that define an actual unit type, "m"/"ft"/"in" for example. This is trivial for defined types, like ‘int16’ or ‘double’, but I’m wondering if anyone has accomplished this for columns/rows inside a cell array. The goal here is to store property value with its unit, while also restricting both to valid input. Is this possible given the cell type at property definition? Thanks!I’m writing a class that stores its data in the form of cell arrays, matching values to their units. An example property definition might look something like:
classdef myClass
properties (SetAccess = private)
prop1 (2, 2) cell = { 1000, "m" ; 1, "km" }
end
end
In the class definition, I’d like to use property validation to restrict the values in column 1 to valid distances, nonnegative for example, and column 2 to valid strings that define an actual unit type, "m"/"ft"/"in" for example. This is trivial for defined types, like ‘int16’ or ‘double’, but I’m wondering if anyone has accomplished this for columns/rows inside a cell array. The goal here is to store property value with its unit, while also restricting both to valid input. Is this possible given the cell type at property definition? Thanks! I’m writing a class that stores its data in the form of cell arrays, matching values to their units. An example property definition might look something like:
classdef myClass
properties (SetAccess = private)
prop1 (2, 2) cell = { 1000, "m" ; 1, "km" }
end
end
In the class definition, I’d like to use property validation to restrict the values in column 1 to valid distances, nonnegative for example, and column 2 to valid strings that define an actual unit type, "m"/"ft"/"in" for example. This is trivial for defined types, like ‘int16’ or ‘double’, but I’m wondering if anyone has accomplished this for columns/rows inside a cell array. The goal here is to store property value with its unit, while also restricting both to valid input. Is this possible given the cell type at property definition? Thanks! cell arrays, property validation MATLAB Answers — New Questions
Simulink Raspberry Code Generation Running Very Slow
I am trying to compile a simple gpio trigger signal that I created with Simulink and run it on the raspberry. But unfortunately, when I measure with an oscilloscope from the gpio pin, which should trigger 2khz, I see a 2hz measurement. I would appreciate if you can help with this. It is interesting that even *very simple models* have such problems. (Matlab2024a)I am trying to compile a simple gpio trigger signal that I created with Simulink and run it on the raspberry. But unfortunately, when I measure with an oscilloscope from the gpio pin, which should trigger 2khz, I see a 2hz measurement. I would appreciate if you can help with this. It is interesting that even *very simple models* have such problems. (Matlab2024a) I am trying to compile a simple gpio trigger signal that I created with Simulink and run it on the raspberry. But unfortunately, when I measure with an oscilloscope from the gpio pin, which should trigger 2khz, I see a 2hz measurement. I would appreciate if you can help with this. It is interesting that even *very simple models* have such problems. (Matlab2024a) simulink, code generation MATLAB Answers — New Questions
Simulink model deployed in Raspberry Pi is not running in Real-time
I have a simulink model for grid connected PV system. In that model Modbus Slave write blocks are used to store all the power system network measurements, so that these values can be read from other Modbus master device.
The model is successfully built and gets deployed on Raspi with out any errors. I could read the values from another modbus mater. However, the model is running very slowly, and it tooks minutes to reach to the state of 1 sec in simulation.
Please help me, How can I solve this issue.I have a simulink model for grid connected PV system. In that model Modbus Slave write blocks are used to store all the power system network measurements, so that these values can be read from other Modbus master device.
The model is successfully built and gets deployed on Raspi with out any errors. I could read the values from another modbus mater. However, the model is running very slowly, and it tooks minutes to reach to the state of 1 sec in simulation.
Please help me, How can I solve this issue. I have a simulink model for grid connected PV system. In that model Modbus Slave write blocks are used to store all the power system network measurements, so that these values can be read from other Modbus master device.
The model is successfully built and gets deployed on Raspi with out any errors. I could read the values from another modbus mater. However, the model is running very slowly, and it tooks minutes to reach to the state of 1 sec in simulation.
Please help me, How can I solve this issue. simulink interface with raspberry pi MATLAB Answers — New Questions
Can Simulink Models Be Ran On A GPU?
I’m part of a group trying to speed up our code. We send out inputs to the simulink model with
simIn(i) = simIn(i).setVariable(‘Amplitude’, pops(i, 1));
simIn(i) = simIn(i).setVariable(‘Freq’, pops(i, 2));
simIn(i) = simIn(i).setVariable(‘PW’, pops(i, 3));
simIn(i) = simIn(i).setVariable(‘Ramp_Toggle’, pops(i, 4));
simIn(i) = simIn(i).setVariable(‘Ramp_Slope’, pops(i, 5));
simIn(i) = simIn(i).setVariable(‘Ramp_Flat’, pops(i, 6));
simIn(i) = simIn(i).setVariable(‘Intraburst_Toggle’, pops(i, 7));
simIn(i) = simIn(i).setVariable(‘Intraburst_Period’, pops(i, 8));
simIn(i) = simIn(i).setVariable(‘Intraburst_Packet’, pops(i, 9));
simIn(i) = simIn(i).setVariable(‘Phasic’, pops(i, 10));
and take back outputs with
simOut = parsim(simIn, ‘ShowSimulationManager’, ‘off’);
Using tic toc it seems that the simulink model takes about 90% of our runtime. Is there a way to run this on the GPU or other ways to speed it up? Any help will be greatly appreciated.
Thank youI’m part of a group trying to speed up our code. We send out inputs to the simulink model with
simIn(i) = simIn(i).setVariable(‘Amplitude’, pops(i, 1));
simIn(i) = simIn(i).setVariable(‘Freq’, pops(i, 2));
simIn(i) = simIn(i).setVariable(‘PW’, pops(i, 3));
simIn(i) = simIn(i).setVariable(‘Ramp_Toggle’, pops(i, 4));
simIn(i) = simIn(i).setVariable(‘Ramp_Slope’, pops(i, 5));
simIn(i) = simIn(i).setVariable(‘Ramp_Flat’, pops(i, 6));
simIn(i) = simIn(i).setVariable(‘Intraburst_Toggle’, pops(i, 7));
simIn(i) = simIn(i).setVariable(‘Intraburst_Period’, pops(i, 8));
simIn(i) = simIn(i).setVariable(‘Intraburst_Packet’, pops(i, 9));
simIn(i) = simIn(i).setVariable(‘Phasic’, pops(i, 10));
and take back outputs with
simOut = parsim(simIn, ‘ShowSimulationManager’, ‘off’);
Using tic toc it seems that the simulink model takes about 90% of our runtime. Is there a way to run this on the GPU or other ways to speed it up? Any help will be greatly appreciated.
Thank you I’m part of a group trying to speed up our code. We send out inputs to the simulink model with
simIn(i) = simIn(i).setVariable(‘Amplitude’, pops(i, 1));
simIn(i) = simIn(i).setVariable(‘Freq’, pops(i, 2));
simIn(i) = simIn(i).setVariable(‘PW’, pops(i, 3));
simIn(i) = simIn(i).setVariable(‘Ramp_Toggle’, pops(i, 4));
simIn(i) = simIn(i).setVariable(‘Ramp_Slope’, pops(i, 5));
simIn(i) = simIn(i).setVariable(‘Ramp_Flat’, pops(i, 6));
simIn(i) = simIn(i).setVariable(‘Intraburst_Toggle’, pops(i, 7));
simIn(i) = simIn(i).setVariable(‘Intraburst_Period’, pops(i, 8));
simIn(i) = simIn(i).setVariable(‘Intraburst_Packet’, pops(i, 9));
simIn(i) = simIn(i).setVariable(‘Phasic’, pops(i, 10));
and take back outputs with
simOut = parsim(simIn, ‘ShowSimulationManager’, ‘off’);
Using tic toc it seems that the simulink model takes about 90% of our runtime. Is there a way to run this on the GPU or other ways to speed it up? Any help will be greatly appreciated.
Thank you simulink, gpu MATLAB Answers — New Questions
¿Porque no corre mi código? No aparece nada
Le pongo en correr y no pasa nadaLe pongo en correr y no pasa nada Le pongo en correr y no pasa nada codigo MATLAB Answers — New Questions
Can a PWM signal with a 100% duty cycle be considered as an unit step?
I am working on the temperature control of an electric oven. I had the idea of obtaining the temperature-time curve when the oven is fed with the alternating wave at maximum power (220 V 60 Hz). According to the Ziegler-Nichols tuning method, my curve would be the response of the system (oven) to a "unit step". But here I have a doubt. To control the power, I am using a BT136 triac, which receives a 5 volt PWM wave at its gate. When this 5 volt PWM signal is at 100% duty cycle, could I consider it as a unit step?
Thanks in advance for your attentionI am working on the temperature control of an electric oven. I had the idea of obtaining the temperature-time curve when the oven is fed with the alternating wave at maximum power (220 V 60 Hz). According to the Ziegler-Nichols tuning method, my curve would be the response of the system (oven) to a "unit step". But here I have a doubt. To control the power, I am using a BT136 triac, which receives a 5 volt PWM wave at its gate. When this 5 volt PWM signal is at 100% duty cycle, could I consider it as a unit step?
Thanks in advance for your attention I am working on the temperature control of an electric oven. I had the idea of obtaining the temperature-time curve when the oven is fed with the alternating wave at maximum power (220 V 60 Hz). According to the Ziegler-Nichols tuning method, my curve would be the response of the system (oven) to a "unit step". But here I have a doubt. To control the power, I am using a BT136 triac, which receives a 5 volt PWM wave at its gate. When this 5 volt PWM signal is at 100% duty cycle, could I consider it as a unit step?
Thanks in advance for your attention control, unit step, pwm MATLAB Answers — New Questions
Error using sub2ind: out of range subscript
Hi,
I am running a matlab gui and when I load the data (multitiff file) and display it in the axes I get the following error. I don’t know how to proceed because the error doesn’t appear every time I run the code. I tried to check which version of sub2ind maltab is using and it seems to use the correct version. Thank you in advance for your help.
Warning: Error occurred while executing the listener callback for event Action defined for class
matlab.graphics.interaction.graphicscontrol.AxesControl:
Error using sub2ind
Out of range subscript.
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/getNearestImageIndex (line 369)
index = sub2ind(dataSize, nRC(1), nRC(2));
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/doGetNearestPoint (line 225)
index = getNearestImageIndex(hObj, point_v, basis_row, basis_col);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipHoverLingerInteraction/handleEvent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipBaseInteraction/response
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase/responseevent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase
Error in matlab.graphics.interaction.graphicscontrol.GenericControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.LayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.GridLayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.AxesControl/process
Error in matlab.graphics.interaction.graphicscontrol.ControlManager/processMessage
> In matlab.graphics.interaction.graphicscontrol/GenericControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/LayoutableControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/GridLayoutableControl/process
In matlab.graphics.interaction.graphicscontrol/AxesControl/process
In matlab.graphics.interaction.graphicscontrol/ControlManager/processMessageHi,
I am running a matlab gui and when I load the data (multitiff file) and display it in the axes I get the following error. I don’t know how to proceed because the error doesn’t appear every time I run the code. I tried to check which version of sub2ind maltab is using and it seems to use the correct version. Thank you in advance for your help.
Warning: Error occurred while executing the listener callback for event Action defined for class
matlab.graphics.interaction.graphicscontrol.AxesControl:
Error using sub2ind
Out of range subscript.
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/getNearestImageIndex (line 369)
index = sub2ind(dataSize, nRC(1), nRC(2));
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/doGetNearestPoint (line 225)
index = getNearestImageIndex(hObj, point_v, basis_row, basis_col);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipHoverLingerInteraction/handleEvent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipBaseInteraction/response
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase/responseevent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase
Error in matlab.graphics.interaction.graphicscontrol.GenericControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.LayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.GridLayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.AxesControl/process
Error in matlab.graphics.interaction.graphicscontrol.ControlManager/processMessage
> In matlab.graphics.interaction.graphicscontrol/GenericControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/LayoutableControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/GridLayoutableControl/process
In matlab.graphics.interaction.graphicscontrol/AxesControl/process
In matlab.graphics.interaction.graphicscontrol/ControlManager/processMessage Hi,
I am running a matlab gui and when I load the data (multitiff file) and display it in the axes I get the following error. I don’t know how to proceed because the error doesn’t appear every time I run the code. I tried to check which version of sub2ind maltab is using and it seems to use the correct version. Thank you in advance for your help.
Warning: Error occurred while executing the listener callback for event Action defined for class
matlab.graphics.interaction.graphicscontrol.AxesControl:
Error using sub2ind
Out of range subscript.
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/getNearestImageIndex (line 369)
index = sub2ind(dataSize, nRC(1), nRC(2));
Error in matlab.graphics.chart.interaction.dataannotatable.ImageAdaptor/doGetNearestPoint (line 225)
index = getNearestImageIndex(hObj, point_v, basis_row, basis_col);
Error in matlab.graphics.interaction.uiaxes.DataTipsBase
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipHoverLingerInteraction/handleEvent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.DataTipBaseInteraction/response
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase/responseevent
Error in matlab.graphics.interaction.graphicscontrol.InteractionObjects.InteractionBase
Error in matlab.graphics.interaction.graphicscontrol.GenericControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.LayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.layoutable.GridLayoutableControl/process
Error in matlab.graphics.interaction.graphicscontrol.AxesControl/process
Error in matlab.graphics.interaction.graphicscontrol.ControlManager/processMessage
> In matlab.graphics.interaction.graphicscontrol/GenericControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/LayoutableControl/process
In matlab.graphics.interaction.graphicscontrol.layoutable/GridLayoutableControl/process
In matlab.graphics.interaction.graphicscontrol/AxesControl/process
In matlab.graphics.interaction.graphicscontrol/ControlManager/processMessage gui, axes MATLAB Answers — New Questions
Questions about the switching losses of a MOSFET
Using Simulink for circuit simulation of a PMSM system, with a focus on MOSFET losses in the inverter circuit.
MOSFET (Ideal, Switching), PS signal controlled. The thermal port is connected to a 25°C constant temperature source.
According to the simulation results, three-phase currents, motor torque and speed are consistent with the expected values.
Q1. The MOSFET switching losses exist only during positive current, and they disappear during negative current. Should switching losses exist only during positive current?
Q2. The fixed switch loss value set in the “MOSFET (Ideal, Switching)” module is 3e-5 J. However, the simulation results show fluctuations around this value with respect to the Id current. What is the specific relationship between the fixed switch loss value and the fluctuating simulation resultsUsing Simulink for circuit simulation of a PMSM system, with a focus on MOSFET losses in the inverter circuit.
MOSFET (Ideal, Switching), PS signal controlled. The thermal port is connected to a 25°C constant temperature source.
According to the simulation results, three-phase currents, motor torque and speed are consistent with the expected values.
Q1. The MOSFET switching losses exist only during positive current, and they disappear during negative current. Should switching losses exist only during positive current?
Q2. The fixed switch loss value set in the “MOSFET (Ideal, Switching)” module is 3e-5 J. However, the simulation results show fluctuations around this value with respect to the Id current. What is the specific relationship between the fixed switch loss value and the fluctuating simulation results Using Simulink for circuit simulation of a PMSM system, with a focus on MOSFET losses in the inverter circuit.
MOSFET (Ideal, Switching), PS signal controlled. The thermal port is connected to a 25°C constant temperature source.
According to the simulation results, three-phase currents, motor torque and speed are consistent with the expected values.
Q1. The MOSFET switching losses exist only during positive current, and they disappear during negative current. Should switching losses exist only during positive current?
Q2. The fixed switch loss value set in the “MOSFET (Ideal, Switching)” module is 3e-5 J. However, the simulation results show fluctuations around this value with respect to the Id current. What is the specific relationship between the fixed switch loss value and the fluctuating simulation results simscape, simulink, mosfet, pmsm MATLAB Answers — New Questions
parallel computing apply to my problem
clc;
clear all;
close all;
tic;
N=10;
a=zeros(1,N+1);
b=zeros(1,N+1);
syms t a b
a(1)=2;b(1)=-3;
for i=1:7
v1=(a(i)*t+5*a(i)*t^2+30*b(i)*t);
v2=(b(i)*t-20*b(i)*t^3+30*a(i)*b(i)*t);
a(i+1)=diff(v1,t);
b(i+1)=diff(v2,t);
end
toc
fplot(v1,[0 0.1],’b’);
;;;i want to go for loop till 250 for above kind of problem when there are 8 equations means v1,v2…v8.it is taking so much of time and sometimes matlab is not responding.Please help me how can i wrote that proble with parallel computing or any some other simple programmimgclc;
clear all;
close all;
tic;
N=10;
a=zeros(1,N+1);
b=zeros(1,N+1);
syms t a b
a(1)=2;b(1)=-3;
for i=1:7
v1=(a(i)*t+5*a(i)*t^2+30*b(i)*t);
v2=(b(i)*t-20*b(i)*t^3+30*a(i)*b(i)*t);
a(i+1)=diff(v1,t);
b(i+1)=diff(v2,t);
end
toc
fplot(v1,[0 0.1],’b’);
;;;i want to go for loop till 250 for above kind of problem when there are 8 equations means v1,v2…v8.it is taking so much of time and sometimes matlab is not responding.Please help me how can i wrote that proble with parallel computing or any some other simple programmimg clc;
clear all;
close all;
tic;
N=10;
a=zeros(1,N+1);
b=zeros(1,N+1);
syms t a b
a(1)=2;b(1)=-3;
for i=1:7
v1=(a(i)*t+5*a(i)*t^2+30*b(i)*t);
v2=(b(i)*t-20*b(i)*t^3+30*a(i)*b(i)*t);
a(i+1)=diff(v1,t);
b(i+1)=diff(v2,t);
end
toc
fplot(v1,[0 0.1],’b’);
;;;i want to go for loop till 250 for above kind of problem when there are 8 equations means v1,v2…v8.it is taking so much of time and sometimes matlab is not responding.Please help me how can i wrote that proble with parallel computing or any some other simple programmimg parallel computing, syms MATLAB Answers — New Questions