Category: Matlab
Category Archives: Matlab
How do I remove the colored area on a part of the map?
How can I remove the colored fill (make it white) outside the selected polygon?How can I remove the colored fill (make it white) outside the selected polygon? How can I remove the colored fill (make it white) outside the selected polygon? map, masking, mask image MATLAB Answers — New Questions
Help with getting data from image at equidistant positions from the centre – to include the “off circle corners”
Hello, I have an image and I want to get the median of data at each radius value. This is shown by the yellow circles – so each circle (take the median of all pixels on it).
However, in my attemy, I missing all the corners of data that are actually at a larger radius than the image size, but not full circles. Any suggestions how to include this data.
This was my attempt:
% 1st draw circle of radius R on the flog2 plot
theta = linspace(0,360); %use n=121 for every 3 degrees (reduce from every degree for speed
centre = [cx,cy]; %circle centre
% I= Image
[X,Y]=ndgrid(1:size(I,1),1:size(I,2));
X=X-cx;Y=Y-cy;%shift coordinate grid
hold(ax1,"on");
data=[];
for i=1:cy-1
radius=i; %circle radius
data(i,1)=i;
y = radius*sind(theta)+centre(2);
x = radius*cosd(theta)+centre(1);
%Get Data on radius
L=sqrt(X.^2+Y.^2)==radius;
data(i,2) = median(I(L));
if mod(i,5)==0
plot(ax1,x,y,’y’); %draw circle
end
% Now use interp so use all pixels on circle. This is
% actually what I finally use now
[xx,yy]=pol2cart(theta,radius); % this is for the interp2 approach
x=xx+cx; y=yy+cy;
vals=median(interp2(I,x,y));
data(i,3)=vals;
end
% Now plot data
hold(ax2,"on");
plot(ax2,data(:,1),data(:,3),’y-‘,’LineWidth’,3);Hello, I have an image and I want to get the median of data at each radius value. This is shown by the yellow circles – so each circle (take the median of all pixels on it).
However, in my attemy, I missing all the corners of data that are actually at a larger radius than the image size, but not full circles. Any suggestions how to include this data.
This was my attempt:
% 1st draw circle of radius R on the flog2 plot
theta = linspace(0,360); %use n=121 for every 3 degrees (reduce from every degree for speed
centre = [cx,cy]; %circle centre
% I= Image
[X,Y]=ndgrid(1:size(I,1),1:size(I,2));
X=X-cx;Y=Y-cy;%shift coordinate grid
hold(ax1,"on");
data=[];
for i=1:cy-1
radius=i; %circle radius
data(i,1)=i;
y = radius*sind(theta)+centre(2);
x = radius*cosd(theta)+centre(1);
%Get Data on radius
L=sqrt(X.^2+Y.^2)==radius;
data(i,2) = median(I(L));
if mod(i,5)==0
plot(ax1,x,y,’y’); %draw circle
end
% Now use interp so use all pixels on circle. This is
% actually what I finally use now
[xx,yy]=pol2cart(theta,radius); % this is for the interp2 approach
x=xx+cx; y=yy+cy;
vals=median(interp2(I,x,y));
data(i,3)=vals;
end
% Now plot data
hold(ax2,"on");
plot(ax2,data(:,1),data(:,3),’y-‘,’LineWidth’,3); Hello, I have an image and I want to get the median of data at each radius value. This is shown by the yellow circles – so each circle (take the median of all pixels on it).
However, in my attemy, I missing all the corners of data that are actually at a larger radius than the image size, but not full circles. Any suggestions how to include this data.
This was my attempt:
% 1st draw circle of radius R on the flog2 plot
theta = linspace(0,360); %use n=121 for every 3 degrees (reduce from every degree for speed
centre = [cx,cy]; %circle centre
% I= Image
[X,Y]=ndgrid(1:size(I,1),1:size(I,2));
X=X-cx;Y=Y-cy;%shift coordinate grid
hold(ax1,"on");
data=[];
for i=1:cy-1
radius=i; %circle radius
data(i,1)=i;
y = radius*sind(theta)+centre(2);
x = radius*cosd(theta)+centre(1);
%Get Data on radius
L=sqrt(X.^2+Y.^2)==radius;
data(i,2) = median(I(L));
if mod(i,5)==0
plot(ax1,x,y,’y’); %draw circle
end
% Now use interp so use all pixels on circle. This is
% actually what I finally use now
[xx,yy]=pol2cart(theta,radius); % this is for the interp2 approach
x=xx+cx; y=yy+cy;
vals=median(interp2(I,x,y));
data(i,3)=vals;
end
% Now plot data
hold(ax2,"on");
plot(ax2,data(:,1),data(:,3),’y-‘,’LineWidth’,3); image, ngrid, pol2cart MATLAB Answers — New Questions
In a (possibly directed) graph, is there a simple way to find all nodes reachable for a given node?
I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path.I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path. I’ve recently started working with MATLAB graphs. In two recent problems, I have graphs which are not known to be connected every node to every other node. Is there a way to determine in one or a known number of steps, the set of nodes which can (or cannot would work) be reached from a specified node? I’ve encountered this question both with undirected (small, and I powered through) and now undirected nodes.
Just in case I’m in asking an XY question, my current directed graph is entirely unidirectional; there are no closed loops. I could trivially assign a value to each node, and know that every edge leads to a node with a strictly larger value than the node it leads from. To be even more specific if it helps, though I definitely don’t know the proper math language: the graph represents a double elimination playoff bracket, and I want to put together the possible routes for each seed on a plot to guide teams through the process, pruning out things that don’t matter to that team. Fortunately in this case, the graph is deterministic; no re-seeding occurs due to match outcomes, making such a plot useful.
My previous issue, which was small so I powered through, had an undirected graph, and I really just wanted to know whether or not the graph was continuous; that is, whether every node pair was connected by some path. graph, connected MATLAB Answers — New Questions
why my 3D image is not extruded in 3D software?
Hello, i have 3D image but when I view the image in the 3D software to be printed, the image does not extrude. here i attached my code and images. can anyone check on my code. Many thanks.
a = imread (‘stomachgray.tif’);
mask = zeros(size(a));
mask(100:end-100,100:end-100) = 1;
bw = activecontour(a,mask,1000);
c = im2double(bw);
shading flat
d = imgaussfilt3 (c,4);
colormap(bone)
h = hgtransform;
mesh(d*100, ‘Parent’, h, ‘FaceColor’, ‘r’ )
view(3)
lighting gouraud
camlight right
% Make it taller
set (gca, ‘units’, ‘cent’)
set(h, ‘Matrix’, makehgtform(‘scale’, [10 10 500]))
[X,Y] = meshgrid(1:length(h));
surf2stl(‘stomachSurf7.stl’,X,Y,d);
end
<</matlabcentral/answers/uploaded_files/64209/3d%20mtlb.JPG>>
<</matlabcentral/answers/uploaded_files/64210/3d%20view.JPG>>Hello, i have 3D image but when I view the image in the 3D software to be printed, the image does not extrude. here i attached my code and images. can anyone check on my code. Many thanks.
a = imread (‘stomachgray.tif’);
mask = zeros(size(a));
mask(100:end-100,100:end-100) = 1;
bw = activecontour(a,mask,1000);
c = im2double(bw);
shading flat
d = imgaussfilt3 (c,4);
colormap(bone)
h = hgtransform;
mesh(d*100, ‘Parent’, h, ‘FaceColor’, ‘r’ )
view(3)
lighting gouraud
camlight right
% Make it taller
set (gca, ‘units’, ‘cent’)
set(h, ‘Matrix’, makehgtform(‘scale’, [10 10 500]))
[X,Y] = meshgrid(1:length(h));
surf2stl(‘stomachSurf7.stl’,X,Y,d);
end
<</matlabcentral/answers/uploaded_files/64209/3d%20mtlb.JPG>>
<</matlabcentral/answers/uploaded_files/64210/3d%20view.JPG>> Hello, i have 3D image but when I view the image in the 3D software to be printed, the image does not extrude. here i attached my code and images. can anyone check on my code. Many thanks.
a = imread (‘stomachgray.tif’);
mask = zeros(size(a));
mask(100:end-100,100:end-100) = 1;
bw = activecontour(a,mask,1000);
c = im2double(bw);
shading flat
d = imgaussfilt3 (c,4);
colormap(bone)
h = hgtransform;
mesh(d*100, ‘Parent’, h, ‘FaceColor’, ‘r’ )
view(3)
lighting gouraud
camlight right
% Make it taller
set (gca, ‘units’, ‘cent’)
set(h, ‘Matrix’, makehgtform(‘scale’, [10 10 500]))
[X,Y] = meshgrid(1:length(h));
surf2stl(‘stomachSurf7.stl’,X,Y,d);
end
<</matlabcentral/answers/uploaded_files/64209/3d%20mtlb.JPG>>
<</matlabcentral/answers/uploaded_files/64210/3d%20view.JPG>> mesh, extrude, matlab, 3d image MATLAB Answers — New Questions
How can ı solve this triangle problem at MATLAB?
In the triangle which has edges names:a,b,c; a=9 b=18 c=25 how can ı calculate the alfa(the angles sees a) with the law of cosines? with MATLABIn the triangle which has edges names:a,b,c; a=9 b=18 c=25 how can ı calculate the alfa(the angles sees a) with the law of cosines? with MATLAB In the triangle which has edges names:a,b,c; a=9 b=18 c=25 how can ı calculate the alfa(the angles sees a) with the law of cosines? with MATLAB matlab, mathematics, homework MATLAB Answers — New Questions
I need to rotate my 3D figure
I have particle size data for differrent De(parameter) values.
I have plotted 2Dbar graphs, I want stack all figures into one 3D figure window.
I stacked everything, that looks like the image below
But I want to rotate axis in such a way that: Particle_density(Y-axis) in vertical, Particle size(X-axis) in horizontal and De (z-axis) per pendicular to the screen. It should look like this image below
I have attached my matlab code to this thread.
Please guide me, how to do this. Thanks in advanceI have particle size data for differrent De(parameter) values.
I have plotted 2Dbar graphs, I want stack all figures into one 3D figure window.
I stacked everything, that looks like the image below
But I want to rotate axis in such a way that: Particle_density(Y-axis) in vertical, Particle size(X-axis) in horizontal and De (z-axis) per pendicular to the screen. It should look like this image below
I have attached my matlab code to this thread.
Please guide me, how to do this. Thanks in advance I have particle size data for differrent De(parameter) values.
I have plotted 2Dbar graphs, I want stack all figures into one 3D figure window.
I stacked everything, that looks like the image below
But I want to rotate axis in such a way that: Particle_density(Y-axis) in vertical, Particle size(X-axis) in horizontal and De (z-axis) per pendicular to the screen. It should look like this image below
I have attached my matlab code to this thread.
Please guide me, how to do this. Thanks in advance rotation, bar, plot3 MATLAB Answers — New Questions
How to fill a volume with spheres?
Hi,
I’d like to import *.stl files of different shapes and fill the volume with overlapping spheres.
How can I do it. I already did this task for 2D shapes using bwdist. But for 3D shapes, I don’t know how to do it.
ThanksHi,
I’d like to import *.stl files of different shapes and fill the volume with overlapping spheres.
How can I do it. I already did this task for 2D shapes using bwdist. But for 3D shapes, I don’t know how to do it.
Thanks Hi,
I’d like to import *.stl files of different shapes and fill the volume with overlapping spheres.
How can I do it. I already did this task for 2D shapes using bwdist. But for 3D shapes, I don’t know how to do it.
Thanks 3d, shapes, spheres, volume filling MATLAB Answers — New Questions
how to use stlwrite function options
Hi guys, i have to make a triangulation 3D of a solid of which i have the coordinates (x,y,z) of 20ooo points and i need to export the result (so the tetrahedra) to an stl file.
How can I use properly the stlwrite function, in particular the option indicated with TRIANGULATION?
thanks a lot.Hi guys, i have to make a triangulation 3D of a solid of which i have the coordinates (x,y,z) of 20ooo points and i need to export the result (so the tetrahedra) to an stl file.
How can I use properly the stlwrite function, in particular the option indicated with TRIANGULATION?
thanks a lot. Hi guys, i have to make a triangulation 3D of a solid of which i have the coordinates (x,y,z) of 20ooo points and i need to export the result (so the tetrahedra) to an stl file.
How can I use properly the stlwrite function, in particular the option indicated with TRIANGULATION?
thanks a lot. triangulation delaunay stl .stl stlwrite MATLAB Answers — New Questions
Spider Plot with Standard Deviation as shaded region
I want to plot a spider plot where each spoke represents the average value with solid line. In addition, I want to show standard deviation as shaded region around the average plot (Average+SD and Average-SD). I have attached a figure to show the desired outcome.
Figure available at: https://www.mdpi.com/2078-2489/15/6/364
Thank you in advance.I want to plot a spider plot where each spoke represents the average value with solid line. In addition, I want to show standard deviation as shaded region around the average plot (Average+SD and Average-SD). I have attached a figure to show the desired outcome.
Figure available at: https://www.mdpi.com/2078-2489/15/6/364
Thank you in advance. I want to plot a spider plot where each spoke represents the average value with solid line. In addition, I want to show standard deviation as shaded region around the average plot (Average+SD and Average-SD). I have attached a figure to show the desired outcome.
Figure available at: https://www.mdpi.com/2078-2489/15/6/364
Thank you in advance. spider plots, standard deviation, shaded region MATLAB Answers — New Questions
Setting axes with center in origin (0,0) in plotted variables.
Hey community, I have two variables with <10 x 1> double data. I am to plot these two in a plot, but would like to have the axes to be intersecting each other in origin (0,0). Instead in the axes are shown with intersecting at for example (-2000,-6), my lowest x-value is -1200, lowest y-value is -6. Here it would be great to have the x-axis through y=0, so that differences from y=0 easily can be seen graphically.
How would I do that, is there a command you could use in the script written, to make it move the axes? I have a large script to evaluate a lot of graphs in, so a MATLAB-command would be preferable to a tool in the figure builder.
The (simple) code used is as following:
%% person5 – Puls
hold on
plot(person5_ethanol_ekgpuls_tid,person5_ethanol_ekgpuls,’g.-‘)
xlabel(‘Tid/Sek’)
ylabel(‘Blodtryk/MmHg’)
title(‘Forsøgsperson #5 Ethanol Ekg Puls’)
Hope that my question is understandable and that it can be done.Hey community, I have two variables with <10 x 1> double data. I am to plot these two in a plot, but would like to have the axes to be intersecting each other in origin (0,0). Instead in the axes are shown with intersecting at for example (-2000,-6), my lowest x-value is -1200, lowest y-value is -6. Here it would be great to have the x-axis through y=0, so that differences from y=0 easily can be seen graphically.
How would I do that, is there a command you could use in the script written, to make it move the axes? I have a large script to evaluate a lot of graphs in, so a MATLAB-command would be preferable to a tool in the figure builder.
The (simple) code used is as following:
%% person5 – Puls
hold on
plot(person5_ethanol_ekgpuls_tid,person5_ethanol_ekgpuls,’g.-‘)
xlabel(‘Tid/Sek’)
ylabel(‘Blodtryk/MmHg’)
title(‘Forsøgsperson #5 Ethanol Ekg Puls’)
Hope that my question is understandable and that it can be done. Hey community, I have two variables with <10 x 1> double data. I am to plot these two in a plot, but would like to have the axes to be intersecting each other in origin (0,0). Instead in the axes are shown with intersecting at for example (-2000,-6), my lowest x-value is -1200, lowest y-value is -6. Here it would be great to have the x-axis through y=0, so that differences from y=0 easily can be seen graphically.
How would I do that, is there a command you could use in the script written, to make it move the axes? I have a large script to evaluate a lot of graphs in, so a MATLAB-command would be preferable to a tool in the figure builder.
The (simple) code used is as following:
%% person5 – Puls
hold on
plot(person5_ethanol_ekgpuls_tid,person5_ethanol_ekgpuls,’g.-‘)
xlabel(‘Tid/Sek’)
ylabel(‘Blodtryk/MmHg’)
title(‘Forsøgsperson #5 Ethanol Ekg Puls’)
Hope that my question is understandable and that it can be done. axes in plots, plot, figures, moving axes, origin MATLAB Answers — New Questions
How to programmatically get a list of all app properties in AppDesigner
Hi,
I’m writing a large app in appDesigner, and I want to create a list / text area that would display all of the app property fields. I can’t find a way to programatically pull their names, does anyone know a way of doing this?
P.S. I’m on 2022b.
Thanks!
VSHi,
I’m writing a large app in appDesigner, and I want to create a list / text area that would display all of the app property fields. I can’t find a way to programatically pull their names, does anyone know a way of doing this?
P.S. I’m on 2022b.
Thanks!
VS Hi,
I’m writing a large app in appDesigner, and I want to create a list / text area that would display all of the app property fields. I can’t find a way to programatically pull their names, does anyone know a way of doing this?
P.S. I’m on 2022b.
Thanks!
VS appdesigner MATLAB Answers — New Questions
How to make only x-axis invisible (y-axis stays visible)?
I have two axes (top, bottom) in a GUI. I do not want the x-axis of the top ghraph to be present (because it is the same as the bottom x-axis). I could not find how to handle separately the x and y axis visibility.
CsabaI have two axes (top, bottom) in a GUI. I do not want the x-axis of the top ghraph to be present (because it is the same as the bottom x-axis). I could not find how to handle separately the x and y axis visibility.
Csaba I have two axes (top, bottom) in a GUI. I do not want the x-axis of the top ghraph to be present (because it is the same as the bottom x-axis). I could not find how to handle separately the x and y axis visibility.
Csaba axis, visibility MATLAB Answers — New Questions
How do I link to Simulink variable from app designer
Ive created a model in app designer and want to change an image in the app based on the state of a value in the model. For example image is a pump and if the Simulink model state is 0 I want to use the closed pump image, if the state is 1 use the pump running image etc. The image widget doesn’t support bindings. that’s OK I can set up my own function and schedule it to run every second to check the pump state. In the model I have a variable setup that’s being logged. In the app I’m then trying to access that variable using: app.Simulation.LoggedSignals(‘PumpCtrlMdl/PumpState:1’).Values But this returns empty. How would I update my code so I get the value of the output value correctly?Ive created a model in app designer and want to change an image in the app based on the state of a value in the model. For example image is a pump and if the Simulink model state is 0 I want to use the closed pump image, if the state is 1 use the pump running image etc. The image widget doesn’t support bindings. that’s OK I can set up my own function and schedule it to run every second to check the pump state. In the model I have a variable setup that’s being logged. In the app I’m then trying to access that variable using: app.Simulation.LoggedSignals(‘PumpCtrlMdl/PumpState:1’).Values But this returns empty. How would I update my code so I get the value of the output value correctly? Ive created a model in app designer and want to change an image in the app based on the state of a value in the model. For example image is a pump and if the Simulink model state is 0 I want to use the closed pump image, if the state is 1 use the pump running image etc. The image widget doesn’t support bindings. that’s OK I can set up my own function and schedule it to run every second to check the pump state. In the model I have a variable setup that’s being logged. In the app I’m then trying to access that variable using: app.Simulation.LoggedSignals(‘PumpCtrlMdl/PumpState:1’).Values But this returns empty. How would I update my code so I get the value of the output value correctly? simulink, appdesigner MATLAB Answers — New Questions
Bug in readtable()? – if the first values in a CSV’s column are missing, the whole column is misinterpreted
I am reading a big CSV file (500K lines) with readtable. In the CSV, some columns have the first 250+ lines empty (e.g. ",,,," in the CSV), while the non-missing values below (pretty rare) are either text strings or dates (in the DD-MM-YYYY format). Readtable() somehow interprets these columns as numeric, and so converts all the strings and dates into NaNs – thus, I end up with 100% NaN-filled columns instead of rarely-populated data (among empty strings and NaTs).
Furthermore, if I move the "with-data" lines up – even a few dozens positions up – readtable() starts to read everything normally!
So, it looks like readtable() checks only ~250 first values to determine the type of the column, which, in my opinion, is a bug! (Although I understand that it was likely made to improve speed.)
Is there a way to fix it systematically? I have lots of such CSVs with thousands of columns in them – so, a manual check and manual fix is not an option…
UPD: a test-file (truncated to 510 lines) is attached – the behaviour is still the same. The problem columns are the 2nd and the 3rd (p190, p191). The first non-empty value is on data-line 270.I am reading a big CSV file (500K lines) with readtable. In the CSV, some columns have the first 250+ lines empty (e.g. ",,,," in the CSV), while the non-missing values below (pretty rare) are either text strings or dates (in the DD-MM-YYYY format). Readtable() somehow interprets these columns as numeric, and so converts all the strings and dates into NaNs – thus, I end up with 100% NaN-filled columns instead of rarely-populated data (among empty strings and NaTs).
Furthermore, if I move the "with-data" lines up – even a few dozens positions up – readtable() starts to read everything normally!
So, it looks like readtable() checks only ~250 first values to determine the type of the column, which, in my opinion, is a bug! (Although I understand that it was likely made to improve speed.)
Is there a way to fix it systematically? I have lots of such CSVs with thousands of columns in them – so, a manual check and manual fix is not an option…
UPD: a test-file (truncated to 510 lines) is attached – the behaviour is still the same. The problem columns are the 2nd and the 3rd (p190, p191). The first non-empty value is on data-line 270. I am reading a big CSV file (500K lines) with readtable. In the CSV, some columns have the first 250+ lines empty (e.g. ",,,," in the CSV), while the non-missing values below (pretty rare) are either text strings or dates (in the DD-MM-YYYY format). Readtable() somehow interprets these columns as numeric, and so converts all the strings and dates into NaNs – thus, I end up with 100% NaN-filled columns instead of rarely-populated data (among empty strings and NaTs).
Furthermore, if I move the "with-data" lines up – even a few dozens positions up – readtable() starts to read everything normally!
So, it looks like readtable() checks only ~250 first values to determine the type of the column, which, in my opinion, is a bug! (Although I understand that it was likely made to improve speed.)
Is there a way to fix it systematically? I have lots of such CSVs with thousands of columns in them – so, a manual check and manual fix is not an option…
UPD: a test-file (truncated to 510 lines) is attached – the behaviour is still the same. The problem columns are the 2nd and the 3rd (p190, p191). The first non-empty value is on data-line 270. readtable, missing values, csv MATLAB Answers — New Questions
How to add labels to lines on a plot in MATLAB?
When there are a lot of lines on a plot, it can be difficult to use a legend to distinguish individual lines. How can I label individual lines on a plot in MATLAB?When there are a lot of lines on a plot, it can be difficult to use a legend to distinguish individual lines. How can I label individual lines on a plot in MATLAB? When there are a lot of lines on a plot, it can be difficult to use a legend to distinguish individual lines. How can I label individual lines on a plot in MATLAB? legend, line, label, text, annotation MATLAB Answers — New Questions
Change configurations of the WLAN HDL examples of transmitter and receiver
Dear all,
I am recently trying to use the WLAN examples of the wireless HDL toolbox:
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdltransmitter.html
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdlreceiver.html
In these two examples of transmitter and receiver, it seems to support 802.11a/n/ac.
For instance, I would like to use 802.11n, then these should be selected:
HT: switched by "frameFormat"?
ODFM only: How to select?
MCS: which one should be select?
For 20 MHz channel bandwidth, which clock rare should be used in FPGA to drive the HDL codes?
ADC bit width: It seems to be 32 bit by default. How can I change to other bit width?
If I would like to use other than a/n/ac, how can I do?
For such kinds of the configurations or so, I would appreciate if anyone can instruct me how to change them before generating HDL.
Thank you in advance.Dear all,
I am recently trying to use the WLAN examples of the wireless HDL toolbox:
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdltransmitter.html
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdlreceiver.html
In these two examples of transmitter and receiver, it seems to support 802.11a/n/ac.
For instance, I would like to use 802.11n, then these should be selected:
HT: switched by "frameFormat"?
ODFM only: How to select?
MCS: which one should be select?
For 20 MHz channel bandwidth, which clock rare should be used in FPGA to drive the HDL codes?
ADC bit width: It seems to be 32 bit by default. How can I change to other bit width?
If I would like to use other than a/n/ac, how can I do?
For such kinds of the configurations or so, I would appreciate if anyone can instruct me how to change them before generating HDL.
Thank you in advance. Dear all,
I am recently trying to use the WLAN examples of the wireless HDL toolbox:
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdltransmitter.html
https://jp.mathworks.com/help/wireless-hdl/ug/wlanhdlreceiver.html
In these two examples of transmitter and receiver, it seems to support 802.11a/n/ac.
For instance, I would like to use 802.11n, then these should be selected:
HT: switched by "frameFormat"?
ODFM only: How to select?
MCS: which one should be select?
For 20 MHz channel bandwidth, which clock rare should be used in FPGA to drive the HDL codes?
ADC bit width: It seems to be 32 bit by default. How can I change to other bit width?
If I would like to use other than a/n/ac, how can I do?
For such kinds of the configurations or so, I would appreciate if anyone can instruct me how to change them before generating HDL.
Thank you in advance. wlan, wireless, hdl, simulink, matlab MATLAB Answers — New Questions
How to align multiline label and legend?
Hello
Using sprintf it is possible to create multiline labels in a legend. However, as shown in the example below, it would be better if the legend symbol (the colored line) would always be aligned with the first line of the multiline label, so aligned on top instead of being centered. The current output looks a bit confusing. Is it possible to control the position of the legend symbol w.r.t. the label?
Thanks in advance.
x=1:5;
y1=x;
y2=x.^2;
y3=x.^3;
plot(x,y1)
hold on
plot(x,y2)
plot(x,y3)
legend({‘first graph $y=x$’, sprintf(‘%sn%s’, ‘second graph’, ‘$y=x^2$’), sprintf(‘%sn%s’, ‘third graph’, ‘$y=x^3$’)}, ‘Interpreter’, ‘latex’)Hello
Using sprintf it is possible to create multiline labels in a legend. However, as shown in the example below, it would be better if the legend symbol (the colored line) would always be aligned with the first line of the multiline label, so aligned on top instead of being centered. The current output looks a bit confusing. Is it possible to control the position of the legend symbol w.r.t. the label?
Thanks in advance.
x=1:5;
y1=x;
y2=x.^2;
y3=x.^3;
plot(x,y1)
hold on
plot(x,y2)
plot(x,y3)
legend({‘first graph $y=x$’, sprintf(‘%sn%s’, ‘second graph’, ‘$y=x^2$’), sprintf(‘%sn%s’, ‘third graph’, ‘$y=x^3$’)}, ‘Interpreter’, ‘latex’) Hello
Using sprintf it is possible to create multiline labels in a legend. However, as shown in the example below, it would be better if the legend symbol (the colored line) would always be aligned with the first line of the multiline label, so aligned on top instead of being centered. The current output looks a bit confusing. Is it possible to control the position of the legend symbol w.r.t. the label?
Thanks in advance.
x=1:5;
y1=x;
y2=x.^2;
y3=x.^3;
plot(x,y1)
hold on
plot(x,y2)
plot(x,y3)
legend({‘first graph $y=x$’, sprintf(‘%sn%s’, ‘second graph’, ‘$y=x^2$’), sprintf(‘%sn%s’, ‘third graph’, ‘$y=x^3$’)}, ‘Interpreter’, ‘latex’) legend, multiline, align MATLAB Answers — New Questions
Why don’t gain and phase margins appear on my Bode plot?
I have discrete-time frequency response data in the form of a "frd" object. When I try to show the gain and phase margins associated with this data using the "bodeplot" function, these gain and phase margins do not appear on the plot. What am I missing?I have discrete-time frequency response data in the form of a "frd" object. When I try to show the gain and phase margins associated with this data using the "bodeplot" function, these gain and phase margins do not appear on the plot. What am I missing? I have discrete-time frequency response data in the form of a "frd" object. When I try to show the gain and phase margins associated with this data using the "bodeplot" function, these gain and phase margins do not appear on the plot. What am I missing? bodeplot, margin MATLAB Answers — New Questions
error “Error in untitled (line 9)”
I’m trying to run the following code, byt I have the error "Error in untitled (line 9) [t,x]=ode45(‘prob’,tspan,x0);" .
Why is that happening? Can anyone help me, please? Thank you!
%Numerical Solutions
%Problem #57
clc
clear
close all
%Numerical Solution
x0=[0;0];
tspan=[0 15];
[t,x]=ode45(‘prob’,tspan,x0);
figure(1)
plot(t,x(:,1));
title(‘Problem #57’);
xlabel(‘Time, sec.’);
ylabel(‘Displacement, m’);
hold on
%Analytical Solution
m=100;
c=20;
k=1000;
F=30;
w=sqrt(k/m);
d=c/(2*w*m);
wd=w*sqrt(1-d^2);
to=1;
phi=atan(d/sqrt(1-d^2));
%for t<to
t=linspace(0,1,3);
x=0.*t;
plot(t,x,’*’);
%for t>=to
t=linspace(1,15);
x=F/k-F/(k*sqrt(1-d^2)).*exp(-d.*w.*(t-to)).*cos(wd.*(t-to)-phi);
plot(t,x,’*’);
legend(‘Numerical’, ‘Analytical’)
%M-file for Prob #50
function dx=prob(t,x)
[rows, cols]=size(x);dx=zeros(rows, cols);
m=100;
c=20;
k=1000;
F=30;
if t<1
dx=0;
else
dx(1)=x(2);
dx(2)=-c/m*x(2) – k/m*x(1) + F/m;
end
endI’m trying to run the following code, byt I have the error "Error in untitled (line 9) [t,x]=ode45(‘prob’,tspan,x0);" .
Why is that happening? Can anyone help me, please? Thank you!
%Numerical Solutions
%Problem #57
clc
clear
close all
%Numerical Solution
x0=[0;0];
tspan=[0 15];
[t,x]=ode45(‘prob’,tspan,x0);
figure(1)
plot(t,x(:,1));
title(‘Problem #57’);
xlabel(‘Time, sec.’);
ylabel(‘Displacement, m’);
hold on
%Analytical Solution
m=100;
c=20;
k=1000;
F=30;
w=sqrt(k/m);
d=c/(2*w*m);
wd=w*sqrt(1-d^2);
to=1;
phi=atan(d/sqrt(1-d^2));
%for t<to
t=linspace(0,1,3);
x=0.*t;
plot(t,x,’*’);
%for t>=to
t=linspace(1,15);
x=F/k-F/(k*sqrt(1-d^2)).*exp(-d.*w.*(t-to)).*cos(wd.*(t-to)-phi);
plot(t,x,’*’);
legend(‘Numerical’, ‘Analytical’)
%M-file for Prob #50
function dx=prob(t,x)
[rows, cols]=size(x);dx=zeros(rows, cols);
m=100;
c=20;
k=1000;
F=30;
if t<1
dx=0;
else
dx(1)=x(2);
dx(2)=-c/m*x(2) – k/m*x(1) + F/m;
end
end I’m trying to run the following code, byt I have the error "Error in untitled (line 9) [t,x]=ode45(‘prob’,tspan,x0);" .
Why is that happening? Can anyone help me, please? Thank you!
%Numerical Solutions
%Problem #57
clc
clear
close all
%Numerical Solution
x0=[0;0];
tspan=[0 15];
[t,x]=ode45(‘prob’,tspan,x0);
figure(1)
plot(t,x(:,1));
title(‘Problem #57’);
xlabel(‘Time, sec.’);
ylabel(‘Displacement, m’);
hold on
%Analytical Solution
m=100;
c=20;
k=1000;
F=30;
w=sqrt(k/m);
d=c/(2*w*m);
wd=w*sqrt(1-d^2);
to=1;
phi=atan(d/sqrt(1-d^2));
%for t<to
t=linspace(0,1,3);
x=0.*t;
plot(t,x,’*’);
%for t>=to
t=linspace(1,15);
x=F/k-F/(k*sqrt(1-d^2)).*exp(-d.*w.*(t-to)).*cos(wd.*(t-to)-phi);
plot(t,x,’*’);
legend(‘Numerical’, ‘Analytical’)
%M-file for Prob #50
function dx=prob(t,x)
[rows, cols]=size(x);dx=zeros(rows, cols);
m=100;
c=20;
k=1000;
F=30;
if t<1
dx=0;
else
dx(1)=x(2);
dx(2)=-c/m*x(2) – k/m*x(1) + F/m;
end
end error untitled MATLAB Answers — New Questions
Reading multiple sheets from an excel file
I have an excel spreadsheet and the data is seperated into a different sheet for each year but I want to have all of the years worth of data in one table so I was wondering what the best way to approach this is? Right now my code only gets the data from 2007 and thats it.
opt=detectImportOptions(‘BC1 2007-2020.xlsx’);
opt.VariableTypes(3)={‘double’};
BC1=readtable(‘BC1 2007-2020.xlsx’,opt);
BC1.Date=datetime(BC1{:,1},’InputFormat’,’dd/MM/yy HH:mm:ss’);
BC1=table2timetable(BC1);
plot(BC1.Date,BC1.WaterLevel_Meters);I have an excel spreadsheet and the data is seperated into a different sheet for each year but I want to have all of the years worth of data in one table so I was wondering what the best way to approach this is? Right now my code only gets the data from 2007 and thats it.
opt=detectImportOptions(‘BC1 2007-2020.xlsx’);
opt.VariableTypes(3)={‘double’};
BC1=readtable(‘BC1 2007-2020.xlsx’,opt);
BC1.Date=datetime(BC1{:,1},’InputFormat’,’dd/MM/yy HH:mm:ss’);
BC1=table2timetable(BC1);
plot(BC1.Date,BC1.WaterLevel_Meters); I have an excel spreadsheet and the data is seperated into a different sheet for each year but I want to have all of the years worth of data in one table so I was wondering what the best way to approach this is? Right now my code only gets the data from 2007 and thats it.
opt=detectImportOptions(‘BC1 2007-2020.xlsx’);
opt.VariableTypes(3)={‘double’};
BC1=readtable(‘BC1 2007-2020.xlsx’,opt);
BC1.Date=datetime(BC1{:,1},’InputFormat’,’dd/MM/yy HH:mm:ss’);
BC1=table2timetable(BC1);
plot(BC1.Date,BC1.WaterLevel_Meters); excel MATLAB Answers — New Questions