Tag Archives: matlab
i have a csv with data separated with commas and columns also are separated with commas
example of one line of my csv [6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,]
i am usin this:
M=readmatrix(‘piloto.csv’);
M2=readtable(‘piloto.csv’);
but the values are separated alsoexample of one line of my csv [6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,]
i am usin this:
M=readmatrix(‘piloto.csv’);
M2=readtable(‘piloto.csv’);
but the values are separated also example of one line of my csv [6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,6,75000e-003,0,00000e+000,]
i am usin this:
M=readmatrix(‘piloto.csv’);
M2=readtable(‘piloto.csv’);
but the values are separated also readmatrix, readtable, commas MATLAB Answers — New Questions
Can I plot S21 and S12 from .s1p data?
In a first set of measurements from my VNA (vector network analyser), I was able to collect .s2p files which I could plot the S-parameters from. In a later set of measurements, I somehow only had the option to save the files as either .s1p. Can I not gain the S21 and s12 plots from these? Matlab won’t let me import the data either, is this something that Matlab is not designed to do or am I doing something wrong?In a first set of measurements from my VNA (vector network analyser), I was able to collect .s2p files which I could plot the S-parameters from. In a later set of measurements, I somehow only had the option to save the files as either .s1p. Can I not gain the S21 and s12 plots from these? Matlab won’t let me import the data either, is this something that Matlab is not designed to do or am I doing something wrong? In a first set of measurements from my VNA (vector network analyser), I was able to collect .s2p files which I could plot the S-parameters from. In a later set of measurements, I somehow only had the option to save the files as either .s1p. Can I not gain the S21 and s12 plots from these? Matlab won’t let me import the data either, is this something that Matlab is not designed to do or am I doing something wrong? s-parameters, scattering parameters, vna data, vector network analyser data, .s1p MATLAB Answers — New Questions
randperm function for a table – keep rows together
I looked in help but everone seems to be randomizing a vector.
The closest ask I can find is
https://www.mathworks.com/matlabcentral/answers/155207-matrix-with-different-randperm-rows?s_tid=sug_su
I have a table (including a category column) I asked (Q )about using Shuffle but if that doesn’t handle table shuffling like I need i can take the performance hit and use randperm()
Here’s what I’m doing:
app.TrialsTable = table(‘Size’,[2*C 4],’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′});
… % fill the table from given input table, expanding rows as needed for number of repeats
app.TrialsTable(index, 1) = … %and so on
…
app.TrialsTable = Shuffle(app.TrialsTable, ???); % if anyone knows how to do it this way
& or
app.TrialsTable(randperm(height(app.TrialsTable(:,:)))); % How do I make this line work??
% and then finally
set(app.RandTrialsTable,’Data’,app.TrialsTable(:,:)); % save it to the UITable for display in the Figure
Testing at the command prompt for various options of randperm(…)
app.TrialsTable(randperm(height(app.TrialsTable(:,:))))
Error using ()
Subscripting into a table using one subscript (as in t(i)) is not supported. Specify
a row subscript and a variable subscript, as in t(rows,vars). To select variables,
use t(:,i) or for one variable t.(i). To select rows, use t(i,:).
I didn’t use 1 subscript so the Error message doesn’t help
Another try:
app.TrialsTable(:,:)(randperm(height(app.TrialsTable(:,:))))
Error: Invalid array indexing.
Test
(randperm(height(app.TrialsTable(:,:))))
ans =
Columns 1 through 14
17 18 13 8 3 9 19 27 14 6 25 15 2 5
Columns 15 through 28
7 23 24 12 22 20 28 21 26 4 16 1 10 11
I only have 4 columns (28 rows)
Try
(randperm(height(app.TrialsTable)))
ans =
Columns 1 through 14
27 14 22 4 10 2 21 3 5 15 18 28 23 7
Columns 15 through 28
24 16 25 9 6 13 26 17 19 20 1 11 8 12
No sign of the category column (‘L’ or ‘R’) sorting along with it.
OH! maybe I don’t need to tell the height (as the Shuffle guy said)
(randperm(app.TrialsTable))
Error using randperm
Conversion to double from table is not possible.
try
(randperm(app.TrialsTable(:,:)))
Error using randperm
Conversion to double from table is not possible.
randperm(1:size(app.TrialsTable.Row))
ans =
1×0 empty double row vector
I tried on my own, time to ask for help!I looked in help but everone seems to be randomizing a vector.
The closest ask I can find is
https://www.mathworks.com/matlabcentral/answers/155207-matrix-with-different-randperm-rows?s_tid=sug_su
I have a table (including a category column) I asked (Q )about using Shuffle but if that doesn’t handle table shuffling like I need i can take the performance hit and use randperm()
Here’s what I’m doing:
app.TrialsTable = table(‘Size’,[2*C 4],’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′});
… % fill the table from given input table, expanding rows as needed for number of repeats
app.TrialsTable(index, 1) = … %and so on
…
app.TrialsTable = Shuffle(app.TrialsTable, ???); % if anyone knows how to do it this way
& or
app.TrialsTable(randperm(height(app.TrialsTable(:,:)))); % How do I make this line work??
% and then finally
set(app.RandTrialsTable,’Data’,app.TrialsTable(:,:)); % save it to the UITable for display in the Figure
Testing at the command prompt for various options of randperm(…)
app.TrialsTable(randperm(height(app.TrialsTable(:,:))))
Error using ()
Subscripting into a table using one subscript (as in t(i)) is not supported. Specify
a row subscript and a variable subscript, as in t(rows,vars). To select variables,
use t(:,i) or for one variable t.(i). To select rows, use t(i,:).
I didn’t use 1 subscript so the Error message doesn’t help
Another try:
app.TrialsTable(:,:)(randperm(height(app.TrialsTable(:,:))))
Error: Invalid array indexing.
Test
(randperm(height(app.TrialsTable(:,:))))
ans =
Columns 1 through 14
17 18 13 8 3 9 19 27 14 6 25 15 2 5
Columns 15 through 28
7 23 24 12 22 20 28 21 26 4 16 1 10 11
I only have 4 columns (28 rows)
Try
(randperm(height(app.TrialsTable)))
ans =
Columns 1 through 14
27 14 22 4 10 2 21 3 5 15 18 28 23 7
Columns 15 through 28
24 16 25 9 6 13 26 17 19 20 1 11 8 12
No sign of the category column (‘L’ or ‘R’) sorting along with it.
OH! maybe I don’t need to tell the height (as the Shuffle guy said)
(randperm(app.TrialsTable))
Error using randperm
Conversion to double from table is not possible.
try
(randperm(app.TrialsTable(:,:)))
Error using randperm
Conversion to double from table is not possible.
randperm(1:size(app.TrialsTable.Row))
ans =
1×0 empty double row vector
I tried on my own, time to ask for help! I looked in help but everone seems to be randomizing a vector.
The closest ask I can find is
https://www.mathworks.com/matlabcentral/answers/155207-matrix-with-different-randperm-rows?s_tid=sug_su
I have a table (including a category column) I asked (Q )about using Shuffle but if that doesn’t handle table shuffling like I need i can take the performance hit and use randperm()
Here’s what I’m doing:
app.TrialsTable = table(‘Size’,[2*C 4],’VariableTypes’,{‘uint8′,’uint8′,’categorical’,’int16′});
… % fill the table from given input table, expanding rows as needed for number of repeats
app.TrialsTable(index, 1) = … %and so on
…
app.TrialsTable = Shuffle(app.TrialsTable, ???); % if anyone knows how to do it this way
& or
app.TrialsTable(randperm(height(app.TrialsTable(:,:)))); % How do I make this line work??
% and then finally
set(app.RandTrialsTable,’Data’,app.TrialsTable(:,:)); % save it to the UITable for display in the Figure
Testing at the command prompt for various options of randperm(…)
app.TrialsTable(randperm(height(app.TrialsTable(:,:))))
Error using ()
Subscripting into a table using one subscript (as in t(i)) is not supported. Specify
a row subscript and a variable subscript, as in t(rows,vars). To select variables,
use t(:,i) or for one variable t.(i). To select rows, use t(i,:).
I didn’t use 1 subscript so the Error message doesn’t help
Another try:
app.TrialsTable(:,:)(randperm(height(app.TrialsTable(:,:))))
Error: Invalid array indexing.
Test
(randperm(height(app.TrialsTable(:,:))))
ans =
Columns 1 through 14
17 18 13 8 3 9 19 27 14 6 25 15 2 5
Columns 15 through 28
7 23 24 12 22 20 28 21 26 4 16 1 10 11
I only have 4 columns (28 rows)
Try
(randperm(height(app.TrialsTable)))
ans =
Columns 1 through 14
27 14 22 4 10 2 21 3 5 15 18 28 23 7
Columns 15 through 28
24 16 25 9 6 13 26 17 19 20 1 11 8 12
No sign of the category column (‘L’ or ‘R’) sorting along with it.
OH! maybe I don’t need to tell the height (as the Shuffle guy said)
(randperm(app.TrialsTable))
Error using randperm
Conversion to double from table is not possible.
try
(randperm(app.TrialsTable(:,:)))
Error using randperm
Conversion to double from table is not possible.
randperm(1:size(app.TrialsTable.Row))
ans =
1×0 empty double row vector
I tried on my own, time to ask for help! shuffling a table MATLAB Answers — New Questions
Adding a global legend to a tiledlayout
Good morning,
I’m using MATLAB R2020a Update 2. I have a tiledlayout of five (three by two) area plots and would like to use the sixth, currently empty, tile to add a global legend. I’ve already found this question, and understand that there’s no official, built-in way of doing this, but perhaps it’s possible to get creative.
What I’ve tried is adding a new, empty area plot to the sixth tile, using NaNs as the shares, then adding a legend to that and setting the axis object for that tile to invisible, as follows:
% …
ax = nexttile;
area([NaN NaN], NaN(2, 4));
leg = legend({‘tar’, ‘sta’, ‘ext’, ‘dmp’);
leg.Location = ‘none’;
leg.Interpreter = ‘latex’;
leg.FontSize = 16;
ax.Visible = false;
This works in principle, but leaves a horizontal line where the X axis would be:
This only happens when I use area(), not e.g. plot(). Perhaps it’s a bug, perhaps it’s intentional and due to the way area() works. In any case it’s not what I want, but I can’t get rid of it (without breaking other things in the process).
I had the idea of making the children of this axis, i.e. the areas of the area plot, invisible as well, like so:
for i = 1:length(ax.Children)
ax.Children(i).Visible = false;
end
But while this gets rid of the horizontal line it also grays out the legend entries:
This behavior in turn is known and expected and apparently cannot be changed. The workaround suggested by a Mathworks staffer in the linked question is to plot NaNs; but that’s what I’m already doing and what’s leaving the horizontal line, due to area()’s quirks.
Can anyone help?
I’m not hung up on specifically creating an invisible area(), this is merely the best (first, only) idea I had for fudging a global legend. If anyone can make this approach work, that’d be wonderful. If anyone has another idea of how to achieve a similar effect, that’d be wonderful as well.
Thank you very much!Good morning,
I’m using MATLAB R2020a Update 2. I have a tiledlayout of five (three by two) area plots and would like to use the sixth, currently empty, tile to add a global legend. I’ve already found this question, and understand that there’s no official, built-in way of doing this, but perhaps it’s possible to get creative.
What I’ve tried is adding a new, empty area plot to the sixth tile, using NaNs as the shares, then adding a legend to that and setting the axis object for that tile to invisible, as follows:
% …
ax = nexttile;
area([NaN NaN], NaN(2, 4));
leg = legend({‘tar’, ‘sta’, ‘ext’, ‘dmp’);
leg.Location = ‘none’;
leg.Interpreter = ‘latex’;
leg.FontSize = 16;
ax.Visible = false;
This works in principle, but leaves a horizontal line where the X axis would be:
This only happens when I use area(), not e.g. plot(). Perhaps it’s a bug, perhaps it’s intentional and due to the way area() works. In any case it’s not what I want, but I can’t get rid of it (without breaking other things in the process).
I had the idea of making the children of this axis, i.e. the areas of the area plot, invisible as well, like so:
for i = 1:length(ax.Children)
ax.Children(i).Visible = false;
end
But while this gets rid of the horizontal line it also grays out the legend entries:
This behavior in turn is known and expected and apparently cannot be changed. The workaround suggested by a Mathworks staffer in the linked question is to plot NaNs; but that’s what I’m already doing and what’s leaving the horizontal line, due to area()’s quirks.
Can anyone help?
I’m not hung up on specifically creating an invisible area(), this is merely the best (first, only) idea I had for fudging a global legend. If anyone can make this approach work, that’d be wonderful. If anyone has another idea of how to achieve a similar effect, that’d be wonderful as well.
Thank you very much! Good morning,
I’m using MATLAB R2020a Update 2. I have a tiledlayout of five (three by two) area plots and would like to use the sixth, currently empty, tile to add a global legend. I’ve already found this question, and understand that there’s no official, built-in way of doing this, but perhaps it’s possible to get creative.
What I’ve tried is adding a new, empty area plot to the sixth tile, using NaNs as the shares, then adding a legend to that and setting the axis object for that tile to invisible, as follows:
% …
ax = nexttile;
area([NaN NaN], NaN(2, 4));
leg = legend({‘tar’, ‘sta’, ‘ext’, ‘dmp’);
leg.Location = ‘none’;
leg.Interpreter = ‘latex’;
leg.FontSize = 16;
ax.Visible = false;
This works in principle, but leaves a horizontal line where the X axis would be:
This only happens when I use area(), not e.g. plot(). Perhaps it’s a bug, perhaps it’s intentional and due to the way area() works. In any case it’s not what I want, but I can’t get rid of it (without breaking other things in the process).
I had the idea of making the children of this axis, i.e. the areas of the area plot, invisible as well, like so:
for i = 1:length(ax.Children)
ax.Children(i).Visible = false;
end
But while this gets rid of the horizontal line it also grays out the legend entries:
This behavior in turn is known and expected and apparently cannot be changed. The workaround suggested by a Mathworks staffer in the linked question is to plot NaNs; but that’s what I’m already doing and what’s leaving the horizontal line, due to area()’s quirks.
Can anyone help?
I’m not hung up on specifically creating an invisible area(), this is merely the best (first, only) idea I had for fudging a global legend. If anyone can make this approach work, that’d be wonderful. If anyone has another idea of how to achieve a similar effect, that’d be wonderful as well.
Thank you very much! tiledlayout, legend MATLAB Answers — New Questions
Improving Simulation Speed in Simulink Using C language (mexw64 File) for DC/DC Converters
I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance.I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance. I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance. simulink, s-function, c code MATLAB Answers — New Questions
How can I turn off the automatic import of file logs from my Speedgoat target?
I am using File Log blocks in my Simulink Real-Time (SLRT) model (available since R2020b) to log data on the Speedgoat target computer file system. After the real-time application stops, if the development computer running MATLAB is connected to the Speedgoat, File Log data is automatically transferred and loaded on the Simulation Data Inspector (SDI).
What are the different ways to turn off this auto-import behavior for File Logs?I am using File Log blocks in my Simulink Real-Time (SLRT) model (available since R2020b) to log data on the Speedgoat target computer file system. After the real-time application stops, if the development computer running MATLAB is connected to the Speedgoat, File Log data is automatically transferred and loaded on the Simulation Data Inspector (SDI).
What are the different ways to turn off this auto-import behavior for File Logs? I am using File Log blocks in my Simulink Real-Time (SLRT) model (available since R2020b) to log data on the Speedgoat target computer file system. After the real-time application stops, if the development computer running MATLAB is connected to the Speedgoat, File Log data is automatically transferred and loaded on the Simulation Data Inspector (SDI).
What are the different ways to turn off this auto-import behavior for File Logs? autoimportfilelog, filelog MATLAB Answers — New Questions
Highlight certain regions where the value goes to 0 in Stacked Plot
Hi, can we highlight certain regions in stackplot where the value of a certain variable goes to zero.
I currently have
p1=stackedplot(final_log(:,["TC2","Ftot"]));
I want to highlight cerain areah where Ftot goes to Zero
Thank you.Hi, can we highlight certain regions in stackplot where the value of a certain variable goes to zero.
I currently have
p1=stackedplot(final_log(:,["TC2","Ftot"]));
I want to highlight cerain areah where Ftot goes to Zero
Thank you. Hi, can we highlight certain regions in stackplot where the value of a certain variable goes to zero.
I currently have
p1=stackedplot(final_log(:,["TC2","Ftot"]));
I want to highlight cerain areah where Ftot goes to Zero
Thank you. stackedplot MATLAB Answers — New Questions
Solving unknown matrics to the power 20
% [P] * [TPM]^n* [R]= CR
disp(‘Create an array with seven elements in a single row:’)
disp(‘>> P = [1 0 0 0 0 0 0]’)
p = [1 0 0 0 0 0 0]
disp(‘Create an array with seven elements in a single column:’)
disp(‘>> R = [9; 8; 7; 6; 5; 4; 3]’)
R = [9; 8; 7; 6; 5; 4; 3]
CR = [0.45]
Solve (TPM)^20=CR/ (p*R)
I would like to find the matrics [TPM] with size 7*7? How to do it ?% [P] * [TPM]^n* [R]= CR
disp(‘Create an array with seven elements in a single row:’)
disp(‘>> P = [1 0 0 0 0 0 0]’)
p = [1 0 0 0 0 0 0]
disp(‘Create an array with seven elements in a single column:’)
disp(‘>> R = [9; 8; 7; 6; 5; 4; 3]’)
R = [9; 8; 7; 6; 5; 4; 3]
CR = [0.45]
Solve (TPM)^20=CR/ (p*R)
I would like to find the matrics [TPM] with size 7*7? How to do it ? % [P] * [TPM]^n* [R]= CR
disp(‘Create an array with seven elements in a single row:’)
disp(‘>> P = [1 0 0 0 0 0 0]’)
p = [1 0 0 0 0 0 0]
disp(‘Create an array with seven elements in a single column:’)
disp(‘>> R = [9; 8; 7; 6; 5; 4; 3]’)
R = [9; 8; 7; 6; 5; 4; 3]
CR = [0.45]
Solve (TPM)^20=CR/ (p*R)
I would like to find the matrics [TPM] with size 7*7? How to do it ? matrix, solve, equation, matrix manipulation, matrix array, matrices, matlab, mathematics MATLAB Answers — New Questions
How do I download gstreamer into matlab, it is on my computer
I have started out with MATLAB, I have installed psychtoolbox and have downloaded it into MATLAB, I have got gstreamer onto my laptop but having trouble to know what to do next to get it into MATLAB also so I can start to create graphics using all 3 together, MATLAB, with psychtoolbox and gstreamer. I need to donthis so I can start going throug( my tutorials with PTBI have started out with MATLAB, I have installed psychtoolbox and have downloaded it into MATLAB, I have got gstreamer onto my laptop but having trouble to know what to do next to get it into MATLAB also so I can start to create graphics using all 3 together, MATLAB, with psychtoolbox and gstreamer. I need to donthis so I can start going throug( my tutorials with PTB I have started out with MATLAB, I have installed psychtoolbox and have downloaded it into MATLAB, I have got gstreamer onto my laptop but having trouble to know what to do next to get it into MATLAB also so I can start to create graphics using all 3 together, MATLAB, with psychtoolbox and gstreamer. I need to donthis so I can start going throug( my tutorials with PTB gstreamer psychtoolbox, installation. MATLAB Answers — New Questions
Use of eig(A) for eigenvectors
Hi, I try to call the eigenvectors of the respective eigenvalue, but that part in the code gives an error:
"Unrecognize function or variable ‘eigvecs_theta’
I tried eig and eigvec instead of eigvecs_theta, but nothing works. What did I miss here? Thanks
% Discretization parameters
theta_min = 0;
theta_max = pi;
M = 100; % Number of grid points
theta = linspace(theta_min, theta_max, M);
dtheta = theta(2) – theta(1);
% Initialize the Theta(theta) vector
Theta = zeros(M, 1);
% Set up the finite difference matrix
B = zeros(M, M);
for j = 3:M-2
B(j, j-2) = -1 / (2 * dtheta^3);
B(j, j-1) = 2 / (dtheta^3);
B(j, j) = -2 / (dtheta^3) + l * (l + 1);
B(j, j+1) = 2 / (dtheta^3);
B(j, j+2) = -1 / (2 * dtheta^3);
end
% Apply boundary conditions (example: Theta(0) = 0 and Theta(pi) = 0)
B(1,1) = 1;
B(M,M) = 1;
% Solve the eigenvalue problem
[~, D_theta] = eig(B);
% The eigenvalues are the diagonal elements of D_theta
eigenvalues_theta = diag(D_theta);
% The solution Theta(theta) corresponds to the eigenvector with the desired eigenvalue
Theta = eig(:, idx);
% Plot the solution
plot(theta, Theta);
xlabel(‘theta’);
ylabel(‘Theta(theta)’);
title(‘Angular Wavefunction’);
endHi, I try to call the eigenvectors of the respective eigenvalue, but that part in the code gives an error:
"Unrecognize function or variable ‘eigvecs_theta’
I tried eig and eigvec instead of eigvecs_theta, but nothing works. What did I miss here? Thanks
% Discretization parameters
theta_min = 0;
theta_max = pi;
M = 100; % Number of grid points
theta = linspace(theta_min, theta_max, M);
dtheta = theta(2) – theta(1);
% Initialize the Theta(theta) vector
Theta = zeros(M, 1);
% Set up the finite difference matrix
B = zeros(M, M);
for j = 3:M-2
B(j, j-2) = -1 / (2 * dtheta^3);
B(j, j-1) = 2 / (dtheta^3);
B(j, j) = -2 / (dtheta^3) + l * (l + 1);
B(j, j+1) = 2 / (dtheta^3);
B(j, j+2) = -1 / (2 * dtheta^3);
end
% Apply boundary conditions (example: Theta(0) = 0 and Theta(pi) = 0)
B(1,1) = 1;
B(M,M) = 1;
% Solve the eigenvalue problem
[~, D_theta] = eig(B);
% The eigenvalues are the diagonal elements of D_theta
eigenvalues_theta = diag(D_theta);
% The solution Theta(theta) corresponds to the eigenvector with the desired eigenvalue
Theta = eig(:, idx);
% Plot the solution
plot(theta, Theta);
xlabel(‘theta’);
ylabel(‘Theta(theta)’);
title(‘Angular Wavefunction’);
end Hi, I try to call the eigenvectors of the respective eigenvalue, but that part in the code gives an error:
"Unrecognize function or variable ‘eigvecs_theta’
I tried eig and eigvec instead of eigvecs_theta, but nothing works. What did I miss here? Thanks
% Discretization parameters
theta_min = 0;
theta_max = pi;
M = 100; % Number of grid points
theta = linspace(theta_min, theta_max, M);
dtheta = theta(2) – theta(1);
% Initialize the Theta(theta) vector
Theta = zeros(M, 1);
% Set up the finite difference matrix
B = zeros(M, M);
for j = 3:M-2
B(j, j-2) = -1 / (2 * dtheta^3);
B(j, j-1) = 2 / (dtheta^3);
B(j, j) = -2 / (dtheta^3) + l * (l + 1);
B(j, j+1) = 2 / (dtheta^3);
B(j, j+2) = -1 / (2 * dtheta^3);
end
% Apply boundary conditions (example: Theta(0) = 0 and Theta(pi) = 0)
B(1,1) = 1;
B(M,M) = 1;
% Solve the eigenvalue problem
[~, D_theta] = eig(B);
% The eigenvalues are the diagonal elements of D_theta
eigenvalues_theta = diag(D_theta);
% The solution Theta(theta) corresponds to the eigenvector with the desired eigenvalue
Theta = eig(:, idx);
% Plot the solution
plot(theta, Theta);
xlabel(‘theta’);
ylabel(‘Theta(theta)’);
title(‘Angular Wavefunction’);
end eigenvalues, eigenvectors MATLAB Answers — New Questions
Why are long integers inappropriate for switch expressions?
Why are long integers used in switch expressions (C99) flagged as a defect for being an inappropriate data type in Polyspace Bug Finder?
Matlab documentation only allows char, int, short or enum. Considering int can be either a 64 or 32 bit integer dependent on platform, it seems that a long, an explicit 32 bit integer, should be allowed.
Link to Matlab documentation of defect:
https://www.mathworks.com/help/bugfinder/ref/possiblyinappropriatedatatypeforswitchexpression.html
Example:
unsigned long x = 1u;
switch(x) // Defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
unsigned int y = 1u;
switch(y) // No defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
Thanks,
TommyWhy are long integers used in switch expressions (C99) flagged as a defect for being an inappropriate data type in Polyspace Bug Finder?
Matlab documentation only allows char, int, short or enum. Considering int can be either a 64 or 32 bit integer dependent on platform, it seems that a long, an explicit 32 bit integer, should be allowed.
Link to Matlab documentation of defect:
https://www.mathworks.com/help/bugfinder/ref/possiblyinappropriatedatatypeforswitchexpression.html
Example:
unsigned long x = 1u;
switch(x) // Defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
unsigned int y = 1u;
switch(y) // No defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
Thanks,
Tommy Why are long integers used in switch expressions (C99) flagged as a defect for being an inappropriate data type in Polyspace Bug Finder?
Matlab documentation only allows char, int, short or enum. Considering int can be either a 64 or 32 bit integer dependent on platform, it seems that a long, an explicit 32 bit integer, should be allowed.
Link to Matlab documentation of defect:
https://www.mathworks.com/help/bugfinder/ref/possiblyinappropriatedatatypeforswitchexpression.html
Example:
unsigned long x = 1u;
switch(x) // Defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
unsigned int y = 1u;
switch(y) // No defect
{
case 0u:
// do thing
break;
default:
// do thing
break;
}
Thanks,
Tommy polyspace, switch expression, data type, c99 MATLAB Answers — New Questions
Error using pdepe: Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative
I get this error trying to solve a system of PDEs, and I do not know if such system is solvable with ‘pdepe’. The equations are:
energy balance equation, and:
mass balance equations. Initial conditions:
Boundary conditions:
The variables in which I am solving are however T,, knowing that:
, I can write initial condition for , and I have also a value for .
I tried writing the equations in the form required by ‘pdepe’. Also, note that many parameters depends on the vector , IN particular, the term ‘v’ includes a partial spatial derivative w.r.t. P, which i transformed in a spatial derivative w.r.t. u(1) and u(2) with the above formula. Note that many constants are imported with the file.m including the initial conditions that are: This is the code of the 3 functions used inside the pde call (sorry is a bit long and messy):
function [c,f,s] = pdefun(x,t,u,dudx)
% load data
run(‘HM_data.m’);
% compute epsilon , F and dfdt
F = (hm.rho_s_in-u(3))/(u(3)*hm.tau_p – hm.rho_s_in*hm.w_max);
epsilon = 1 – (1 – hm.epsilon_0)*((1 + hm.tau_p*F)/(1 + hm.tau_a*F));
P = u(2)*u(1)*hm.R_gas/hm.MH2;
P_eq_a = (hm.C0_a*hm.C1_a*(F)^(hm.C2_a)/(1+hm.C1_a*(F)^(hm.C2_a)) + hm.C3_a*F + exp(hm.C4_a*(F-hm.C5_a)))*exp(-hm.K_a*((1/u(1))-(1/303)));
k_a = (hm.kappa_a/(1 – epsilon)) * exp(-hm.E_a/(hm.R_gas*u(1))) * log(P/P_eq_a);
dfdt = k_a*(1-F);
% compute diagonal matrix c
Cps = 6000*(3.1*hm.R + 10.04*hm.x_max*F)/(hm.Ms + 6*hm.x_max*F);
rho_C_eff = epsilon*u(2)*hm.Cpg + (1- epsilon)*u(3)*Cps;
c = [rho_C_eff; epsilon; 1-epsilon];
% COMPUTE VECTOR f
% velocity
Dp = hm.D_in*(1+ F*hm.tau_p)^(1/3);
Kp = (Dp^2)*(epsilon^3)/(150*(1-epsilon)^2);
v_cost = -Kp*hm.R_gas/(hm.mu_g*hm.MH2);
v = v_cost*(dudx(1)*u(2) + dudx(2)*u(1));
% effective thermal conductivity
N = 3.08/epsilon – 1.13;
Fn = 4/3 * hm.E_prime * hm.R^(1/2) * hm.dv^(1.5);
Hv = hm.c1*hm.dv^(hm.c2);
Rs = 0.565*Hv*hm.dv/(hm.ks*Fn);
a_H = (0.75*Fn*hm.R/hm.E_prime)^(1/3);
a_LH = [];
if epsilon <= 0.47 && epsilon >= 0.01
a_LH = 1.605/sqrt(epsilon);
elseif epsilon > 0.47 && epsilon <= 1
a_LH = 3.51 – 2.51*epsilon;
else
error(‘error epsilon’);
end
a_L = a_LH*a_H;
R_L = 1/(2*hm.ks*a_L);
Pmax = 2/pi*hm.E_prime*(hm.dv/hm.R)^(0.5);
Hc = hm.c1*(1.62*hm.dv)^(hm.c2);
a1 = erfcinv(2*Pmax/Hc);
a2 = erfcinv(0.03*Pmax/Hc) – a1;
coef_a = 2*hm.b/Dp;
coef_c = -(6*(hm.gamma-1)/(9*hm.gamma-5))* (hm.kg_ref*hm.MH2/(u(1)*u(2)*hm.R_gas))*(hm.MH2*u(1)/(2*hm.kb))^(0.5);
l_m = (-1 + sqrt(1 – 4*coef_a*coef_c))/(2*coef_a);
kg = hm.kg_ref/(1+2*hm.b*l_m/Dp);
M = (((2-hm.alpha_T1)/hm.alpha_T1)+((2-hm.alpha_T2)/hm.alpha_T2))*(2*hm.gamma/(1+hm.gamma))*(1/hm.Pr)*l_m;
R_g = sqrt(2)*hm.sigma*a2/(pi * kg * a_L^2 * log(1+ a2/(a1+M/(sqrt(2)*hm.sigma))));
L = (hm.gamma+1)*3*Dp/((9*hm.gamma-5)*4*l_m*sqrt(pi));
R_G = 1/(2*pi*kg*Dp*(0.5*log(1+L) + log(1+sqrt(L)) + 1/(1+sqrt(L)) – 1));
R_mic = Rs*R_g/(Rs+R_g);
R_c_inv = 1/(R_mic+R_L) + 1/R_G;
k_eff = N*(1-epsilon)*R_c_inv/(pi*Dp);
f = [k_eff*dudx(1); -u(2)*v; 0];
% compute vector s
m_dot_a = (1-epsilon)*(hm.rho_sat-u(3))*dfdt;
s = [u(2)*hm.Cpg*v*dudx(1) + m_dot_a*hm.delta_H ; -m_dot_a+hm.phi_abs; m_dot_a];
end
function u0 = icfun(x)
run(‘HM_data.m’);
u0 = hm.ic;
end
function [pl,ql,pr,qr] = bcfun(xl, ul, xr, ur, t)
run(‘HM_data.m’);
Nu_abs = 0.3+((0.62*(hm.Re_a^(0.5))*(hm.Pr_a^(1/3)))/(1+(0.4/hm.Pr_a)^(2/3))^(1/4)*((1+(hm.Re_a/282000)^(5/8))^(4/5)));
h_f = Nu_abs*hm.kf/hm.D_tank;
pl = [0 ; 0; 0];
ql = [1; 0; 0];
pr = [h_f*(ur(1)-hm.Tf_a); 0; 0];
qr = [-1; 0; 0];
endI get this error trying to solve a system of PDEs, and I do not know if such system is solvable with ‘pdepe’. The equations are:
energy balance equation, and:
mass balance equations. Initial conditions:
Boundary conditions:
The variables in which I am solving are however T,, knowing that:
, I can write initial condition for , and I have also a value for .
I tried writing the equations in the form required by ‘pdepe’. Also, note that many parameters depends on the vector , IN particular, the term ‘v’ includes a partial spatial derivative w.r.t. P, which i transformed in a spatial derivative w.r.t. u(1) and u(2) with the above formula. Note that many constants are imported with the file.m including the initial conditions that are: This is the code of the 3 functions used inside the pde call (sorry is a bit long and messy):
function [c,f,s] = pdefun(x,t,u,dudx)
% load data
run(‘HM_data.m’);
% compute epsilon , F and dfdt
F = (hm.rho_s_in-u(3))/(u(3)*hm.tau_p – hm.rho_s_in*hm.w_max);
epsilon = 1 – (1 – hm.epsilon_0)*((1 + hm.tau_p*F)/(1 + hm.tau_a*F));
P = u(2)*u(1)*hm.R_gas/hm.MH2;
P_eq_a = (hm.C0_a*hm.C1_a*(F)^(hm.C2_a)/(1+hm.C1_a*(F)^(hm.C2_a)) + hm.C3_a*F + exp(hm.C4_a*(F-hm.C5_a)))*exp(-hm.K_a*((1/u(1))-(1/303)));
k_a = (hm.kappa_a/(1 – epsilon)) * exp(-hm.E_a/(hm.R_gas*u(1))) * log(P/P_eq_a);
dfdt = k_a*(1-F);
% compute diagonal matrix c
Cps = 6000*(3.1*hm.R + 10.04*hm.x_max*F)/(hm.Ms + 6*hm.x_max*F);
rho_C_eff = epsilon*u(2)*hm.Cpg + (1- epsilon)*u(3)*Cps;
c = [rho_C_eff; epsilon; 1-epsilon];
% COMPUTE VECTOR f
% velocity
Dp = hm.D_in*(1+ F*hm.tau_p)^(1/3);
Kp = (Dp^2)*(epsilon^3)/(150*(1-epsilon)^2);
v_cost = -Kp*hm.R_gas/(hm.mu_g*hm.MH2);
v = v_cost*(dudx(1)*u(2) + dudx(2)*u(1));
% effective thermal conductivity
N = 3.08/epsilon – 1.13;
Fn = 4/3 * hm.E_prime * hm.R^(1/2) * hm.dv^(1.5);
Hv = hm.c1*hm.dv^(hm.c2);
Rs = 0.565*Hv*hm.dv/(hm.ks*Fn);
a_H = (0.75*Fn*hm.R/hm.E_prime)^(1/3);
a_LH = [];
if epsilon <= 0.47 && epsilon >= 0.01
a_LH = 1.605/sqrt(epsilon);
elseif epsilon > 0.47 && epsilon <= 1
a_LH = 3.51 – 2.51*epsilon;
else
error(‘error epsilon’);
end
a_L = a_LH*a_H;
R_L = 1/(2*hm.ks*a_L);
Pmax = 2/pi*hm.E_prime*(hm.dv/hm.R)^(0.5);
Hc = hm.c1*(1.62*hm.dv)^(hm.c2);
a1 = erfcinv(2*Pmax/Hc);
a2 = erfcinv(0.03*Pmax/Hc) – a1;
coef_a = 2*hm.b/Dp;
coef_c = -(6*(hm.gamma-1)/(9*hm.gamma-5))* (hm.kg_ref*hm.MH2/(u(1)*u(2)*hm.R_gas))*(hm.MH2*u(1)/(2*hm.kb))^(0.5);
l_m = (-1 + sqrt(1 – 4*coef_a*coef_c))/(2*coef_a);
kg = hm.kg_ref/(1+2*hm.b*l_m/Dp);
M = (((2-hm.alpha_T1)/hm.alpha_T1)+((2-hm.alpha_T2)/hm.alpha_T2))*(2*hm.gamma/(1+hm.gamma))*(1/hm.Pr)*l_m;
R_g = sqrt(2)*hm.sigma*a2/(pi * kg * a_L^2 * log(1+ a2/(a1+M/(sqrt(2)*hm.sigma))));
L = (hm.gamma+1)*3*Dp/((9*hm.gamma-5)*4*l_m*sqrt(pi));
R_G = 1/(2*pi*kg*Dp*(0.5*log(1+L) + log(1+sqrt(L)) + 1/(1+sqrt(L)) – 1));
R_mic = Rs*R_g/(Rs+R_g);
R_c_inv = 1/(R_mic+R_L) + 1/R_G;
k_eff = N*(1-epsilon)*R_c_inv/(pi*Dp);
f = [k_eff*dudx(1); -u(2)*v; 0];
% compute vector s
m_dot_a = (1-epsilon)*(hm.rho_sat-u(3))*dfdt;
s = [u(2)*hm.Cpg*v*dudx(1) + m_dot_a*hm.delta_H ; -m_dot_a+hm.phi_abs; m_dot_a];
end
function u0 = icfun(x)
run(‘HM_data.m’);
u0 = hm.ic;
end
function [pl,ql,pr,qr] = bcfun(xl, ul, xr, ur, t)
run(‘HM_data.m’);
Nu_abs = 0.3+((0.62*(hm.Re_a^(0.5))*(hm.Pr_a^(1/3)))/(1+(0.4/hm.Pr_a)^(2/3))^(1/4)*((1+(hm.Re_a/282000)^(5/8))^(4/5)));
h_f = Nu_abs*hm.kf/hm.D_tank;
pl = [0 ; 0; 0];
ql = [1; 0; 0];
pr = [h_f*(ur(1)-hm.Tf_a); 0; 0];
qr = [-1; 0; 0];
end I get this error trying to solve a system of PDEs, and I do not know if such system is solvable with ‘pdepe’. The equations are:
energy balance equation, and:
mass balance equations. Initial conditions:
Boundary conditions:
The variables in which I am solving are however T,, knowing that:
, I can write initial condition for , and I have also a value for .
I tried writing the equations in the form required by ‘pdepe’. Also, note that many parameters depends on the vector , IN particular, the term ‘v’ includes a partial spatial derivative w.r.t. P, which i transformed in a spatial derivative w.r.t. u(1) and u(2) with the above formula. Note that many constants are imported with the file.m including the initial conditions that are: This is the code of the 3 functions used inside the pde call (sorry is a bit long and messy):
function [c,f,s] = pdefun(x,t,u,dudx)
% load data
run(‘HM_data.m’);
% compute epsilon , F and dfdt
F = (hm.rho_s_in-u(3))/(u(3)*hm.tau_p – hm.rho_s_in*hm.w_max);
epsilon = 1 – (1 – hm.epsilon_0)*((1 + hm.tau_p*F)/(1 + hm.tau_a*F));
P = u(2)*u(1)*hm.R_gas/hm.MH2;
P_eq_a = (hm.C0_a*hm.C1_a*(F)^(hm.C2_a)/(1+hm.C1_a*(F)^(hm.C2_a)) + hm.C3_a*F + exp(hm.C4_a*(F-hm.C5_a)))*exp(-hm.K_a*((1/u(1))-(1/303)));
k_a = (hm.kappa_a/(1 – epsilon)) * exp(-hm.E_a/(hm.R_gas*u(1))) * log(P/P_eq_a);
dfdt = k_a*(1-F);
% compute diagonal matrix c
Cps = 6000*(3.1*hm.R + 10.04*hm.x_max*F)/(hm.Ms + 6*hm.x_max*F);
rho_C_eff = epsilon*u(2)*hm.Cpg + (1- epsilon)*u(3)*Cps;
c = [rho_C_eff; epsilon; 1-epsilon];
% COMPUTE VECTOR f
% velocity
Dp = hm.D_in*(1+ F*hm.tau_p)^(1/3);
Kp = (Dp^2)*(epsilon^3)/(150*(1-epsilon)^2);
v_cost = -Kp*hm.R_gas/(hm.mu_g*hm.MH2);
v = v_cost*(dudx(1)*u(2) + dudx(2)*u(1));
% effective thermal conductivity
N = 3.08/epsilon – 1.13;
Fn = 4/3 * hm.E_prime * hm.R^(1/2) * hm.dv^(1.5);
Hv = hm.c1*hm.dv^(hm.c2);
Rs = 0.565*Hv*hm.dv/(hm.ks*Fn);
a_H = (0.75*Fn*hm.R/hm.E_prime)^(1/3);
a_LH = [];
if epsilon <= 0.47 && epsilon >= 0.01
a_LH = 1.605/sqrt(epsilon);
elseif epsilon > 0.47 && epsilon <= 1
a_LH = 3.51 – 2.51*epsilon;
else
error(‘error epsilon’);
end
a_L = a_LH*a_H;
R_L = 1/(2*hm.ks*a_L);
Pmax = 2/pi*hm.E_prime*(hm.dv/hm.R)^(0.5);
Hc = hm.c1*(1.62*hm.dv)^(hm.c2);
a1 = erfcinv(2*Pmax/Hc);
a2 = erfcinv(0.03*Pmax/Hc) – a1;
coef_a = 2*hm.b/Dp;
coef_c = -(6*(hm.gamma-1)/(9*hm.gamma-5))* (hm.kg_ref*hm.MH2/(u(1)*u(2)*hm.R_gas))*(hm.MH2*u(1)/(2*hm.kb))^(0.5);
l_m = (-1 + sqrt(1 – 4*coef_a*coef_c))/(2*coef_a);
kg = hm.kg_ref/(1+2*hm.b*l_m/Dp);
M = (((2-hm.alpha_T1)/hm.alpha_T1)+((2-hm.alpha_T2)/hm.alpha_T2))*(2*hm.gamma/(1+hm.gamma))*(1/hm.Pr)*l_m;
R_g = sqrt(2)*hm.sigma*a2/(pi * kg * a_L^2 * log(1+ a2/(a1+M/(sqrt(2)*hm.sigma))));
L = (hm.gamma+1)*3*Dp/((9*hm.gamma-5)*4*l_m*sqrt(pi));
R_G = 1/(2*pi*kg*Dp*(0.5*log(1+L) + log(1+sqrt(L)) + 1/(1+sqrt(L)) – 1));
R_mic = Rs*R_g/(Rs+R_g);
R_c_inv = 1/(R_mic+R_L) + 1/R_G;
k_eff = N*(1-epsilon)*R_c_inv/(pi*Dp);
f = [k_eff*dudx(1); -u(2)*v; 0];
% compute vector s
m_dot_a = (1-epsilon)*(hm.rho_sat-u(3))*dfdt;
s = [u(2)*hm.Cpg*v*dudx(1) + m_dot_a*hm.delta_H ; -m_dot_a+hm.phi_abs; m_dot_a];
end
function u0 = icfun(x)
run(‘HM_data.m’);
u0 = hm.ic;
end
function [pl,ql,pr,qr] = bcfun(xl, ul, xr, ur, t)
run(‘HM_data.m’);
Nu_abs = 0.3+((0.62*(hm.Re_a^(0.5))*(hm.Pr_a^(1/3)))/(1+(0.4/hm.Pr_a)^(2/3))^(1/4)*((1+(hm.Re_a/282000)^(5/8))^(4/5)));
h_f = Nu_abs*hm.kf/hm.D_tank;
pl = [0 ; 0; 0];
ql = [1; 0; 0];
pr = [h_f*(ur(1)-hm.Tf_a); 0; 0];
qr = [-1; 0; 0];
end pde, pdepe MATLAB Answers — New Questions
How to fastly calculate this matrix operation
A matrix is a dimensional matrix, is a dimensional vector, is a dimensional matrix, is a constant.
How to fastly calculate the following three dimensional () matrix , where the element in isA matrix is a dimensional matrix, is a dimensional vector, is a dimensional matrix, is a constant.
How to fastly calculate the following three dimensional () matrix , where the element in is A matrix is a dimensional matrix, is a dimensional vector, is a dimensional matrix, is a constant.
How to fastly calculate the following three dimensional () matrix , where the element in is matrix manipulation MATLAB Answers — New Questions
Hi. Manual variant sink.
Hi. I am trying to use manual variant sink programatically using a m-script and there is an error for the parameter. Can anyone suggest me what parameter is to be used for manual variant sink as in case of manual switch it is ‘sw’?
Thanks in advance.Hi. I am trying to use manual variant sink programatically using a m-script and there is an error for the parameter. Can anyone suggest me what parameter is to be used for manual variant sink as in case of manual switch it is ‘sw’?
Thanks in advance. Hi. I am trying to use manual variant sink programatically using a m-script and there is an error for the parameter. Can anyone suggest me what parameter is to be used for manual variant sink as in case of manual switch it is ‘sw’?
Thanks in advance. manual variant sink MATLAB Answers — New Questions
matlab code to find mean, median and standard deviation of a series of data in discrete time wavelet
what is the matlab code to find mean, median and standard deviation of a series of data in discrete time wavelet platform. This data is phase currents in a machine.This is either in time series formate or in stuctured with time .what is the matlab code to find mean, median and standard deviation of a series of data in discrete time wavelet platform. This data is phase currents in a machine.This is either in time series formate or in stuctured with time . what is the matlab code to find mean, median and standard deviation of a series of data in discrete time wavelet platform. This data is phase currents in a machine.This is either in time series formate or in stuctured with time . discrete wavelet transform, mean, median, standard deviation, wavelets MATLAB Answers — New Questions
How could i import google map into matlab using mapping toolbox,with dynamic view?
I would like to import google maps into matlab by using mapping toolbox in order to edit a specific city region of the map with dynamic view.Then everytime i click on a building, matlab should be able to display some informations, which i would have provided.I would like to import google maps into matlab by using mapping toolbox in order to edit a specific city region of the map with dynamic view.Then everytime i click on a building, matlab should be able to display some informations, which i would have provided. I would like to import google maps into matlab by using mapping toolbox in order to edit a specific city region of the map with dynamic view.Then everytime i click on a building, matlab should be able to display some informations, which i would have provided. google map, mapping toolbox MATLAB Answers — New Questions
I have this problem unrecognized method property or field ‘ArduinoPrefDirFolderName’ for class ‘arduino.setup.internal.TestConnectionScreen’.
when I install the matlab support package for arduino hardware i got this error when I press test connection. Please help me fix thiswhen I install the matlab support package for arduino hardware i got this error when I press test connection. Please help me fix this when I install the matlab support package for arduino hardware i got this error when I press test connection. Please help me fix this arduino MATLAB Answers — New Questions
Test Procedure for ON/OFF Oven to Determine PID Constants
Hi.
I need some help in predefining a test procedure for a remote Oven with ON/OFF Control. A step response is unsuitable because the oven is overpowered. Will a simple ON till the temperature reaches a typical working temperature followed by on OFF be sufficient? Can the collected data then be used for analysis to determine controller constants?
If that ON/OFF test is inadequate, will multiple ON/OFF’s be better as this would fall into the category of variable input?
Thanks.Hi.
I need some help in predefining a test procedure for a remote Oven with ON/OFF Control. A step response is unsuitable because the oven is overpowered. Will a simple ON till the temperature reaches a typical working temperature followed by on OFF be sufficient? Can the collected data then be used for analysis to determine controller constants?
If that ON/OFF test is inadequate, will multiple ON/OFF’s be better as this would fall into the category of variable input?
Thanks. Hi.
I need some help in predefining a test procedure for a remote Oven with ON/OFF Control. A step response is unsuitable because the oven is overpowered. Will a simple ON till the temperature reaches a typical working temperature followed by on OFF be sufficient? Can the collected data then be used for analysis to determine controller constants?
If that ON/OFF test is inadequate, will multiple ON/OFF’s be better as this would fall into the category of variable input?
Thanks. pid, pid constants, on/off control MATLAB Answers — New Questions
how to use Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices in MATLAB ONLINE
i AM DOING RESEARCH IN DEEP NEURAL NETWORKS.SINCE OUR INSTITUTION "PSG COLLEGE OF TECHNOLOGY,COIMBATORE"I HAS LICENCE ,I HAVE STARTED TO EXPLORE DEEP LEARNING HDL TOOL BOX IN ONLINE MATLAB.BUT WHILE RUNNING THE CODE IT SHOWS THE ERROR"Attempt to create a Target for vendor ‘Xilinx’. The ‘Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices’ support package has not been installed.".since i am using ONLINe MATLAb,i could not find the Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices.i AM DOING RESEARCH IN DEEP NEURAL NETWORKS.SINCE OUR INSTITUTION "PSG COLLEGE OF TECHNOLOGY,COIMBATORE"I HAS LICENCE ,I HAVE STARTED TO EXPLORE DEEP LEARNING HDL TOOL BOX IN ONLINE MATLAB.BUT WHILE RUNNING THE CODE IT SHOWS THE ERROR"Attempt to create a Target for vendor ‘Xilinx’. The ‘Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices’ support package has not been installed.".since i am using ONLINe MATLAb,i could not find the Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices. i AM DOING RESEARCH IN DEEP NEURAL NETWORKS.SINCE OUR INSTITUTION "PSG COLLEGE OF TECHNOLOGY,COIMBATORE"I HAS LICENCE ,I HAVE STARTED TO EXPLORE DEEP LEARNING HDL TOOL BOX IN ONLINE MATLAB.BUT WHILE RUNNING THE CODE IT SHOWS THE ERROR"Attempt to create a Target for vendor ‘Xilinx’. The ‘Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices’ support package has not been installed.".since i am using ONLINe MATLAb,i could not find the Deep Learning HDL Toolbox Support Package for Xilinx FPGA and SoC Devices. deep learning hdl toolbox support package MATLAB Answers — New Questions
Using matlabFunction to run solve() in a deployed app
Hi. I’m trying to use matlabFunction to run solve() statements, so the app will be deployed fine. I have this example code:
if ~isdeployed()
syms x
eq = solve(x + 5 == 8, x);
fun = matlabFunction(eq, ‘File’, ‘SolveTest.m’);
clear x eq fun
else
fun = @SolveTest;
end
app.EditField.Value = SolveTest;
it works fine inside appdesigner, but when I try to deploy it by ‘deploytool’, I get this error:
Warning: In "test.mlapp", "syms" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
how can it be fixed?
I’m using R2022b.Hi. I’m trying to use matlabFunction to run solve() statements, so the app will be deployed fine. I have this example code:
if ~isdeployed()
syms x
eq = solve(x + 5 == 8, x);
fun = matlabFunction(eq, ‘File’, ‘SolveTest.m’);
clear x eq fun
else
fun = @SolveTest;
end
app.EditField.Value = SolveTest;
it works fine inside appdesigner, but when I try to deploy it by ‘deploytool’, I get this error:
Warning: In "test.mlapp", "syms" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
how can it be fixed?
I’m using R2022b. Hi. I’m trying to use matlabFunction to run solve() statements, so the app will be deployed fine. I have this example code:
if ~isdeployed()
syms x
eq = solve(x + 5 == 8, x);
fun = matlabFunction(eq, ‘File’, ‘SolveTest.m’);
clear x eq fun
else
fun = @SolveTest;
end
app.EditField.Value = SolveTest;
it works fine inside appdesigner, but when I try to deploy it by ‘deploytool’, I get this error:
Warning: In "test.mlapp", "syms" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
how can it be fixed?
I’m using R2022b. matlabfunction, appdesigner, solve MATLAB Answers — New Questions