Category: Matlab
Category Archives: Matlab
Communication between MATLAB and Crazyflie
I want to send commands from MATLAB/Simulink to Crazyflieb 2.0. How can I do it?I want to send commands from MATLAB/Simulink to Crazyflieb 2.0. How can I do it? I want to send commands from MATLAB/Simulink to Crazyflieb 2.0. How can I do it? crazyflie, matlab, simulink, communication MATLAB Answers — New Questions
​
delaunay function on raspberry pi?
Hello all,
I am trying to convert my code so it can run on a raspberry pi. However, part of my code is a map generator which uses the delaunay function to create a triangulation as follows:
(…)
x = x(:);
y = y(:);
z = z(:);
faces = delaunay(x, y);
randomMap = triangulation(faces, x, y, z);
end
Matlab Coder says it cannot convert the delaunay function. Is there any other function I can use to port this? I have already tried using ‘delaunayTriangulation’ or ‘alphashape’ instead, and tried to directly call ‘qhull’, but neither of these work. And since the delaunay function is built-in, I cannot look at the source code to fix this issue either and I do not know enough about the implementation to implement it from scratch.
Any help is appreciated!Hello all,
I am trying to convert my code so it can run on a raspberry pi. However, part of my code is a map generator which uses the delaunay function to create a triangulation as follows:
(…)
x = x(:);
y = y(:);
z = z(:);
faces = delaunay(x, y);
randomMap = triangulation(faces, x, y, z);
end
Matlab Coder says it cannot convert the delaunay function. Is there any other function I can use to port this? I have already tried using ‘delaunayTriangulation’ or ‘alphashape’ instead, and tried to directly call ‘qhull’, but neither of these work. And since the delaunay function is built-in, I cannot look at the source code to fix this issue either and I do not know enough about the implementation to implement it from scratch.
Any help is appreciated! Hello all,
I am trying to convert my code so it can run on a raspberry pi. However, part of my code is a map generator which uses the delaunay function to create a triangulation as follows:
(…)
x = x(:);
y = y(:);
z = z(:);
faces = delaunay(x, y);
randomMap = triangulation(faces, x, y, z);
end
Matlab Coder says it cannot convert the delaunay function. Is there any other function I can use to port this? I have already tried using ‘delaunayTriangulation’ or ‘alphashape’ instead, and tried to directly call ‘qhull’, but neither of these work. And since the delaunay function is built-in, I cannot look at the source code to fix this issue either and I do not know enough about the implementation to implement it from scratch.
Any help is appreciated! matlab coder, raspberry pi, delaunay, mesh, triangulation MATLAB Answers — New Questions
​
Saving image with high resolution
Hi,
I use this line of code to save my figure as .png : print(name,’-dpng’,’-r0′),
but i get a bad resolution picture bespite that the figure in matlab is good. I tried print(name,’-dpng’,’-r500′), but nothing changed.
How can i save figure as .png but with the same quality as the matlab figure?
Thank youHi,
I use this line of code to save my figure as .png : print(name,’-dpng’,’-r0′),
but i get a bad resolution picture bespite that the figure in matlab is good. I tried print(name,’-dpng’,’-r500′), but nothing changed.
How can i save figure as .png but with the same quality as the matlab figure?
Thank you Hi,
I use this line of code to save my figure as .png : print(name,’-dpng’,’-r0′),
but i get a bad resolution picture bespite that the figure in matlab is good. I tried print(name,’-dpng’,’-r500′), but nothing changed.
How can i save figure as .png but with the same quality as the matlab figure?
Thank you save figure, resolution MATLAB Answers — New Questions
​
How to check color image linear or nonlinear?
I have 24 bit RGB image. I want to check whether it is linear or nonlinear. How to check it.I have 24 bit RGB image. I want to check whether it is linear or nonlinear. How to check it. I have 24 bit RGB image. I want to check whether it is linear or nonlinear. How to check it. linear, nonlinear, color image MATLAB Answers — New Questions
​
Troubleshooting ESP32-WROOM/ESP32WROVER Setup Error in Simulink Support Package for Arduino Hardware
When attempting to set up the ESP32-WROOM/ESP32-WROVER board in Simulink using the ‘Setup Hardware’ option, I encounter an error during the final verification step. Specifically, when clicking on ‘Test Connection,’ the download status fails. It is worth noting that the driver for the ESP32 is correctly installed. How can I resolve this issue?When attempting to set up the ESP32-WROOM/ESP32-WROVER board in Simulink using the ‘Setup Hardware’ option, I encounter an error during the final verification step. Specifically, when clicking on ‘Test Connection,’ the download status fails. It is worth noting that the driver for the ESP32 is correctly installed. How can I resolve this issue? When attempting to set up the ESP32-WROOM/ESP32-WROVER board in Simulink using the ‘Setup Hardware’ option, I encounter an error during the final verification step. Specifically, when clicking on ‘Test Connection,’ the download status fails. It is worth noting that the driver for the ESP32 is correctly installed. How can I resolve this issue? esp32, esp32wroom, esp32wrover, arduino, hardwaresetup, setup MATLAB Answers — New Questions
​
How i can add a car image to yellow boxes and at y coordinate 4,5,6 a road image? (Sorry i have low vocabulary of English).
close all;
clc;
loop = 200;
r = 9;
c = 20;
carOccuranceMidWay = 0.05; %0-1
carMoveMidWay = 0.4; %0-1
carMoveFastWay = 0.7; %0-1
carMoveSlowWay = 0.2; %0-1
% define grid
x = zeros(r, c);
figure;
% x(5,1) = 1;
%
for i = 1:loop
for j = 1:c – 1
if(rand <= carOccuranceMidWay && x(5,1) == 0)
x(5,1) = 1;
end
% car exit from highway
if(x(5,c – 1) == 1) %For centerline
x(5,c – 1) = 0;
end
if(x(4,c – 1) == 1) %For FastLane
x(4,c – 1) = 0;
end
if(x(6,c – 1) == 1) %For SlowLane
x(6,c – 1) = 0;
end
% car move
if(x(5, j) == 1 && x(5, j + 1) == 0) % transition rules #1 for centerlane movement
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(5, j + 1) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(4,j)== 0) % transition rules #2 for transition to FastLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(4, j ) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(6,j)== 0) % transition rules #3 for transition to SlowLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(6, j ) = 1;
end
end
if(x(6, j) == 1 && x(6, j + 1) == 0) % transition rules #4 for SlowLane movement
if(rand <= carMoveSlowWay)
x(6, j ) = 0;
x(6, j + 1) = 1;
end
end
if(x(4, j) == 1 && x(4, j + 1) == 0) % transition rules #5 for FastLane movement
if(rand <= carMoveFastWay)
x(4, j ) = 0;
x(4, j + 1) = 1;
end
end
% Animate
clf; % Clear figure
imagesc(x);
% Display grid
pause(0.01);
end % Pause for 0.01 s
endclose all;
clc;
loop = 200;
r = 9;
c = 20;
carOccuranceMidWay = 0.05; %0-1
carMoveMidWay = 0.4; %0-1
carMoveFastWay = 0.7; %0-1
carMoveSlowWay = 0.2; %0-1
% define grid
x = zeros(r, c);
figure;
% x(5,1) = 1;
%
for i = 1:loop
for j = 1:c – 1
if(rand <= carOccuranceMidWay && x(5,1) == 0)
x(5,1) = 1;
end
% car exit from highway
if(x(5,c – 1) == 1) %For centerline
x(5,c – 1) = 0;
end
if(x(4,c – 1) == 1) %For FastLane
x(4,c – 1) = 0;
end
if(x(6,c – 1) == 1) %For SlowLane
x(6,c – 1) = 0;
end
% car move
if(x(5, j) == 1 && x(5, j + 1) == 0) % transition rules #1 for centerlane movement
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(5, j + 1) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(4,j)== 0) % transition rules #2 for transition to FastLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(4, j ) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(6,j)== 0) % transition rules #3 for transition to SlowLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(6, j ) = 1;
end
end
if(x(6, j) == 1 && x(6, j + 1) == 0) % transition rules #4 for SlowLane movement
if(rand <= carMoveSlowWay)
x(6, j ) = 0;
x(6, j + 1) = 1;
end
end
if(x(4, j) == 1 && x(4, j + 1) == 0) % transition rules #5 for FastLane movement
if(rand <= carMoveFastWay)
x(4, j ) = 0;
x(4, j + 1) = 1;
end
end
% Animate
clf; % Clear figure
imagesc(x);
% Display grid
pause(0.01);
end % Pause for 0.01 s
end close all;
clc;
loop = 200;
r = 9;
c = 20;
carOccuranceMidWay = 0.05; %0-1
carMoveMidWay = 0.4; %0-1
carMoveFastWay = 0.7; %0-1
carMoveSlowWay = 0.2; %0-1
% define grid
x = zeros(r, c);
figure;
% x(5,1) = 1;
%
for i = 1:loop
for j = 1:c – 1
if(rand <= carOccuranceMidWay && x(5,1) == 0)
x(5,1) = 1;
end
% car exit from highway
if(x(5,c – 1) == 1) %For centerline
x(5,c – 1) = 0;
end
if(x(4,c – 1) == 1) %For FastLane
x(4,c – 1) = 0;
end
if(x(6,c – 1) == 1) %For SlowLane
x(6,c – 1) = 0;
end
% car move
if(x(5, j) == 1 && x(5, j + 1) == 0) % transition rules #1 for centerlane movement
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(5, j + 1) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(4,j)== 0) % transition rules #2 for transition to FastLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(4, j ) = 1;
end
end
if(x(5, j) == 1 && x(5, j + 1) == 1 && x(6,j)== 0) % transition rules #3 for transition to SlowLane
if(rand <= carMoveMidWay)
x(5, j ) = 0;
x(6, j ) = 1;
end
end
if(x(6, j) == 1 && x(6, j + 1) == 0) % transition rules #4 for SlowLane movement
if(rand <= carMoveSlowWay)
x(6, j ) = 0;
x(6, j + 1) = 1;
end
end
if(x(4, j) == 1 && x(4, j + 1) == 0) % transition rules #5 for FastLane movement
if(rand <= carMoveFastWay)
x(4, j ) = 0;
x(4, j + 1) = 1;
end
end
% Animate
clf; % Clear figure
imagesc(x);
% Display grid
pause(0.01);
end % Pause for 0.01 s
end highway simulation, how to add a car to a box, how to add a car image to a moving plot in matlab, matlab car code MATLAB Answers — New Questions
​
how to plot contour of 3D variable
HI
I have issue with my data
I have salinity data with dimension (time,Lat,Lon) and I want to plot a filled 3-D contour
I want to plot salinity at specific
timestep 1:13
for example the size of variable
Lat=24*25;
Lon=24*25;
Salinty=744*24*25;
I am getting error becouse the X ,Y and Salinity had different size
I try for loop but it didn’t worke
for i=1:12;
Sal(i,:,:)=Salinity(i,:,:);
figure
contourf(X,Y,Sal(i,:,:);
end
Can someone help?HI
I have issue with my data
I have salinity data with dimension (time,Lat,Lon) and I want to plot a filled 3-D contour
I want to plot salinity at specific
timestep 1:13
for example the size of variable
Lat=24*25;
Lon=24*25;
Salinty=744*24*25;
I am getting error becouse the X ,Y and Salinity had different size
I try for loop but it didn’t worke
for i=1:12;
Sal(i,:,:)=Salinity(i,:,:);
figure
contourf(X,Y,Sal(i,:,:);
end
Can someone help? HI
I have issue with my data
I have salinity data with dimension (time,Lat,Lon) and I want to plot a filled 3-D contour
I want to plot salinity at specific
timestep 1:13
for example the size of variable
Lat=24*25;
Lon=24*25;
Salinty=744*24*25;
I am getting error becouse the X ,Y and Salinity had different size
I try for loop but it didn’t worke
for i=1:12;
Sal(i,:,:)=Salinity(i,:,:);
figure
contourf(X,Y,Sal(i,:,:);
end
Can someone help? contour MATLAB Answers — New Questions
​
shape has NaN vertices when adding new shapes to the aggregate shape encloses a void; error assigning shape to antenna
I am creating a PCB antenna pattern adding together copper Polygons and rectangles to make the PCB trace pattern. The copper traces short back on themself forming a region with voids in it.
I have used shape.Rectangle() and shape.Polygon() to create the elements and added them together.
When I show the copper it looks right (needs a little cleanup, but OK).
When I show or mesh the antenna it throws a triangulation error.
Adding the last rectangle that closes the shape causes an NaN. This error was NOT happening in another pattern (make a shape, remove a notch from an edge, bridge the notch with a rectangle…).
…
copper = shape.Polygon(‘Vertices’, 0.001*[MinX MinY 0; MinX MaxY 0; MaxX MaxY 0; MaxX MinY 0]);
stem = shape.Rectangle ("Center", 0.001*[StemX MaxY+StemLen/2], ‘Length’, 0.001*StemWid, ‘Width’, 0.001*StemLen);
copper = copper + stem;
… add rectangles till a closed loop is formed. feed point in stem and loading reactance at far end…
…
show(copper); % looks OK other than jagged corners, see below
Ant = customAntenna (‘Shape’, copper, ‘Load’, Load);
show(Ant); % –> error. If commented, mesh(Ant, …) throws similar error (same error, different call back path)
createFeed (Ant, FeedPoint, 1);
meshconfig (Ant, ‘manual’);
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005);
show(Ant) –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in em.MeshGeometry/protectedshow
Error in em.MeshGeometryAnalysis/show (line 31)
protectedshow(obj,varargin{:});
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005); –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in customAntenna/meshGenerator (line 306)
createGeometry(obj);
Error in em.MeshGeometry/updateMesh
Error in em.MeshGeometry/protectedmesh
Error in em.MeshGeometryAnalysis/mesh (line 66)
protectedmesh(obj,varargin{:});
Error in patchNotch (line 89)
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005);I am creating a PCB antenna pattern adding together copper Polygons and rectangles to make the PCB trace pattern. The copper traces short back on themself forming a region with voids in it.
I have used shape.Rectangle() and shape.Polygon() to create the elements and added them together.
When I show the copper it looks right (needs a little cleanup, but OK).
When I show or mesh the antenna it throws a triangulation error.
Adding the last rectangle that closes the shape causes an NaN. This error was NOT happening in another pattern (make a shape, remove a notch from an edge, bridge the notch with a rectangle…).
…
copper = shape.Polygon(‘Vertices’, 0.001*[MinX MinY 0; MinX MaxY 0; MaxX MaxY 0; MaxX MinY 0]);
stem = shape.Rectangle ("Center", 0.001*[StemX MaxY+StemLen/2], ‘Length’, 0.001*StemWid, ‘Width’, 0.001*StemLen);
copper = copper + stem;
… add rectangles till a closed loop is formed. feed point in stem and loading reactance at far end…
…
show(copper); % looks OK other than jagged corners, see below
Ant = customAntenna (‘Shape’, copper, ‘Load’, Load);
show(Ant); % –> error. If commented, mesh(Ant, …) throws similar error (same error, different call back path)
createFeed (Ant, FeedPoint, 1);
meshconfig (Ant, ‘manual’);
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005);
show(Ant) –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in em.MeshGeometry/protectedshow
Error in em.MeshGeometryAnalysis/show (line 31)
protectedshow(obj,varargin{:});
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005); –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in customAntenna/meshGenerator (line 306)
createGeometry(obj);
Error in em.MeshGeometry/updateMesh
Error in em.MeshGeometry/protectedmesh
Error in em.MeshGeometryAnalysis/mesh (line 66)
protectedmesh(obj,varargin{:});
Error in patchNotch (line 89)
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005);Â I am creating a PCB antenna pattern adding together copper Polygons and rectangles to make the PCB trace pattern. The copper traces short back on themself forming a region with voids in it.
I have used shape.Rectangle() and shape.Polygon() to create the elements and added them together.
When I show the copper it looks right (needs a little cleanup, but OK).
When I show or mesh the antenna it throws a triangulation error.
Adding the last rectangle that closes the shape causes an NaN. This error was NOT happening in another pattern (make a shape, remove a notch from an edge, bridge the notch with a rectangle…).
…
copper = shape.Polygon(‘Vertices’, 0.001*[MinX MinY 0; MinX MaxY 0; MaxX MaxY 0; MaxX MinY 0]);
stem = shape.Rectangle ("Center", 0.001*[StemX MaxY+StemLen/2], ‘Length’, 0.001*StemWid, ‘Width’, 0.001*StemLen);
copper = copper + stem;
… add rectangles till a closed loop is formed. feed point in stem and loading reactance at far end…
…
show(copper); % looks OK other than jagged corners, see below
Ant = customAntenna (‘Shape’, copper, ‘Load’, Load);
show(Ant); % –> error. If commented, mesh(Ant, …) throws similar error (same error, different call back path)
createFeed (Ant, FeedPoint, 1);
meshconfig (Ant, ‘manual’);
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005);
show(Ant) –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in em.MeshGeometry/protectedshow
Error in em.MeshGeometryAnalysis/show (line 31)
protectedshow(obj,varargin{:});
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005); –> error
Error using triangulation
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in customAntenna/createGeometry (line 235)
tri = triangulation(tt.ConnectivityList,vert);
Error in customAntenna/meshGenerator (line 306)
createGeometry(obj);
Error in em.MeshGeometry/updateMesh
Error in em.MeshGeometry/protectedmesh
Error in em.MeshGeometryAnalysis/mesh (line 66)
protectedmesh(obj,varargin{:});
Error in patchNotch (line 89)
mesh(Ant, ‘MaxEdgeLength’, .06,’MinEdgeLength’, 0.0005); customantenna, shape, triangulation error, nan MATLAB Answers — New Questions
​
Why i am getting this error when trying to open a simulink test file?
Hi Mathworks Community, I am getting the below error when opening .mldatx simulink test file in matlab:
When opening the file in another account online it works fine, but in my primary account i get this error. Any idea how to resolve this error?Hi Mathworks Community, I am getting the below error when opening .mldatx simulink test file in matlab:
When opening the file in another account online it works fine, but in my primary account i get this error. Any idea how to resolve this error? Hi Mathworks Community, I am getting the below error when opening .mldatx simulink test file in matlab:
When opening the file in another account online it works fine, but in my primary account i get this error. Any idea how to resolve this error? simulink, simulink test, test manager MATLAB Answers — New Questions
​
FEM multiple objects and material properties
Hello,
I’m trying to perform a structural FEM analysis on an object which consists out of multiple .STL files. These all have different material properties.
The problem is that I cannot import multiple models.
Now I can combine the .STL’s into one, but how do I then define the material properties?
Thanks in advance!Hello,
I’m trying to perform a structural FEM analysis on an object which consists out of multiple .STL files. These all have different material properties.
The problem is that I cannot import multiple models.
Now I can combine the .STL’s into one, but how do I then define the material properties?
Thanks in advance! Hello,
I’m trying to perform a structural FEM analysis on an object which consists out of multiple .STL files. These all have different material properties.
The problem is that I cannot import multiple models.
Now I can combine the .STL’s into one, but how do I then define the material properties?
Thanks in advance! fem, .stl MATLAB Answers — New Questions
​
How do I scatter twice on the same graph?
Hello,
I have 2 vectors with numbers: velocity(815×1) and velocityTimes(815×1).
Velocity is calculated, among the other parameters, with a variable N which also changes the way it looks when scattered.
I need to scatter velocity and velocityTimes once, change N, and then on the same graph scatter it again with the new N.
However I can’t seem to get it right.
What I’m trying to do is this:
n = 2
figure(1)
scatter(velocityTimes,velocity)
hold on
n = 150
scatter(velocityTimes,velocity)
But it only scatters the first one, with n=2. How do I fix it?
Thanks very much in advance!Hello,
I have 2 vectors with numbers: velocity(815×1) and velocityTimes(815×1).
Velocity is calculated, among the other parameters, with a variable N which also changes the way it looks when scattered.
I need to scatter velocity and velocityTimes once, change N, and then on the same graph scatter it again with the new N.
However I can’t seem to get it right.
What I’m trying to do is this:
n = 2
figure(1)
scatter(velocityTimes,velocity)
hold on
n = 150
scatter(velocityTimes,velocity)
But it only scatters the first one, with n=2. How do I fix it?
Thanks very much in advance! Hello,
I have 2 vectors with numbers: velocity(815×1) and velocityTimes(815×1).
Velocity is calculated, among the other parameters, with a variable N which also changes the way it looks when scattered.
I need to scatter velocity and velocityTimes once, change N, and then on the same graph scatter it again with the new N.
However I can’t seem to get it right.
What I’m trying to do is this:
n = 2
figure(1)
scatter(velocityTimes,velocity)
hold on
n = 150
scatter(velocityTimes,velocity)
But it only scatters the first one, with n=2. How do I fix it?
Thanks very much in advance! scatter, 2 scatters, hold on, plot twice MATLAB Answers — New Questions
​
Permanent zero on Fuzzy block output P&O mppt algorithm
Dear Staff and members,
I have an issue on my Fuzzy block which display only zero value on Matlab R2017b in a P&O MPPT algorithm model. If anyone can help. Thanks in advance.Dear Staff and members,
I have an issue on my Fuzzy block which display only zero value on Matlab R2017b in a P&O MPPT algorithm model. If anyone can help. Thanks in advance. Dear Staff and members,
I have an issue on my Fuzzy block which display only zero value on Matlab R2017b in a P&O MPPT algorithm model. If anyone can help. Thanks in advance. zero on fuzzy block ouput, p o mppt MATLAB Answers — New Questions
​
MATLab isn’t allowing me to create new code or text in a previous file I was working on. The “Code” and “Text” buttons do not work, I cannot click them. How can this be fixed?
This is what it looks like.This is what it looks like. This is what it looks like. editing, blocked, previous-file, someworkalreadydoneinit MATLAB Answers — New Questions
​
I can’t find helper function: transientBCHeatedBlock which is supposed to be in: matlab/R20XXx/examples/pde/main
Trying to run example on Matlab site that includes:
model.EdgeBC(6)= …
edgeBC(Temperature=@transientBCHeatedBlock);Trying to run example on Matlab site that includes:
model.EdgeBC(6)= …
edgeBC(Temperature=@transientBCHeatedBlock);Â Trying to run example on Matlab site that includes:
model.EdgeBC(6)= …
edgeBC(Temperature=@transientBCHeatedBlock); helper functions, thermal, transient, bc MATLAB Answers — New Questions
​
Is Wilcoxon test appropiate for the comparison of large, independent, nonnormal datasets?
Hi all!
I am using ‘ranksum’ function (Wilcoxon test) to compare two independent, nonnormal, large data sets. However, p-value is 0 I think because of the effect of large data size. Any other test statistics that may handle such a large population analysis?
Thanks in advance :)Hi all!
I am using ‘ranksum’ function (Wilcoxon test) to compare two independent, nonnormal, large data sets. However, p-value is 0 I think because of the effect of large data size. Any other test statistics that may handle such a large population analysis?
Thanks in advance 🙂 Hi all!
I am using ‘ranksum’ function (Wilcoxon test) to compare two independent, nonnormal, large data sets. However, p-value is 0 I think because of the effect of large data size. Any other test statistics that may handle such a large population analysis?
Thanks in advance 🙂 ranksum, wilcoxon test, large-populations, independet-values, nonnormal MATLAB Answers — New Questions
​
Code matlab for “ADAPTIVE MODULATION AND CODING”
Hi discussants,can some one get me any good literature on ADAPTIVE MODULATION AND CODING, better still matlab codes of it. i would be gratefull for any help.thanxHi discussants,can some one get me any good literature on ADAPTIVE MODULATION AND CODING, better still matlab codes of it. i would be gratefull for any help.thanx Hi discussants,can some one get me any good literature on ADAPTIVE MODULATION AND CODING, better still matlab codes of it. i would be gratefull for any help.thanx mobile radio, wlan, ofdm, hsdpa MATLAB Answers — New Questions
​
Solving Duffing Equation with the new framework for ODEs
I solved the duffing equation using the new framework for ODEs. Below is the code.
It works fine and plots as expected. However, I was wondering if there is a way to create a phase portrait in the interval t=[0 3000] without looking like a smudge.
% Define the parameters
delta = 0.1;
alpha = -1;
beta = 1;
gamma = 0.35;
omega = 1.4;
% Define the ODE function for the Duffing equation
duffingODE = @(t, y) [y(2);
-delta*y(2) – alpha*y(1) – beta*y(1)^3 + gamma*cos(omega*t)];
% Initial conditions: [x(0), dx/dt(0)]
initialConditions = [0; 0];
% Create an ode object
F = ode(ODEFcn=duffingODE, InitialTime=0, InitialValue=initialConditions);
% Solve the equation over the interval [0, 3000]
sol = solve(F, 0, 3000);
% Interpolate the solution to get more points for plotting
timeFine = linspace(0, 300, 10000); % Create a fine time vector with 10,000 points
solutionFine = interp1(sol.Time, sol.Solution’, timeFine)’; % Interpolate solution
% Plot the interpolated time series solution
figure;
subplot(2, 1, 1);
plot(timeFine, solutionFine(1, :), ‘LineWidth’, 1.5);
xlabel(‘Time’);
ylabel(‘Displacement’);
title(‘Interpolated Solution of the Duffing Equation’);
grid on;
% Plot the interpolated phase portrait
subplot(2, 1, 2);
plot(solutionFine(1, :), solutionFine(2, :), ‘LineWidth’, 1.5);
xlabel(‘Displacement x(t)’);
ylabel(‘Velocity dx/dt’);
title(‘Interpolated Phase Portrait of the Duffing Equation’);
grid on;I solved the duffing equation using the new framework for ODEs. Below is the code.
It works fine and plots as expected. However, I was wondering if there is a way to create a phase portrait in the interval t=[0 3000] without looking like a smudge.
% Define the parameters
delta = 0.1;
alpha = -1;
beta = 1;
gamma = 0.35;
omega = 1.4;
% Define the ODE function for the Duffing equation
duffingODE = @(t, y) [y(2);
-delta*y(2) – alpha*y(1) – beta*y(1)^3 + gamma*cos(omega*t)];
% Initial conditions: [x(0), dx/dt(0)]
initialConditions = [0; 0];
% Create an ode object
F = ode(ODEFcn=duffingODE, InitialTime=0, InitialValue=initialConditions);
% Solve the equation over the interval [0, 3000]
sol = solve(F, 0, 3000);
% Interpolate the solution to get more points for plotting
timeFine = linspace(0, 300, 10000); % Create a fine time vector with 10,000 points
solutionFine = interp1(sol.Time, sol.Solution’, timeFine)’; % Interpolate solution
% Plot the interpolated time series solution
figure;
subplot(2, 1, 1);
plot(timeFine, solutionFine(1, :), ‘LineWidth’, 1.5);
xlabel(‘Time’);
ylabel(‘Displacement’);
title(‘Interpolated Solution of the Duffing Equation’);
grid on;
% Plot the interpolated phase portrait
subplot(2, 1, 2);
plot(solutionFine(1, :), solutionFine(2, :), ‘LineWidth’, 1.5);
xlabel(‘Displacement x(t)’);
ylabel(‘Velocity dx/dt’);
title(‘Interpolated Phase Portrait of the Duffing Equation’);
grid on;Â I solved the duffing equation using the new framework for ODEs. Below is the code.
It works fine and plots as expected. However, I was wondering if there is a way to create a phase portrait in the interval t=[0 3000] without looking like a smudge.
% Define the parameters
delta = 0.1;
alpha = -1;
beta = 1;
gamma = 0.35;
omega = 1.4;
% Define the ODE function for the Duffing equation
duffingODE = @(t, y) [y(2);
-delta*y(2) – alpha*y(1) – beta*y(1)^3 + gamma*cos(omega*t)];
% Initial conditions: [x(0), dx/dt(0)]
initialConditions = [0; 0];
% Create an ode object
F = ode(ODEFcn=duffingODE, InitialTime=0, InitialValue=initialConditions);
% Solve the equation over the interval [0, 3000]
sol = solve(F, 0, 3000);
% Interpolate the solution to get more points for plotting
timeFine = linspace(0, 300, 10000); % Create a fine time vector with 10,000 points
solutionFine = interp1(sol.Time, sol.Solution’, timeFine)’; % Interpolate solution
% Plot the interpolated time series solution
figure;
subplot(2, 1, 1);
plot(timeFine, solutionFine(1, :), ‘LineWidth’, 1.5);
xlabel(‘Time’);
ylabel(‘Displacement’);
title(‘Interpolated Solution of the Duffing Equation’);
grid on;
% Plot the interpolated phase portrait
subplot(2, 1, 2);
plot(solutionFine(1, :), solutionFine(2, :), ‘LineWidth’, 1.5);
xlabel(‘Displacement x(t)’);
ylabel(‘Velocity dx/dt’);
title(‘Interpolated Phase Portrait of the Duffing Equation’);
grid on; ode, plotting, differential equations, mathematics, nonlinear, duffing equation MATLAB Answers — New Questions
​
Issue Summing Linearized Optimization Expressions
Hello!
I m working on an optimization problem in MATLAB where I need to linearize and sum two expressions: uplink_time and Execution_time. My goal is to correctly define and use these expressions in an optimization problem. However, I am encountering issues where the solver switches to Genetic Algorithm unexpectedly.
known that both expressions are linear respect to my optimization variable A.
End_time = optimexpr(N, numNodes, num_vehicles);
for m = 1:num_vehicles
for k = 1:N
for n = 1:numNodes
End_time(k, n, m) = A(k, n, m)*uplink_time(k, n, m)+ A(k, n, m)*Execution_time(k, n, m);
end
end
end
When I run this code, I observe that the solver switches to GA instead of using a linear programming solver.
Could someone please help me understand why the solver is switching to GA and how to correctly define and use the optimization expressions in this context? Any advice on resolving this issue would be greatly appreciated.
Thanks a lot.Hello!
I m working on an optimization problem in MATLAB where I need to linearize and sum two expressions: uplink_time and Execution_time. My goal is to correctly define and use these expressions in an optimization problem. However, I am encountering issues where the solver switches to Genetic Algorithm unexpectedly.
known that both expressions are linear respect to my optimization variable A.
End_time = optimexpr(N, numNodes, num_vehicles);
for m = 1:num_vehicles
for k = 1:N
for n = 1:numNodes
End_time(k, n, m) = A(k, n, m)*uplink_time(k, n, m)+ A(k, n, m)*Execution_time(k, n, m);
end
end
end
When I run this code, I observe that the solver switches to GA instead of using a linear programming solver.
Could someone please help me understand why the solver is switching to GA and how to correctly define and use the optimization expressions in this context? Any advice on resolving this issue would be greatly appreciated.
Thanks a lot. Hello!
I m working on an optimization problem in MATLAB where I need to linearize and sum two expressions: uplink_time and Execution_time. My goal is to correctly define and use these expressions in an optimization problem. However, I am encountering issues where the solver switches to Genetic Algorithm unexpectedly.
known that both expressions are linear respect to my optimization variable A.
End_time = optimexpr(N, numNodes, num_vehicles);
for m = 1:num_vehicles
for k = 1:N
for n = 1:numNodes
End_time(k, n, m) = A(k, n, m)*uplink_time(k, n, m)+ A(k, n, m)*Execution_time(k, n, m);
end
end
end
When I run this code, I observe that the solver switches to GA instead of using a linear programming solver.
Could someone please help me understand why the solver is switching to GA and how to correctly define and use the optimization expressions in this context? Any advice on resolving this issue would be greatly appreciated.
Thanks a lot. matlab, code, issue, ilp, optimization MATLAB Answers — New Questions
​
Transforming long panel data
I have a panel data in long format just like the attachment "before", now I want to transform it in a way that variables of a specific country will be under their respective countries on the column while years Will be on rows of the data frame.. Just like in the attachment" After "I have a panel data in long format just like the attachment "before", now I want to transform it in a way that variables of a specific country will be under their respective countries on the column while years Will be on rows of the data frame.. Just like in the attachment" After " I have a panel data in long format just like the attachment "before", now I want to transform it in a way that variables of a specific country will be under their respective countries on the column while years Will be on rows of the data frame.. Just like in the attachment" After " panel data, transform, long MATLAB Answers — New Questions
​
Summing over observations in unbalanced panel data
Hello, I have an unbalanced panel data set. For each id, I’d like to sum all values of x up to the latest time I observe that id, and record the summation to a new variable. How can I do this? Ideally, I’d like to avoid looping as I have a large dataset and I try to speed up the process.
Thank you in advance!
SelcenHello, I have an unbalanced panel data set. For each id, I’d like to sum all values of x up to the latest time I observe that id, and record the summation to a new variable. How can I do this? Ideally, I’d like to avoid looping as I have a large dataset and I try to speed up the process.
Thank you in advance!
Selcen Hello, I have an unbalanced panel data set. For each id, I’d like to sum all values of x up to the latest time I observe that id, and record the summation to a new variable. How can I do this? Ideally, I’d like to avoid looping as I have a large dataset and I try to speed up the process.
Thank you in advance!
Selcen unbalanced panel data, summation MATLAB Answers — New Questions
​