Category: Matlab
Category Archives: Matlab
Bug in saving .fig (but not .png or .pdf) from when specifiying YAxis.Exponent as -6
In my livescript (MATLAB R2023b), I programatically save some of my plots via saveas(). I’m currently saving as a .pdf, a .png, and a .fig.
When I first specify that that the plot should have a YAxis exponent of -6 (it defaults to -5), my plots look as expected in the produced/displayed MATLAB .fig, and in the saved .pdf and .png. BUT…when I open the saved .fig, it shows an exponent of 10^2147483647. Not 10^-6 as everything else does.
I’ve been able to reproduce this in a .m file as well, so it doesn’t seem to be related to the .mlx.
This is how I’m saving the plots:
set(gcf, ‘visible’, ‘on’); % have to do this bc livescripts sets off, but then the figs open as invisible later
saveas(gcf,plotFullFilename,’fig’)
saveas(gcf,plotFullFilename,’png’)
exportgraphics(gcf,allPlotsFilename,’append’,true)
This is how I set the exponent:
axA.YAxis.Exponent = -6;
axB.YAxis.Exponent = -6;
If I comment out the exponent code and let it default to a yaxis exponent to -5, then the .fig saves with an exponent of -5.
But I don’t want a y-axis exponent of -5. I want it in engineering notation, e.g. an exponent of -6. This looks like a bug to me. Any ideas?In my livescript (MATLAB R2023b), I programatically save some of my plots via saveas(). I’m currently saving as a .pdf, a .png, and a .fig.
When I first specify that that the plot should have a YAxis exponent of -6 (it defaults to -5), my plots look as expected in the produced/displayed MATLAB .fig, and in the saved .pdf and .png. BUT…when I open the saved .fig, it shows an exponent of 10^2147483647. Not 10^-6 as everything else does.
I’ve been able to reproduce this in a .m file as well, so it doesn’t seem to be related to the .mlx.
This is how I’m saving the plots:
set(gcf, ‘visible’, ‘on’); % have to do this bc livescripts sets off, but then the figs open as invisible later
saveas(gcf,plotFullFilename,’fig’)
saveas(gcf,plotFullFilename,’png’)
exportgraphics(gcf,allPlotsFilename,’append’,true)
This is how I set the exponent:
axA.YAxis.Exponent = -6;
axB.YAxis.Exponent = -6;
If I comment out the exponent code and let it default to a yaxis exponent to -5, then the .fig saves with an exponent of -5.
But I don’t want a y-axis exponent of -5. I want it in engineering notation, e.g. an exponent of -6. This looks like a bug to me. Any ideas? In my livescript (MATLAB R2023b), I programatically save some of my plots via saveas(). I’m currently saving as a .pdf, a .png, and a .fig.
When I first specify that that the plot should have a YAxis exponent of -6 (it defaults to -5), my plots look as expected in the produced/displayed MATLAB .fig, and in the saved .pdf and .png. BUT…when I open the saved .fig, it shows an exponent of 10^2147483647. Not 10^-6 as everything else does.
I’ve been able to reproduce this in a .m file as well, so it doesn’t seem to be related to the .mlx.
This is how I’m saving the plots:
set(gcf, ‘visible’, ‘on’); % have to do this bc livescripts sets off, but then the figs open as invisible later
saveas(gcf,plotFullFilename,’fig’)
saveas(gcf,plotFullFilename,’png’)
exportgraphics(gcf,allPlotsFilename,’append’,true)
This is how I set the exponent:
axA.YAxis.Exponent = -6;
axB.YAxis.Exponent = -6;
If I comment out the exponent code and let it default to a yaxis exponent to -5, then the .fig saves with an exponent of -5.
But I don’t want a y-axis exponent of -5. I want it in engineering notation, e.g. an exponent of -6. This looks like a bug to me. Any ideas? saveas, save figure, livescript, bug, exponent MATLAB Answers — New Questions
Custom mask Simscape blocks
I created a custom simscape library with my own blocks using .ssc files. After compiling, Matlab generates a mask. However, I am only be able to add controls of type popup and edit (in the parameters section of the .ssc file). However, I would like to add different controls such as a link and table. As far as I know, this is not possible using the .ssc file, correct?
The idea is to create a custom mask on top of the "MATLAB" mask. I want to do this programmatically by "copying" the parameters of the MATLAB mask to the custom mask and add more controls. Is this possible?
If yes, should I do this with a sl_postprocess.m file for every block? I would appreciate an example.I created a custom simscape library with my own blocks using .ssc files. After compiling, Matlab generates a mask. However, I am only be able to add controls of type popup and edit (in the parameters section of the .ssc file). However, I would like to add different controls such as a link and table. As far as I know, this is not possible using the .ssc file, correct?
The idea is to create a custom mask on top of the "MATLAB" mask. I want to do this programmatically by "copying" the parameters of the MATLAB mask to the custom mask and add more controls. Is this possible?
If yes, should I do this with a sl_postprocess.m file for every block? I would appreciate an example. I created a custom simscape library with my own blocks using .ssc files. After compiling, Matlab generates a mask. However, I am only be able to add controls of type popup and edit (in the parameters section of the .ssc file). However, I would like to add different controls such as a link and table. As far as I know, this is not possible using the .ssc file, correct?
The idea is to create a custom mask on top of the "MATLAB" mask. I want to do this programmatically by "copying" the parameters of the MATLAB mask to the custom mask and add more controls. Is this possible?
If yes, should I do this with a sl_postprocess.m file for every block? I would appreciate an example. simscape MATLAB Answers — New Questions
conedisk problem using bvp4c
conedisk2()
function conedisk2
% Parameter values
A1 = 1.10629;
A2 = 1.15;
A3 = 1.2;
A4 = 1.1;
A5 = 1.1;
A6 = 1.1;
M = 0.2;
Grt = 5;
Pr = 0.71;
R = 0.2;
Ec = 0.1;
Q = 0.1;
Rew = 12;
Red = -12;
n = -1;
g1 = 0;
g2 = 0;
g3 = 0;
g4 = 0;
inf = 1;
% Set solver options to increase the maximum number of mesh points
options = bvpset(‘RelTol’, 1e-5, ‘AbsTol’, 1e-7, ‘NMax’, 5000);
% Defining parameters
solinit = bvpinit(linspace(0, 1, 200), [0 g1 g2 0 Rew g3 1 g4]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y;
% Plotting of the velocity
figure(1)
plot(x, y(1,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘F(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of G
figure(2)
plot(x, y(5,:), ‘linewidth’, 1)
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘G(eta) ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(7,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1);yinf(1); y0(4); yinf(4);y0(5)-Rew; yinf(5)-Red;y0(7)-1; yinf(7)];
end
% System of First Order ODEs
function dydx = bvp2D(eta, y)
yy1 = (-(1+eta^2)*((10*A1*eta+A2*eta*y(1)-A2*y(4))*y(3))-3*(2*A1+7*A1*(eta^2)+A2*(2*eta^2+1)*y(1)-A2*eta*y(4))*y(2)-2*A2*y(5)*y(6)-3*(A1+A2*y(1))*y(4)+A3*M*y(2)-A4*Grt*y(8))/(A1*(1+eta^2)^2);
yy2 = eta*y(2);
yy3 = (-3*A1*eta*y(6)-A2*(eta*y(1)-y(4))*y(6)+A3*M*y(5))/(A1*(eta^2+1));
yy4 = ((A5+4/3*R)*((eta*((2*n)-1))*y(8)+n^2*y(7))-A3*Pr*M*Ec*(y(1)^2+y(5)^2)-Pr*Q*y(7)+A6*Pr*(y(4)*y(8)+n*y(1)*y(7)-eta*y(1)*y(8)))/(A5+4/3*R)*(1+eta^2);
dydx = [y(2); y(3); yy1; yy2; y(6); yy3; y(8); yy4];
end
end
, for the above code i want the graph for F,G as what i have attached in jpg…but I am unable to get the graph.Please help me where do I have to make the changes. Thanks in advance.conedisk2()
function conedisk2
% Parameter values
A1 = 1.10629;
A2 = 1.15;
A3 = 1.2;
A4 = 1.1;
A5 = 1.1;
A6 = 1.1;
M = 0.2;
Grt = 5;
Pr = 0.71;
R = 0.2;
Ec = 0.1;
Q = 0.1;
Rew = 12;
Red = -12;
n = -1;
g1 = 0;
g2 = 0;
g3 = 0;
g4 = 0;
inf = 1;
% Set solver options to increase the maximum number of mesh points
options = bvpset(‘RelTol’, 1e-5, ‘AbsTol’, 1e-7, ‘NMax’, 5000);
% Defining parameters
solinit = bvpinit(linspace(0, 1, 200), [0 g1 g2 0 Rew g3 1 g4]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y;
% Plotting of the velocity
figure(1)
plot(x, y(1,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘F(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of G
figure(2)
plot(x, y(5,:), ‘linewidth’, 1)
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘G(eta) ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(7,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1);yinf(1); y0(4); yinf(4);y0(5)-Rew; yinf(5)-Red;y0(7)-1; yinf(7)];
end
% System of First Order ODEs
function dydx = bvp2D(eta, y)
yy1 = (-(1+eta^2)*((10*A1*eta+A2*eta*y(1)-A2*y(4))*y(3))-3*(2*A1+7*A1*(eta^2)+A2*(2*eta^2+1)*y(1)-A2*eta*y(4))*y(2)-2*A2*y(5)*y(6)-3*(A1+A2*y(1))*y(4)+A3*M*y(2)-A4*Grt*y(8))/(A1*(1+eta^2)^2);
yy2 = eta*y(2);
yy3 = (-3*A1*eta*y(6)-A2*(eta*y(1)-y(4))*y(6)+A3*M*y(5))/(A1*(eta^2+1));
yy4 = ((A5+4/3*R)*((eta*((2*n)-1))*y(8)+n^2*y(7))-A3*Pr*M*Ec*(y(1)^2+y(5)^2)-Pr*Q*y(7)+A6*Pr*(y(4)*y(8)+n*y(1)*y(7)-eta*y(1)*y(8)))/(A5+4/3*R)*(1+eta^2);
dydx = [y(2); y(3); yy1; yy2; y(6); yy3; y(8); yy4];
end
end
, for the above code i want the graph for F,G as what i have attached in jpg…but I am unable to get the graph.Please help me where do I have to make the changes. Thanks in advance. conedisk2()
function conedisk2
% Parameter values
A1 = 1.10629;
A2 = 1.15;
A3 = 1.2;
A4 = 1.1;
A5 = 1.1;
A6 = 1.1;
M = 0.2;
Grt = 5;
Pr = 0.71;
R = 0.2;
Ec = 0.1;
Q = 0.1;
Rew = 12;
Red = -12;
n = -1;
g1 = 0;
g2 = 0;
g3 = 0;
g4 = 0;
inf = 1;
% Set solver options to increase the maximum number of mesh points
options = bvpset(‘RelTol’, 1e-5, ‘AbsTol’, 1e-7, ‘NMax’, 5000);
% Defining parameters
solinit = bvpinit(linspace(0, 1, 200), [0 g1 g2 0 Rew g3 1 g4]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y;
% Plotting of the velocity
figure(1)
plot(x, y(1,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘F(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of G
figure(2)
plot(x, y(5,:), ‘linewidth’, 1)
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘G(eta) ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(7,:), ‘linewidth’, 1)
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1);yinf(1); y0(4); yinf(4);y0(5)-Rew; yinf(5)-Red;y0(7)-1; yinf(7)];
end
% System of First Order ODEs
function dydx = bvp2D(eta, y)
yy1 = (-(1+eta^2)*((10*A1*eta+A2*eta*y(1)-A2*y(4))*y(3))-3*(2*A1+7*A1*(eta^2)+A2*(2*eta^2+1)*y(1)-A2*eta*y(4))*y(2)-2*A2*y(5)*y(6)-3*(A1+A2*y(1))*y(4)+A3*M*y(2)-A4*Grt*y(8))/(A1*(1+eta^2)^2);
yy2 = eta*y(2);
yy3 = (-3*A1*eta*y(6)-A2*(eta*y(1)-y(4))*y(6)+A3*M*y(5))/(A1*(eta^2+1));
yy4 = ((A5+4/3*R)*((eta*((2*n)-1))*y(8)+n^2*y(7))-A3*Pr*M*Ec*(y(1)^2+y(5)^2)-Pr*Q*y(7)+A6*Pr*(y(4)*y(8)+n*y(1)*y(7)-eta*y(1)*y(8)))/(A5+4/3*R)*(1+eta^2);
dydx = [y(2); y(3); yy1; yy2; y(6); yy3; y(8); yy4];
end
end
, for the above code i want the graph for F,G as what i have attached in jpg…but I am unable to get the graph.Please help me where do I have to make the changes. Thanks in advance. graph for f and g MATLAB Answers — New Questions
How to extract and open Json file in folder.
Dear All,
I have Json file in folder as attached. But, I tried to extract and open, it failed.
Some can help me?Dear All,
I have Json file in folder as attached. But, I tried to extract and open, it failed.
Some can help me? Dear All,
I have Json file in folder as attached. But, I tried to extract and open, it failed.
Some can help me? image analysis, image processing, digital image processing, image segmentation, image acquisition, image, data, database, data import MATLAB Answers — New Questions
Unable to start simulation at condition specified using IC block.
I have built a model to simulate acceleration and top speed of a vehicle. I want to specify the initial engine RPM as 3500 for which I have added IC Block specifying the same. But even then Engine RPM is 0 at the start. How can I start my simulation when the engine speed is 3500 RPM?I have built a model to simulate acceleration and top speed of a vehicle. I want to specify the initial engine RPM as 3500 for which I have added IC Block specifying the same. But even then Engine RPM is 0 at the start. How can I start my simulation when the engine speed is 3500 RPM? I have built a model to simulate acceleration and top speed of a vehicle. I want to specify the initial engine RPM as 3500 for which I have added IC Block specifying the same. But even then Engine RPM is 0 at the start. How can I start my simulation when the engine speed is 3500 RPM? vehicle, vehicle performance, initial condition, ic block MATLAB Answers — New Questions
In ecap module how does capture event selection works?
I want to mesure position of Bldc motor using hall sensor for FOC.As a refrence model I am using mcb_pmsm_foc_hall_f280049c.slx.How does capture event selection works? Below are the image of event slection block of 3 hall sensor.I want to mesure position of Bldc motor using hall sensor for FOC.As a refrence model I am using mcb_pmsm_foc_hall_f280049c.slx.How does capture event selection works? Below are the image of event slection block of 3 hall sensor. I want to mesure position of Bldc motor using hall sensor for FOC.As a refrence model I am using mcb_pmsm_foc_hall_f280049c.slx.How does capture event selection works? Below are the image of event slection block of 3 hall sensor. hall sensor, field oriented control, ecap, f280049c MATLAB Answers — New Questions
How to change baud rate for STM32 F769I-Discovery in Simulink for PiL-Simulation?
Hi guys,
for a PIL-Simulation with serial connection (USB), I want to change the PIL baud rate for an STM32 F769I-Discovery:
I tried to change the PIL baud rate to e.g. 1000000 Bd. After I compiled my model, it doesn’t run with my desired baud rate and it returned an error. When I left the baud rate to 115200 Bd (default), Simulink compiled my model and ran it with 115200Bd.
Is there an error or why can’t I change the baud rate for a STM32-F769I Discovery although there is an option to change the baud rate (see picture above)?
Greetings
RLHi guys,
for a PIL-Simulation with serial connection (USB), I want to change the PIL baud rate for an STM32 F769I-Discovery:
I tried to change the PIL baud rate to e.g. 1000000 Bd. After I compiled my model, it doesn’t run with my desired baud rate and it returned an error. When I left the baud rate to 115200 Bd (default), Simulink compiled my model and ran it with 115200Bd.
Is there an error or why can’t I change the baud rate for a STM32-F769I Discovery although there is an option to change the baud rate (see picture above)?
Greetings
RL Hi guys,
for a PIL-Simulation with serial connection (USB), I want to change the PIL baud rate for an STM32 F769I-Discovery:
I tried to change the PIL baud rate to e.g. 1000000 Bd. After I compiled my model, it doesn’t run with my desired baud rate and it returned an error. When I left the baud rate to 115200 Bd (default), Simulink compiled my model and ran it with 115200Bd.
Is there an error or why can’t I change the baud rate for a STM32-F769I Discovery although there is an option to change the baud rate (see picture above)?
Greetings
RL stm32microcontroller, baud rate, processor-in-the-loop simulation, pil, simulink, stm32-f769i discovery MATLAB Answers — New Questions
How to change the x-axis step size?
I have this code, everything is fine but I tried to change x-axis step size in order to be 1 instead of 0.5, but it didn’t work!
clear;
SF=[12 11 10 9 8 7];
TOA=[1318.91 741.38 370.69 185.34 102.91 56.58];
R_b=[0.29 0.54 0.98 1.76 3.12 5.47];
%Plotting
set ( gca, ‘xdir’, ‘reverse’ )
yyaxis left
stairs(SF,TOA,’-.’)
title(‘Distance <—-‘)
xlabel(‘SF’)
ylabel(‘TOA (msec)’)
yyaxis right
stairs(SF,R_b,’r’)
ylabel(‘Data Rate (kbps)’)
legend(‘TOA’,’Data Rate’)
gridI have this code, everything is fine but I tried to change x-axis step size in order to be 1 instead of 0.5, but it didn’t work!
clear;
SF=[12 11 10 9 8 7];
TOA=[1318.91 741.38 370.69 185.34 102.91 56.58];
R_b=[0.29 0.54 0.98 1.76 3.12 5.47];
%Plotting
set ( gca, ‘xdir’, ‘reverse’ )
yyaxis left
stairs(SF,TOA,’-.’)
title(‘Distance <—-‘)
xlabel(‘SF’)
ylabel(‘TOA (msec)’)
yyaxis right
stairs(SF,R_b,’r’)
ylabel(‘Data Rate (kbps)’)
legend(‘TOA’,’Data Rate’)
grid I have this code, everything is fine but I tried to change x-axis step size in order to be 1 instead of 0.5, but it didn’t work!
clear;
SF=[12 11 10 9 8 7];
TOA=[1318.91 741.38 370.69 185.34 102.91 56.58];
R_b=[0.29 0.54 0.98 1.76 3.12 5.47];
%Plotting
set ( gca, ‘xdir’, ‘reverse’ )
yyaxis left
stairs(SF,TOA,’-.’)
title(‘Distance <—-‘)
xlabel(‘SF’)
ylabel(‘TOA (msec)’)
yyaxis right
stairs(SF,R_b,’r’)
ylabel(‘Data Rate (kbps)’)
legend(‘TOA’,’Data Rate’)
grid x-axis, step-size MATLAB Answers — New Questions
Permission denied error when trying to remove Matlab on Ubuntu computer
Hi, I tried to remove Matlab on Ubuntu 18.04 computer using [root@localhost ~] rm -rf /usr/local/MATLAB/R2021b command but all I get is an error saying permission denied. What is the way around this?Hi, I tried to remove Matlab on Ubuntu 18.04 computer using [root@localhost ~] rm -rf /usr/local/MATLAB/R2021b command but all I get is an error saying permission denied. What is the way around this? Hi, I tried to remove Matlab on Ubuntu 18.04 computer using [root@localhost ~] rm -rf /usr/local/MATLAB/R2021b command but all I get is an error saying permission denied. What is the way around this? permission, uninstall MATLAB Answers — New Questions
IN matlab 2017b version i have a error in canny edge detection like this.
Segmentedimg = edge(Enhanceimg,’canny’); figure(‘Name’,’Segmented image’,’NumberTitle’,’off’); imshow(Segmentedimg);
title(‘Segmented Image’,’fontsize’,10,’fontname’,’Times New Roman’,’color’,’Black’);Segmentedimg = edge(Enhanceimg,’canny’); figure(‘Name’,’Segmented image’,’NumberTitle’,’off’); imshow(Segmentedimg);
title(‘Segmented Image’,’fontsize’,10,’fontname’,’Times New Roman’,’color’,’Black’); Segmentedimg = edge(Enhanceimg,’canny’); figure(‘Name’,’Segmented image’,’NumberTitle’,’off’); imshow(Segmentedimg);
title(‘Segmented Image’,’fontsize’,10,’fontname’,’Times New Roman’,’color’,’Black’); canny, sobel MATLAB Answers — New Questions
Auto complete inputs of method using object property
Hey,
I have a class with a property that I would like to use for auto completion:
classdef TestClass
properties
Names
end
methods
function self = TestClass(names)
arguments
names (1,:) string
end
self.Names = names;
end
function printName(self, name)
mustBeMember(name, self.Names)
disp(name)
end
end
end
So when I call the method ‘printName’, I would like matlab so suggest the possible options, i.e. the elements of the property ‘Names’.
How can I do that?Hey,
I have a class with a property that I would like to use for auto completion:
classdef TestClass
properties
Names
end
methods
function self = TestClass(names)
arguments
names (1,:) string
end
self.Names = names;
end
function printName(self, name)
mustBeMember(name, self.Names)
disp(name)
end
end
end
So when I call the method ‘printName’, I would like matlab so suggest the possible options, i.e. the elements of the property ‘Names’.
How can I do that? Hey,
I have a class with a property that I would like to use for auto completion:
classdef TestClass
properties
Names
end
methods
function self = TestClass(names)
arguments
names (1,:) string
end
self.Names = names;
end
function printName(self, name)
mustBeMember(name, self.Names)
disp(name)
end
end
end
So when I call the method ‘printName’, I would like matlab so suggest the possible options, i.e. the elements of the property ‘Names’.
How can I do that? oop, class MATLAB Answers — New Questions
TI OMAP-L138. Acquiring data into MATLAB
Good night
I am a student, working on a DSP project. I need to acquire data from a TI OMAP-L138 LCDK output into matlab workspace for further processing. I was able to do that by connecting the OMAP output to the PC mic analog input and use the sound card. However, it only worked for higher frequency ranges. My project involves work with low frequencies and the microphone cannon pick such signals up.
I have watched several tutorials and found that it is possible to acquire signals into matlab from tecktronic function generators, connected through USB or RS232. However, an instrument driver for this generator already exists in Matlab. Any chance someone can help me to find a driver that would work for OMAP-L138?
Thank youGood night
I am a student, working on a DSP project. I need to acquire data from a TI OMAP-L138 LCDK output into matlab workspace for further processing. I was able to do that by connecting the OMAP output to the PC mic analog input and use the sound card. However, it only worked for higher frequency ranges. My project involves work with low frequencies and the microphone cannon pick such signals up.
I have watched several tutorials and found that it is possible to acquire signals into matlab from tecktronic function generators, connected through USB or RS232. However, an instrument driver for this generator already exists in Matlab. Any chance someone can help me to find a driver that would work for OMAP-L138?
Thank you Good night
I am a student, working on a DSP project. I need to acquire data from a TI OMAP-L138 LCDK output into matlab workspace for further processing. I was able to do that by connecting the OMAP output to the PC mic analog input and use the sound card. However, it only worked for higher frequency ranges. My project involves work with low frequencies and the microphone cannon pick such signals up.
I have watched several tutorials and found that it is possible to acquire signals into matlab from tecktronic function generators, connected through USB or RS232. However, an instrument driver for this generator already exists in Matlab. Any chance someone can help me to find a driver that would work for OMAP-L138?
Thank you omap-l138 lcdk, dsp, microphone MATLAB Answers — New Questions
Real time module TCP communication cannot receive the correct signal through the command line
I use the TCP communication module in Real Time, but before sending signals, I must package them into uint8 type signals. "I want to receive these signals in the form of a command line and convert them to the original double type. I have tried using double () to coerce the type conversion, but the im2double () function has failed to obtain the original signal correctly.". Is there any way to obtain it?
t=tcpclient(‘192.168.7.1’,8001);
while(1)
data=read(t,8);
write(t,data);
u=double(data);
endI use the TCP communication module in Real Time, but before sending signals, I must package them into uint8 type signals. "I want to receive these signals in the form of a command line and convert them to the original double type. I have tried using double () to coerce the type conversion, but the im2double () function has failed to obtain the original signal correctly.". Is there any way to obtain it?
t=tcpclient(‘192.168.7.1’,8001);
while(1)
data=read(t,8);
write(t,data);
u=double(data);
end I use the TCP communication module in Real Time, but before sending signals, I must package them into uint8 type signals. "I want to receive these signals in the form of a command line and convert them to the original double type. I have tried using double () to coerce the type conversion, but the im2double () function has failed to obtain the original signal correctly.". Is there any way to obtain it?
t=tcpclient(‘192.168.7.1’,8001);
while(1)
data=read(t,8);
write(t,data);
u=double(data);
end real time, tcp, pack MATLAB Answers — New Questions
Can I use webwrite to make a PUT request?
I’ve been able to successfully use the ‘webwrite’ and ‘webread’ functions for POST and GET requests for REST API calls in Matlab. Now, I need to make a small PUT request without any body/data.
Is there a way to use webwrite for this purpose? I’ve read about the matlab.net.HTTP.Request Class in THIS page, but it seems complicated – how do I send a BEARER authorization token and the PUT request without any body/data? It would be nice if webwrite could handle PUT requests as well.
Thanks,
PVI’ve been able to successfully use the ‘webwrite’ and ‘webread’ functions for POST and GET requests for REST API calls in Matlab. Now, I need to make a small PUT request without any body/data.
Is there a way to use webwrite for this purpose? I’ve read about the matlab.net.HTTP.Request Class in THIS page, but it seems complicated – how do I send a BEARER authorization token and the PUT request without any body/data? It would be nice if webwrite could handle PUT requests as well.
Thanks,
PV I’ve been able to successfully use the ‘webwrite’ and ‘webread’ functions for POST and GET requests for REST API calls in Matlab. Now, I need to make a small PUT request without any body/data.
Is there a way to use webwrite for this purpose? I’ve read about the matlab.net.HTTP.Request Class in THIS page, but it seems complicated – how do I send a BEARER authorization token and the PUT request without any body/data? It would be nice if webwrite could handle PUT requests as well.
Thanks,
PV rest, webwrite, webread, put request MATLAB Answers — New Questions
What does “Interrupt while evaluating Button PrivateButtonPushedFcn.” mean?
My program was working but now I’m getting this.
Interrupt while evaluating Button PrivateButtonPushedFcn.
If I knew more about the error maybe I coud fix it. There is no help looking up this error in MatLab help. Googled but got trivial problems others had had.My program was working but now I’m getting this.
Interrupt while evaluating Button PrivateButtonPushedFcn.
If I knew more about the error maybe I coud fix it. There is no help looking up this error in MatLab help. Googled but got trivial problems others had had. My program was working but now I’m getting this.
Interrupt while evaluating Button PrivateButtonPushedFcn.
If I knew more about the error maybe I coud fix it. There is no help looking up this error in MatLab help. Googled but got trivial problems others had had. error message unclear MATLAB Answers — New Questions
Is there a premade file regarding a verification test to see if there is any issues with the installation?
I am trying to find a standardized verification package that I can run on my end to detemrine if matlab operates properly and has the correct outcomes.I am trying to find a standardized verification package that I can run on my end to detemrine if matlab operates properly and has the correct outcomes. I am trying to find a standardized verification package that I can run on my end to detemrine if matlab operates properly and has the correct outcomes. verification, test, matlab MATLAB Answers — New Questions
Presumed meshing problems in heat transfer model of thin heater sandwiched between large slabs
I have a steady state heat transfer problem trying to model a thin film heater wedged between two significantly thicker slabs. The slab thicknesses may be as much as three orders of magnitude larger than the heater. I want temperature resolution within the slabs and a temperature of the heater but I don’t need temperature resolution within the film per se. I tried treating the entire thin film as dissipating energy using an internal heat source command of this form [internalHeatSource(thermalmodel,6000,"Face",2)]. My checks on model validity included looking for higher temperature within the heater compared to the two bounding slabs using a command of this form [pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), … "Contour","on",… "ColorMap","jet")]. I also checked energy conservation in the steady state by comparing the known amount of power dissipated within the heater to the energy rate leaving the boundaries of the system using commands of the form [Qn1= evaluateHeatRate(thermalresults, "Edge",1)] for each edge and summing up these energy rates..
This approach was not successful. I did not see significant temperature increases that I would expect for heater power levels that I used. Conservation of energy was not observed. I plotted the mesh results and in some or all cases would get strange looking results. In some or all cases Matlab returned the following feedback: “Warning: Found elements with poor shape quality.” I tried manipulating the mesh size to get finer resolution using commands of the form [mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7)]. I was not successful.
I feel like the problem is related to the mismatch in mesh resolution that may be required in the heater compared to the larger slabs, but I don’t know if that’s true and I don’t know how to handle it if that is true.
The code is included below.
Any help would be greatly appreciated.
john
%% Create a thermal model for transient analysis
thermalmodel = createpde("thermal","steadystate");
% Define the geometry components
Rfilmbottom = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.0, 0.0, 0.124375,0.124375]/1000]’;
Rfilmhtr = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.124375,0.124375,0.125625,0.125625]/1000]’;
Rfilmtop= [3,4,[-5.0, 5.0, 5.0, -5.0, 0.125625,0.125625, 0.25, 0.25]/1000]’;
% Combine the geometry data
gdm = [ Rfilmbottom Rfilmhtr Rfilmtop ];
ns = char(‘Rfilmbottom’, ‘Rfilmhtr’, ‘Rfilmtop’);
g = decsg(gdm, ‘Rfilmbottom + Rfilmhtr + Rfilmtop’, ns’);
% Create geometry from edges
geometryFromEdges(thermalmodel, g);
% Create a larger figure window
figure(‘Position’, [100, 100, 1200, 800]);
% Figure 1
% Plot with edge labels
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%Figure 2
figure
% Adjust limits and aspect ratio for better visibility
% Overall view
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
% Around heater
%pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%xlim([-5.0e-3 5.0e-3]);
%ylim([1.1e-4 1.4e-4])
%daspect([500 1 1]);
% Properties assigned assuming corresponding order as per above
% Substrate
%thermalProperties(thermalmodel,"ThermalConductivity",0.050);
%Film
thermalProperties(thermalmodel,"ThermalConductivity",0.025);
% Boundary conditions
% Edge 1 is bottom edge of film
thermalBC(thermalmodel,"Edge",1,"Temperature",30);
% Edge 2 is top edge of film
thermalBC(thermalmodel,"Edge",2,"Temperature",30);
% Edge 3 is bottom edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",3,"HeatFlux",0);
% Edge 4 is top edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",4,"HeatFlux",0);
% Edge 5 is right edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",5,"HeatFlux",0);
% Edge 6 is right edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",6,"HeatFlux",0);
% Edge 7 is right edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",7,"HeatFlux",0);
% Edge 8 is left edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",8,"HeatFlux",0);
% Edge 9 is left edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",9,"HeatFlux",0);
% Edge 10 is left edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",10,"HeatFlux",0);
internalHeatSource(thermalmodel,6000,"Face",2);
mesh= generateMesh(thermalmodel);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 5e-8, ‘Hmin’, 5e-9);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7);
% Figure 5
figure
pdemesh(thermalmodel)
pdeplot(mesh)
%xlim([-1.0e-3 1.0e-3]);
%ylim([-2.0e-3 1.0e-3])
%daspect([1 1 1]);
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
title("Mesh with Refined Elements");
%Warning: Found elements with poor shape quality.
thermalresults = solve(thermalmodel)
T= thermalresults.Temperature;
msh= thermalresults.Mesh;
[qx,qy] = evaluateHeatFlux(thermalresults);
%figure
%pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
% "Contour","on",…
% "FlowData",[qx(:,end),qy(:,end)], …
%"ColorMap","jet")
%title("Temperature (C) & Heat flux fields (W/m2)")
%xlabel("Width (m)")
%ylabel("Height (m)")
% Figure 6
figure
pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
"Contour","on",…
"ColorMap","jet")
title("Temperature field (C)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
% Figure 7
figure
pdeplot(thermalmodel,"FlowData",[qx(:,end), qy(:,end)])
title("Heat flux field (W/m2)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
%isp(qx(:,end))
%disp(qy(:,end))
Qn1= evaluateHeatRate(thermalresults, "Edge",1)
Qn2= evaluateHeatRate(thermalresults, "Edge",2)
Qn3= evaluateHeatRate(thermalresults, "Edge",3)
Qn4= evaluateHeatRate(thermalresults, "Edge",4)
Qn5= evaluateHeatRate(thermalresults, "Edge",5)
Qn6= evaluateHeatRate(thermalresults, "Edge",6)
Qn7= evaluateHeatRate(thermalresults, "Edge",7)
Qn8= evaluateHeatRate(thermalresults, "Edge",8)
Qn9= evaluateHeatRate(thermalresults, "Edge",9)
Qn10= evaluateHeatRate(thermalresults, "Edge",10)
Edgetotalwatts= Qn1+Qn2+Qn4+Qn5+Qn6+Qn7+Qn8+Qn9+Qn10I have a steady state heat transfer problem trying to model a thin film heater wedged between two significantly thicker slabs. The slab thicknesses may be as much as three orders of magnitude larger than the heater. I want temperature resolution within the slabs and a temperature of the heater but I don’t need temperature resolution within the film per se. I tried treating the entire thin film as dissipating energy using an internal heat source command of this form [internalHeatSource(thermalmodel,6000,"Face",2)]. My checks on model validity included looking for higher temperature within the heater compared to the two bounding slabs using a command of this form [pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), … "Contour","on",… "ColorMap","jet")]. I also checked energy conservation in the steady state by comparing the known amount of power dissipated within the heater to the energy rate leaving the boundaries of the system using commands of the form [Qn1= evaluateHeatRate(thermalresults, "Edge",1)] for each edge and summing up these energy rates..
This approach was not successful. I did not see significant temperature increases that I would expect for heater power levels that I used. Conservation of energy was not observed. I plotted the mesh results and in some or all cases would get strange looking results. In some or all cases Matlab returned the following feedback: “Warning: Found elements with poor shape quality.” I tried manipulating the mesh size to get finer resolution using commands of the form [mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7)]. I was not successful.
I feel like the problem is related to the mismatch in mesh resolution that may be required in the heater compared to the larger slabs, but I don’t know if that’s true and I don’t know how to handle it if that is true.
The code is included below.
Any help would be greatly appreciated.
john
%% Create a thermal model for transient analysis
thermalmodel = createpde("thermal","steadystate");
% Define the geometry components
Rfilmbottom = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.0, 0.0, 0.124375,0.124375]/1000]’;
Rfilmhtr = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.124375,0.124375,0.125625,0.125625]/1000]’;
Rfilmtop= [3,4,[-5.0, 5.0, 5.0, -5.0, 0.125625,0.125625, 0.25, 0.25]/1000]’;
% Combine the geometry data
gdm = [ Rfilmbottom Rfilmhtr Rfilmtop ];
ns = char(‘Rfilmbottom’, ‘Rfilmhtr’, ‘Rfilmtop’);
g = decsg(gdm, ‘Rfilmbottom + Rfilmhtr + Rfilmtop’, ns’);
% Create geometry from edges
geometryFromEdges(thermalmodel, g);
% Create a larger figure window
figure(‘Position’, [100, 100, 1200, 800]);
% Figure 1
% Plot with edge labels
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%Figure 2
figure
% Adjust limits and aspect ratio for better visibility
% Overall view
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
% Around heater
%pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%xlim([-5.0e-3 5.0e-3]);
%ylim([1.1e-4 1.4e-4])
%daspect([500 1 1]);
% Properties assigned assuming corresponding order as per above
% Substrate
%thermalProperties(thermalmodel,"ThermalConductivity",0.050);
%Film
thermalProperties(thermalmodel,"ThermalConductivity",0.025);
% Boundary conditions
% Edge 1 is bottom edge of film
thermalBC(thermalmodel,"Edge",1,"Temperature",30);
% Edge 2 is top edge of film
thermalBC(thermalmodel,"Edge",2,"Temperature",30);
% Edge 3 is bottom edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",3,"HeatFlux",0);
% Edge 4 is top edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",4,"HeatFlux",0);
% Edge 5 is right edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",5,"HeatFlux",0);
% Edge 6 is right edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",6,"HeatFlux",0);
% Edge 7 is right edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",7,"HeatFlux",0);
% Edge 8 is left edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",8,"HeatFlux",0);
% Edge 9 is left edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",9,"HeatFlux",0);
% Edge 10 is left edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",10,"HeatFlux",0);
internalHeatSource(thermalmodel,6000,"Face",2);
mesh= generateMesh(thermalmodel);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 5e-8, ‘Hmin’, 5e-9);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7);
% Figure 5
figure
pdemesh(thermalmodel)
pdeplot(mesh)
%xlim([-1.0e-3 1.0e-3]);
%ylim([-2.0e-3 1.0e-3])
%daspect([1 1 1]);
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
title("Mesh with Refined Elements");
%Warning: Found elements with poor shape quality.
thermalresults = solve(thermalmodel)
T= thermalresults.Temperature;
msh= thermalresults.Mesh;
[qx,qy] = evaluateHeatFlux(thermalresults);
%figure
%pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
% "Contour","on",…
% "FlowData",[qx(:,end),qy(:,end)], …
%"ColorMap","jet")
%title("Temperature (C) & Heat flux fields (W/m2)")
%xlabel("Width (m)")
%ylabel("Height (m)")
% Figure 6
figure
pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
"Contour","on",…
"ColorMap","jet")
title("Temperature field (C)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
% Figure 7
figure
pdeplot(thermalmodel,"FlowData",[qx(:,end), qy(:,end)])
title("Heat flux field (W/m2)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
%isp(qx(:,end))
%disp(qy(:,end))
Qn1= evaluateHeatRate(thermalresults, "Edge",1)
Qn2= evaluateHeatRate(thermalresults, "Edge",2)
Qn3= evaluateHeatRate(thermalresults, "Edge",3)
Qn4= evaluateHeatRate(thermalresults, "Edge",4)
Qn5= evaluateHeatRate(thermalresults, "Edge",5)
Qn6= evaluateHeatRate(thermalresults, "Edge",6)
Qn7= evaluateHeatRate(thermalresults, "Edge",7)
Qn8= evaluateHeatRate(thermalresults, "Edge",8)
Qn9= evaluateHeatRate(thermalresults, "Edge",9)
Qn10= evaluateHeatRate(thermalresults, "Edge",10)
Edgetotalwatts= Qn1+Qn2+Qn4+Qn5+Qn6+Qn7+Qn8+Qn9+Qn10 I have a steady state heat transfer problem trying to model a thin film heater wedged between two significantly thicker slabs. The slab thicknesses may be as much as three orders of magnitude larger than the heater. I want temperature resolution within the slabs and a temperature of the heater but I don’t need temperature resolution within the film per se. I tried treating the entire thin film as dissipating energy using an internal heat source command of this form [internalHeatSource(thermalmodel,6000,"Face",2)]. My checks on model validity included looking for higher temperature within the heater compared to the two bounding slabs using a command of this form [pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), … "Contour","on",… "ColorMap","jet")]. I also checked energy conservation in the steady state by comparing the known amount of power dissipated within the heater to the energy rate leaving the boundaries of the system using commands of the form [Qn1= evaluateHeatRate(thermalresults, "Edge",1)] for each edge and summing up these energy rates..
This approach was not successful. I did not see significant temperature increases that I would expect for heater power levels that I used. Conservation of energy was not observed. I plotted the mesh results and in some or all cases would get strange looking results. In some or all cases Matlab returned the following feedback: “Warning: Found elements with poor shape quality.” I tried manipulating the mesh size to get finer resolution using commands of the form [mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7)]. I was not successful.
I feel like the problem is related to the mismatch in mesh resolution that may be required in the heater compared to the larger slabs, but I don’t know if that’s true and I don’t know how to handle it if that is true.
The code is included below.
Any help would be greatly appreciated.
john
%% Create a thermal model for transient analysis
thermalmodel = createpde("thermal","steadystate");
% Define the geometry components
Rfilmbottom = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.0, 0.0, 0.124375,0.124375]/1000]’;
Rfilmhtr = [3,4,[-5.0, 5.0, 5.0, -5.0, 0.124375,0.124375,0.125625,0.125625]/1000]’;
Rfilmtop= [3,4,[-5.0, 5.0, 5.0, -5.0, 0.125625,0.125625, 0.25, 0.25]/1000]’;
% Combine the geometry data
gdm = [ Rfilmbottom Rfilmhtr Rfilmtop ];
ns = char(‘Rfilmbottom’, ‘Rfilmhtr’, ‘Rfilmtop’);
g = decsg(gdm, ‘Rfilmbottom + Rfilmhtr + Rfilmtop’, ns’);
% Create geometry from edges
geometryFromEdges(thermalmodel, g);
% Create a larger figure window
figure(‘Position’, [100, 100, 1200, 800]);
% Figure 1
% Plot with edge labels
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%Figure 2
figure
% Adjust limits and aspect ratio for better visibility
% Overall view
pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
% Around heater
%pdegplot(thermalmodel, "EdgeLabels", "on", "FaceLabels", "on");
%xlim([-5.0e-3 5.0e-3]);
%ylim([1.1e-4 1.4e-4])
%daspect([500 1 1]);
% Properties assigned assuming corresponding order as per above
% Substrate
%thermalProperties(thermalmodel,"ThermalConductivity",0.050);
%Film
thermalProperties(thermalmodel,"ThermalConductivity",0.025);
% Boundary conditions
% Edge 1 is bottom edge of film
thermalBC(thermalmodel,"Edge",1,"Temperature",30);
% Edge 2 is top edge of film
thermalBC(thermalmodel,"Edge",2,"Temperature",30);
% Edge 3 is bottom edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",3,"HeatFlux",0);
% Edge 4 is top edge of heater film- no BC for continuity
%thermalBC(thermalmodel,"Edge",4,"HeatFlux",0);
% Edge 5 is right edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",5,"HeatFlux",0);
% Edge 6 is right edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",6,"HeatFlux",0);
% Edge 7 is right edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",7,"HeatFlux",0);
% Edge 8 is left edge of bottom film- adiabatic
thermalBC(thermalmodel,"Edge",8,"HeatFlux",0);
% Edge 9 is left edge of heater film- adiabatic
thermalBC(thermalmodel,"Edge",9,"HeatFlux",0);
% Edge 10 is left edge of top film- adiabatic
thermalBC(thermalmodel,"Edge",10,"HeatFlux",0);
internalHeatSource(thermalmodel,6000,"Face",2);
mesh= generateMesh(thermalmodel);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 5e-8, ‘Hmin’, 5e-9);
%mesh= generateMesh(thermalmodel, ‘Hmax’, 1e-6, ‘Hmin’, 1e-7);
% Figure 5
figure
pdemesh(thermalmodel)
pdeplot(mesh)
%xlim([-1.0e-3 1.0e-3]);
%ylim([-2.0e-3 1.0e-3])
%daspect([1 1 1]);
xlim([-5.0e-3 5.0e-3]);
ylim([0.0e-3 0.5e-3])
daspect([50 1 1]);
title("Mesh with Refined Elements");
%Warning: Found elements with poor shape quality.
thermalresults = solve(thermalmodel)
T= thermalresults.Temperature;
msh= thermalresults.Mesh;
[qx,qy] = evaluateHeatFlux(thermalresults);
%figure
%pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
% "Contour","on",…
% "FlowData",[qx(:,end),qy(:,end)], …
%"ColorMap","jet")
%title("Temperature (C) & Heat flux fields (W/m2)")
%xlabel("Width (m)")
%ylabel("Height (m)")
% Figure 6
figure
pdeplot(thermalmodel,"XYData",thermalresults.Temperature(:,end), …
"Contour","on",…
"ColorMap","jet")
title("Temperature field (C)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
% Figure 7
figure
pdeplot(thermalmodel,"FlowData",[qx(:,end), qy(:,end)])
title("Heat flux field (W/m2)")
xlabel("Width (m)")
ylabel("Height (m)")
xlim([-1.0e-3 1.0e-3]);
ylim([-2.0e-3 1.0e-3])
daspect([1 1 1]);
%isp(qx(:,end))
%disp(qy(:,end))
Qn1= evaluateHeatRate(thermalresults, "Edge",1)
Qn2= evaluateHeatRate(thermalresults, "Edge",2)
Qn3= evaluateHeatRate(thermalresults, "Edge",3)
Qn4= evaluateHeatRate(thermalresults, "Edge",4)
Qn5= evaluateHeatRate(thermalresults, "Edge",5)
Qn6= evaluateHeatRate(thermalresults, "Edge",6)
Qn7= evaluateHeatRate(thermalresults, "Edge",7)
Qn8= evaluateHeatRate(thermalresults, "Edge",8)
Qn9= evaluateHeatRate(thermalresults, "Edge",9)
Qn10= evaluateHeatRate(thermalresults, "Edge",10)
Edgetotalwatts= Qn1+Qn2+Qn4+Qn5+Qn6+Qn7+Qn8+Qn9+Qn10 heat transfer, thin heater, mesh problems MATLAB Answers — New Questions
How do I replace the “classregtree” class and “eval” function in R2018a onwards?
I used to use ‘eval’ in MATLAB R2017b, but this triggers an error in R2018a. I have looked in the documentation, but found no solution. Can you help ?
Error using eval
Too many input arguments.I used to use ‘eval’ in MATLAB R2017b, but this triggers an error in R2018a. I have looked in the documentation, but found no solution. Can you help ?
Error using eval
Too many input arguments. I used to use ‘eval’ in MATLAB R2017b, but this triggers an error in R2018a. I have looked in the documentation, but found no solution. Can you help ?
Error using eval
Too many input arguments. eval, predict, classregtree, classificationtree, fitctree, subtrees, prune, error, removed MATLAB Answers — New Questions
Is the “Communications System Toolbox Support Package for Xilinx FPGA-based Radio” still available?
I would like to prototype software-defined radio (SDR) systems using MATLAB & Simulink using the Xilinx Virtex-6 and Spartan-6 FPGA boards. Is there an available Support Package for Xilinx FPGA Radio?I would like to prototype software-defined radio (SDR) systems using MATLAB & Simulink using the Xilinx Virtex-6 and Spartan-6 FPGA boards. Is there an available Support Package for Xilinx FPGA Radio? I would like to prototype software-defined radio (SDR) systems using MATLAB & Simulink using the Xilinx Virtex-6 and Spartan-6 FPGA boards. Is there an available Support Package for Xilinx FPGA Radio? xilinx, fpga, support, package, communications, system, toolbox, zynq, sdr MATLAB Answers — New Questions
Loop for reading and extracting data from a single line of multiple text files.
I have the following code that I would like to put into a loop to read multiple text files.
txt = fileread(‘Test01.txt’);
temppos = strfind(txt,’Ground Temperature:’);
endpos = strfind(txt, ‘°C’);
for k = 1:numel(temppos)
section{k,:} = txt(temppos(k):endpos(k));
end
for k = 1:numel(section)
temp(k,:) = sscanf(section{k}, ‘Ground Temperature: %f’);
end
Results = table(temp, ‘VariableNames’,{‘Temp’});I have the following code that I would like to put into a loop to read multiple text files.
txt = fileread(‘Test01.txt’);
temppos = strfind(txt,’Ground Temperature:’);
endpos = strfind(txt, ‘°C’);
for k = 1:numel(temppos)
section{k,:} = txt(temppos(k):endpos(k));
end
for k = 1:numel(section)
temp(k,:) = sscanf(section{k}, ‘Ground Temperature: %f’);
end
Results = table(temp, ‘VariableNames’,{‘Temp’}); I have the following code that I would like to put into a loop to read multiple text files.
txt = fileread(‘Test01.txt’);
temppos = strfind(txt,’Ground Temperature:’);
endpos = strfind(txt, ‘°C’);
for k = 1:numel(temppos)
section{k,:} = txt(temppos(k):endpos(k));
end
for k = 1:numel(section)
temp(k,:) = sscanf(section{k}, ‘Ground Temperature: %f’);
end
Results = table(temp, ‘VariableNames’,{‘Temp’}); loop, sscanf, fid MATLAB Answers — New Questions