Author: PuTI
Read datastore with variables of mixed classes
I have a large datastore as a csv file. A couple of variables have occasional alphabetical letters (e.g., "C") mixed in with observations that are otherwise numerals. dsread reports errors as seen below. What steps allow me to read the datastore, correcting for occasional errors?
Are there methods to construct/define the datastore such that a read recognizes the letters?
Error using matlab.io.datastore.TabularTextDatastore/readData (line 78)
Unable to parse a "Numeric" field when reading row 81, field 16.
Actual Text: "C,27108,16,16,C"
Expected: A number or literal "NaN", "Inf". (possibly signed, case insensitive)
Error in matlab.io.datastore.TabularDatastore/read (line 174)
[t, info] = ds.readData();
Error in untitled (line 11)
dC = read(ds);
Caused by:
Reading the variable name ‘RET’ using format ‘%f’ from file:
‘C:UsersdbrownBoxBrown_CarldatarawDistributionsDaily_Returns_CRSP_S&P500_1962-2024.csv’
starting at offset 1787951.I have a large datastore as a csv file. A couple of variables have occasional alphabetical letters (e.g., "C") mixed in with observations that are otherwise numerals. dsread reports errors as seen below. What steps allow me to read the datastore, correcting for occasional errors?
Are there methods to construct/define the datastore such that a read recognizes the letters?
Error using matlab.io.datastore.TabularTextDatastore/readData (line 78)
Unable to parse a "Numeric" field when reading row 81, field 16.
Actual Text: "C,27108,16,16,C"
Expected: A number or literal "NaN", "Inf". (possibly signed, case insensitive)
Error in matlab.io.datastore.TabularDatastore/read (line 174)
[t, info] = ds.readData();
Error in untitled (line 11)
dC = read(ds);
Caused by:
Reading the variable name ‘RET’ using format ‘%f’ from file:
‘C:UsersdbrownBoxBrown_CarldatarawDistributionsDaily_Returns_CRSP_S&P500_1962-2024.csv’
starting at offset 1787951. I have a large datastore as a csv file. A couple of variables have occasional alphabetical letters (e.g., "C") mixed in with observations that are otherwise numerals. dsread reports errors as seen below. What steps allow me to read the datastore, correcting for occasional errors?
Are there methods to construct/define the datastore such that a read recognizes the letters?
Error using matlab.io.datastore.TabularTextDatastore/readData (line 78)
Unable to parse a "Numeric" field when reading row 81, field 16.
Actual Text: "C,27108,16,16,C"
Expected: A number or literal "NaN", "Inf". (possibly signed, case insensitive)
Error in matlab.io.datastore.TabularDatastore/read (line 174)
[t, info] = ds.readData();
Error in untitled (line 11)
dC = read(ds);
Caused by:
Reading the variable name ‘RET’ using format ‘%f’ from file:
‘C:UsersdbrownBoxBrown_CarldatarawDistributionsDaily_Returns_CRSP_S&P500_1962-2024.csv’
starting at offset 1787951. datastore, mixed class variables MATLAB Answers — New Questions
To apply Naive Bayes as weight calculater with ELM
Now, I want to implement Naive Bayes algorithm to calculate the weight metrices of ELM. Can some one help me to perform this and give me a code fro this in matlabNow, I want to implement Naive Bayes algorithm to calculate the weight metrices of ELM. Can some one help me to perform this and give me a code fro this in matlab Now, I want to implement Naive Bayes algorithm to calculate the weight metrices of ELM. Can some one help me to perform this and give me a code fro this in matlab naive bayes, elm MATLAB Answers — New Questions
how to evaluate the integral of the expression involving bessel functions.
I have the following expression which i need to find.
then how i can find the integration? here this k is vector which contain k0,k1,k2, and same d and e is also a vector which contain d1,d2,d3 and e1, e2 ,e3 . and is also given. Then how i can evaluate this integration.I have the following expression which i need to find.
then how i can find the integration? here this k is vector which contain k0,k1,k2, and same d and e is also a vector which contain d1,d2,d3 and e1, e2 ,e3 . and is also given. Then how i can evaluate this integration. I have the following expression which i need to find.
then how i can find the integration? here this k is vector which contain k0,k1,k2, and same d and e is also a vector which contain d1,d2,d3 and e1, e2 ,e3 . and is also given. Then how i can evaluate this integration. numerical integration MATLAB Answers — New Questions
How can I change the font size of MsgBox?
if f==0 || f <0
Message = sprintf(‘Serbestlik derecesi %dn DENGELEME YOK!!! ‘,f);
h = msgbox(Message,…
‘Dikkat’, ‘warn’);
endif f==0 || f <0
Message = sprintf(‘Serbestlik derecesi %dn DENGELEME YOK!!! ‘,f);
h = msgbox(Message,…
‘Dikkat’, ‘warn’);
end if f==0 || f <0
Message = sprintf(‘Serbestlik derecesi %dn DENGELEME YOK!!! ‘,f);
h = msgbox(Message,…
‘Dikkat’, ‘warn’);
end msgbox, fontsize, font, size MATLAB Answers — New Questions
sinus wave with chosen number of variating period
Hi,
I am trying to simulate a refractive index change in a medium, to do that I need to accurately model the evolution of said index with a sinusoidal function with variating period (see picture below for an exemple).
The function is written as n(z)=n0+n1*cos(phi(z)) (n being the index), with phi(z)=alpha/(z+beta), I would expect that fixing beta and calculating alpha for alpha=nT*2*pi*(zmax+beta) (with nT the number of period in the interval from z=0 to z=zmax) would give me a function with nT period but it does not, where did I go wrong?
ThanksHi,
I am trying to simulate a refractive index change in a medium, to do that I need to accurately model the evolution of said index with a sinusoidal function with variating period (see picture below for an exemple).
The function is written as n(z)=n0+n1*cos(phi(z)) (n being the index), with phi(z)=alpha/(z+beta), I would expect that fixing beta and calculating alpha for alpha=nT*2*pi*(zmax+beta) (with nT the number of period in the interval from z=0 to z=zmax) would give me a function with nT period but it does not, where did I go wrong?
Thanks Hi,
I am trying to simulate a refractive index change in a medium, to do that I need to accurately model the evolution of said index with a sinusoidal function with variating period (see picture below for an exemple).
The function is written as n(z)=n0+n1*cos(phi(z)) (n being the index), with phi(z)=alpha/(z+beta), I would expect that fixing beta and calculating alpha for alpha=nT*2*pi*(zmax+beta) (with nT the number of period in the interval from z=0 to z=zmax) would give me a function with nT period but it does not, where did I go wrong?
Thanks matlab, mathematics MATLAB Answers — New Questions
The export of MATLAB graphics may not be suitable for high-resolution screens
When I export an existing fig graph, its size does not match the content within the display interface.
Initially I found there is an error in HiDPI adaption.
My coumputer’s screen is in 200% scale. When I export the figure, the size seems to be double itself. As I halving the lenght or the width, it become normal.When I export an existing fig graph, its size does not match the content within the display interface.
Initially I found there is an error in HiDPI adaption.
My coumputer’s screen is in 200% scale. When I export the figure, the size seems to be double itself. As I halving the lenght or the width, it become normal. When I export an existing fig graph, its size does not match the content within the display interface.
Initially I found there is an error in HiDPI adaption.
My coumputer’s screen is in 200% scale. When I export the figure, the size seems to be double itself. As I halving the lenght or the width, it become normal. figure, export MATLAB Answers — New Questions
Issue with contourfm from Matlab 2024b
Hello,
I have to plot some data over these coordinates:
Until Matlab 2024a release I was able to correctly do it with contourfm through the code line:
contourfm(latPlot,lonPlot,data,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
From Matlab 2024b release, lat and lon are not accepted anymore and there is the need to create reference raster cells. Here the code for Matlab 2024b:
ax=worldmap([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))]);
RefCells=georefcells([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))],[size(latPlot)]);
contourfm(data,RefCells,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
hold on;
[C,h]=contourm(data,RefCells,CXanom(lp,1):StepLineAnom:CXanom(lp,2),’k’);
if isempty(C)
continue;
else
clm=clabelm(C,h,CXanom(lp,1):StepLineAnom:CXanom(lp,2));
for kk=1:numel(clm)
clm(kk).BackgroundColor=’none’;
clm(kk).FontWeight=’bold’;
clm(kk).Color=’k’;
end
for kk=1:numel(h.Children)
h.Children(kk).LineStyle=’:’;
end
end
plotm(BordersWorldHR(:,2),BordersWorldHR(:,1),’k’);
p=plotm(LatCC,LonCC,’xw’);
p.MarkerSize=8;
p.LineWidth=2;
p.MarkerEdgeColor=[0.96,0.96,0.96];
p.MarkerFaceColor=[0.96,0.96,0.96];
setm(ax,’FontSize’,10);
colormap(turbo);
hc=colorbar;
ylabel(hc,[‘TB Anomaly ‘,AMSUA_ch{ch},’ GHz (K)’]);
hc.FontSize=9;
hc.Ticks=CXanom(lp,1):(CXanom(lp,2)-CXanom(lp,1))/size(CMP1.(FN1),1):CXanom(lp,2);
hc.TickLabels=num2str(hc.Ticks’,’%.1f’);
clim(CXanom(lp,:));
hl=legend(p,’Min MSLP’);
hl.Location=’NorthWest’;
hl.FontSize=8;
hl.Color=[0.82,0.82,0.82];
set(gcf,’InvertHardCopy’,’off’);
What I get is the following:
but what I have to get is the following (made with pcolorm):
Can anyone help me to fix this issue? I attach both the data and the figures. Thanks.Hello,
I have to plot some data over these coordinates:
Until Matlab 2024a release I was able to correctly do it with contourfm through the code line:
contourfm(latPlot,lonPlot,data,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
From Matlab 2024b release, lat and lon are not accepted anymore and there is the need to create reference raster cells. Here the code for Matlab 2024b:
ax=worldmap([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))]);
RefCells=georefcells([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))],[size(latPlot)]);
contourfm(data,RefCells,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
hold on;
[C,h]=contourm(data,RefCells,CXanom(lp,1):StepLineAnom:CXanom(lp,2),’k’);
if isempty(C)
continue;
else
clm=clabelm(C,h,CXanom(lp,1):StepLineAnom:CXanom(lp,2));
for kk=1:numel(clm)
clm(kk).BackgroundColor=’none’;
clm(kk).FontWeight=’bold’;
clm(kk).Color=’k’;
end
for kk=1:numel(h.Children)
h.Children(kk).LineStyle=’:’;
end
end
plotm(BordersWorldHR(:,2),BordersWorldHR(:,1),’k’);
p=plotm(LatCC,LonCC,’xw’);
p.MarkerSize=8;
p.LineWidth=2;
p.MarkerEdgeColor=[0.96,0.96,0.96];
p.MarkerFaceColor=[0.96,0.96,0.96];
setm(ax,’FontSize’,10);
colormap(turbo);
hc=colorbar;
ylabel(hc,[‘TB Anomaly ‘,AMSUA_ch{ch},’ GHz (K)’]);
hc.FontSize=9;
hc.Ticks=CXanom(lp,1):(CXanom(lp,2)-CXanom(lp,1))/size(CMP1.(FN1),1):CXanom(lp,2);
hc.TickLabels=num2str(hc.Ticks’,’%.1f’);
clim(CXanom(lp,:));
hl=legend(p,’Min MSLP’);
hl.Location=’NorthWest’;
hl.FontSize=8;
hl.Color=[0.82,0.82,0.82];
set(gcf,’InvertHardCopy’,’off’);
What I get is the following:
but what I have to get is the following (made with pcolorm):
Can anyone help me to fix this issue? I attach both the data and the figures. Thanks. Hello,
I have to plot some data over these coordinates:
Until Matlab 2024a release I was able to correctly do it with contourfm through the code line:
contourfm(latPlot,lonPlot,data,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
From Matlab 2024b release, lat and lon are not accepted anymore and there is the need to create reference raster cells. Here the code for Matlab 2024b:
ax=worldmap([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))]);
RefCells=georefcells([min(latPlot(:)),max(latPlot(:))],[min(lonPlot(:)),max(lonPlot(:))],[size(latPlot)]);
contourfm(data,RefCells,CXanom(lp,1):0.125:CXanom(lp,2),’LineStyle’,’none’);
hold on;
[C,h]=contourm(data,RefCells,CXanom(lp,1):StepLineAnom:CXanom(lp,2),’k’);
if isempty(C)
continue;
else
clm=clabelm(C,h,CXanom(lp,1):StepLineAnom:CXanom(lp,2));
for kk=1:numel(clm)
clm(kk).BackgroundColor=’none’;
clm(kk).FontWeight=’bold’;
clm(kk).Color=’k’;
end
for kk=1:numel(h.Children)
h.Children(kk).LineStyle=’:’;
end
end
plotm(BordersWorldHR(:,2),BordersWorldHR(:,1),’k’);
p=plotm(LatCC,LonCC,’xw’);
p.MarkerSize=8;
p.LineWidth=2;
p.MarkerEdgeColor=[0.96,0.96,0.96];
p.MarkerFaceColor=[0.96,0.96,0.96];
setm(ax,’FontSize’,10);
colormap(turbo);
hc=colorbar;
ylabel(hc,[‘TB Anomaly ‘,AMSUA_ch{ch},’ GHz (K)’]);
hc.FontSize=9;
hc.Ticks=CXanom(lp,1):(CXanom(lp,2)-CXanom(lp,1))/size(CMP1.(FN1),1):CXanom(lp,2);
hc.TickLabels=num2str(hc.Ticks’,’%.1f’);
clim(CXanom(lp,:));
hl=legend(p,’Min MSLP’);
hl.Location=’NorthWest’;
hl.FontSize=8;
hl.Color=[0.82,0.82,0.82];
set(gcf,’InvertHardCopy’,’off’);
What I get is the following:
but what I have to get is the following (made with pcolorm):
Can anyone help me to fix this issue? I attach both the data and the figures. Thanks. contourfm MATLAB Answers — New Questions
N310 Target Platform not appearing in HDL Coder
I have been trying to follow the NI Targeting Workflow for IP Core generation for an USRP N310 SDR. I have installed Vivado and appended it to the system path, and have been successful in connecting with the SDR using the radioSetupWizard. In Simulink, using the SDRu Reciever block, I am successfully able to read data from the Rx channels of the radio, so there is no issue with the connectivity here.
However, when I try to use the HDL coder, it seems that the radio is not recognised. I can load the default fpga using sdruload, so I assume it’s not that I can’t access the fpga, but I cannot see it, nor any other NI radio (other than the E310 which appeared after running setupusrpe3xxrepositories;) as a target platform for the HDL coder.
I would expect to see this listed as USRP N310 as in the example, but it does not appear. I have tried uninstalling and reinstalling everything, so I am at a loss of how to proceed. Any help would be greatly appreciated.I have been trying to follow the NI Targeting Workflow for IP Core generation for an USRP N310 SDR. I have installed Vivado and appended it to the system path, and have been successful in connecting with the SDR using the radioSetupWizard. In Simulink, using the SDRu Reciever block, I am successfully able to read data from the Rx channels of the radio, so there is no issue with the connectivity here.
However, when I try to use the HDL coder, it seems that the radio is not recognised. I can load the default fpga using sdruload, so I assume it’s not that I can’t access the fpga, but I cannot see it, nor any other NI radio (other than the E310 which appeared after running setupusrpe3xxrepositories;) as a target platform for the HDL coder.
I would expect to see this listed as USRP N310 as in the example, but it does not appear. I have tried uninstalling and reinstalling everything, so I am at a loss of how to proceed. Any help would be greatly appreciated. I have been trying to follow the NI Targeting Workflow for IP Core generation for an USRP N310 SDR. I have installed Vivado and appended it to the system path, and have been successful in connecting with the SDR using the radioSetupWizard. In Simulink, using the SDRu Reciever block, I am successfully able to read data from the Rx channels of the radio, so there is no issue with the connectivity here.
However, when I try to use the HDL coder, it seems that the radio is not recognised. I can load the default fpga using sdruload, so I assume it’s not that I can’t access the fpga, but I cannot see it, nor any other NI radio (other than the E310 which appeared after running setupusrpe3xxrepositories;) as a target platform for the HDL coder.
I would expect to see this listed as USRP N310 as in the example, but it does not appear. I have tried uninstalling and reinstalling everything, so I am at a loss of how to proceed. Any help would be greatly appreciated. code generation, usrp, ip-core generation MATLAB Answers — New Questions
Output doesn’t display a value, just an empty space.
So, I’ve got 2 pulses (imp and S0) and their sum (Si). I’ve got to find minimum of sum (Si). And I approximate the sum with a polynome. I took derivatives (1-st and 2-nd order) of the sum and polynome.
I analyze derivatives, and decided to look for minimum of sum (Si), polynome and 2-nd derivatives.
But, in some cases the result is just empty, but size of variable is 1×999 double.
lb = -5;
ub = 15;
x_imp = linspace(lb, ub, 1001);
x = linspace(lb, ub, 1001);
imp = sech(x_imp);
S0 = sech(x-10);
imp1 = sech(x – 1);
S1 = 0.5 * (imp1 + S0);
xmin = -1;
xmax = 10;
% find inflection point Si
range_x = x(x>=xmin & x<=xmax);
range_S1 = S1(x>=xmin & x<=xmax);
MinPtsS1 = islocalmin(range_S1);
fprintf (‘x_S1 = %f , y_S1 = %f .n’, range_x(MinPtsS1), range_S1(MinPtsS1));
% polynom approximation pv
[p_S1, ~, mu] = polyfit(x, S1, 26);
pv_S1 = polyval (p_S1, x, [], mu);
% find inflection point of polynom pv
range_x = x(x>=xmin & x<=xmax);
range_pvS1 = pv_S1(x>=xmin & x<=xmax);
MinPts_pvS1 = islocalmin(range_pvS1);
fprintf(‘x_pvS1 = %f , y_pvS1 = %f .n’, range_x(MinPts_pvS1), range_pvS1(MinPts_pvS1));
% DIFF find inflection of diff2 Si, corresponding to inflection point of Si
dS1 = 20*diff (S1);
d2S1 = 10*diff(dS1);
range_x = x(x>=xmin & x<=xmin);
range_d2S1 = d2S1(x>=xmin & x<=xmin);
MinPts_d2S1 = islocalmin(range_d2S1);
fprintf(‘x_d2S1 = %f , y_d2S1 = %f .n’, range_x(MinPts_d2S1), range_d2S1(MinPts_d2S1));
% DIFF find inflection of diff2 polynom Si, corresponding to inflection point of Si
dpS1 = 20*diff(pv_S1);
dp2S1 = 20*diff(dpS1);
range_x = x(x>=xmin & x<=xmax);
range_dp2S1 = dp2S1(x>=xmin & x<=xmax);
MinPts_dp2S1 = islocalmin(range_dp2S1);
fprintf(‘x_dp2S1 = %f , y_dp2S1 = %f .n’, range_x(MinPts_dp2S1), range_dp2S1(MinPts_dp2S1));So, I’ve got 2 pulses (imp and S0) and their sum (Si). I’ve got to find minimum of sum (Si). And I approximate the sum with a polynome. I took derivatives (1-st and 2-nd order) of the sum and polynome.
I analyze derivatives, and decided to look for minimum of sum (Si), polynome and 2-nd derivatives.
But, in some cases the result is just empty, but size of variable is 1×999 double.
lb = -5;
ub = 15;
x_imp = linspace(lb, ub, 1001);
x = linspace(lb, ub, 1001);
imp = sech(x_imp);
S0 = sech(x-10);
imp1 = sech(x – 1);
S1 = 0.5 * (imp1 + S0);
xmin = -1;
xmax = 10;
% find inflection point Si
range_x = x(x>=xmin & x<=xmax);
range_S1 = S1(x>=xmin & x<=xmax);
MinPtsS1 = islocalmin(range_S1);
fprintf (‘x_S1 = %f , y_S1 = %f .n’, range_x(MinPtsS1), range_S1(MinPtsS1));
% polynom approximation pv
[p_S1, ~, mu] = polyfit(x, S1, 26);
pv_S1 = polyval (p_S1, x, [], mu);
% find inflection point of polynom pv
range_x = x(x>=xmin & x<=xmax);
range_pvS1 = pv_S1(x>=xmin & x<=xmax);
MinPts_pvS1 = islocalmin(range_pvS1);
fprintf(‘x_pvS1 = %f , y_pvS1 = %f .n’, range_x(MinPts_pvS1), range_pvS1(MinPts_pvS1));
% DIFF find inflection of diff2 Si, corresponding to inflection point of Si
dS1 = 20*diff (S1);
d2S1 = 10*diff(dS1);
range_x = x(x>=xmin & x<=xmin);
range_d2S1 = d2S1(x>=xmin & x<=xmin);
MinPts_d2S1 = islocalmin(range_d2S1);
fprintf(‘x_d2S1 = %f , y_d2S1 = %f .n’, range_x(MinPts_d2S1), range_d2S1(MinPts_d2S1));
% DIFF find inflection of diff2 polynom Si, corresponding to inflection point of Si
dpS1 = 20*diff(pv_S1);
dp2S1 = 20*diff(dpS1);
range_x = x(x>=xmin & x<=xmax);
range_dp2S1 = dp2S1(x>=xmin & x<=xmax);
MinPts_dp2S1 = islocalmin(range_dp2S1);
fprintf(‘x_dp2S1 = %f , y_dp2S1 = %f .n’, range_x(MinPts_dp2S1), range_dp2S1(MinPts_dp2S1)); So, I’ve got 2 pulses (imp and S0) and their sum (Si). I’ve got to find minimum of sum (Si). And I approximate the sum with a polynome. I took derivatives (1-st and 2-nd order) of the sum and polynome.
I analyze derivatives, and decided to look for minimum of sum (Si), polynome and 2-nd derivatives.
But, in some cases the result is just empty, but size of variable is 1×999 double.
lb = -5;
ub = 15;
x_imp = linspace(lb, ub, 1001);
x = linspace(lb, ub, 1001);
imp = sech(x_imp);
S0 = sech(x-10);
imp1 = sech(x – 1);
S1 = 0.5 * (imp1 + S0);
xmin = -1;
xmax = 10;
% find inflection point Si
range_x = x(x>=xmin & x<=xmax);
range_S1 = S1(x>=xmin & x<=xmax);
MinPtsS1 = islocalmin(range_S1);
fprintf (‘x_S1 = %f , y_S1 = %f .n’, range_x(MinPtsS1), range_S1(MinPtsS1));
% polynom approximation pv
[p_S1, ~, mu] = polyfit(x, S1, 26);
pv_S1 = polyval (p_S1, x, [], mu);
% find inflection point of polynom pv
range_x = x(x>=xmin & x<=xmax);
range_pvS1 = pv_S1(x>=xmin & x<=xmax);
MinPts_pvS1 = islocalmin(range_pvS1);
fprintf(‘x_pvS1 = %f , y_pvS1 = %f .n’, range_x(MinPts_pvS1), range_pvS1(MinPts_pvS1));
% DIFF find inflection of diff2 Si, corresponding to inflection point of Si
dS1 = 20*diff (S1);
d2S1 = 10*diff(dS1);
range_x = x(x>=xmin & x<=xmin);
range_d2S1 = d2S1(x>=xmin & x<=xmin);
MinPts_d2S1 = islocalmin(range_d2S1);
fprintf(‘x_d2S1 = %f , y_d2S1 = %f .n’, range_x(MinPts_d2S1), range_d2S1(MinPts_d2S1));
% DIFF find inflection of diff2 polynom Si, corresponding to inflection point of Si
dpS1 = 20*diff(pv_S1);
dp2S1 = 20*diff(dpS1);
range_x = x(x>=xmin & x<=xmax);
range_dp2S1 = dp2S1(x>=xmin & x<=xmax);
MinPts_dp2S1 = islocalmin(range_dp2S1);
fprintf(‘x_dp2S1 = %f , y_dp2S1 = %f .n’, range_x(MinPts_dp2S1), range_dp2S1(MinPts_dp2S1)); empty output, derivative, diff, polyval MATLAB Answers — New Questions
How to output STL format flie
I have a point matrix p whose size is 3×98065;the triangulation matrix t whose size is 3×196124 ;
How to output the data as a STL model.Thank you.I have a point matrix p whose size is 3×98065;the triangulation matrix t whose size is 3×196124 ;
How to output the data as a STL model.Thank you. I have a point matrix p whose size is 3×98065;the triangulation matrix t whose size is 3×196124 ;
How to output the data as a STL model.Thank you. output stl format flie, triangulation matrix, point matrix, export stl, write stl MATLAB Answers — New Questions
compute the inverse sine of the sine of 45 degrees and assign the answer in radians to a variable named a.
Where am I going wrong?Where am I going wrong? Where am I going wrong? inverse sine of the sine MATLAB Answers — New Questions
Tasks not appearing in task box during Simulink Onramp Desktop
Hello,
I have recently tried to do the Simulink Onramp through my desktop. The tasks are not appearing in the task region. Please see the image below.
As you can see, there are no tasks appearing where they should, pressing next does not make the next task appear.Hello,
I have recently tried to do the Simulink Onramp through my desktop. The tasks are not appearing in the task region. Please see the image below.
As you can see, there are no tasks appearing where they should, pressing next does not make the next task appear. Hello,
I have recently tried to do the Simulink Onramp through my desktop. The tasks are not appearing in the task region. Please see the image below.
As you can see, there are no tasks appearing where they should, pressing next does not make the next task appear. onramp, bug MATLAB Answers — New Questions
How can i use ltpda startup nowadays? I think in old version of matlab work but in 2023 it shows , it cant recognize, is there any solutions or options?
i want to use ltpda and then plist. But if i use it as ‘ltpda_startup’ , matlab cant recognize it and after that ‘plist’. In 2016 and 2017 version of matlab it worked. How can i fix it in 2023 version or is there any alternative solutions for it?i want to use ltpda and then plist. But if i use it as ‘ltpda_startup’ , matlab cant recognize it and after that ‘plist’. In 2016 and 2017 version of matlab it worked. How can i fix it in 2023 version or is there any alternative solutions for it? i want to use ltpda and then plist. But if i use it as ‘ltpda_startup’ , matlab cant recognize it and after that ‘plist’. In 2016 and 2017 version of matlab it worked. How can i fix it in 2023 version or is there any alternative solutions for it? image processing, ltpda MATLAB Answers — New Questions
How to convert color map into contour map?
I have a file of color map with known boundary coordinates and color bar scale either horizontal or vertical. How can we transform the color map into contour map, such that the value of contours expressed the same in the color bar values?I have a file of color map with known boundary coordinates and color bar scale either horizontal or vertical. How can we transform the color map into contour map, such that the value of contours expressed the same in the color bar values? I have a file of color map with known boundary coordinates and color bar scale either horizontal or vertical. How can we transform the color map into contour map, such that the value of contours expressed the same in the color bar values? colormap, contour map MATLAB Answers — New Questions
i need a simulink matlab model for transformer inrush current .
i need a matlab simulink model for 3 phase transformer which is at no – load. now when it is energized initially, it should take an inrush current in primary side of transformer.i need a matlab simulink model for 3 phase transformer which is at no – load. now when it is energized initially, it should take an inrush current in primary side of transformer. i need a matlab simulink model for 3 phase transformer which is at no – load. now when it is energized initially, it should take an inrush current in primary side of transformer. 3 phase transformer, inrush current MATLAB Answers — New Questions
i am trying to read excel file from D drive under name mirror1 to put values in app.EditData.Value it gives parse error.thanks alot
excelfilepath= ‘D:mirror1.xlsx’;
data =readtable(excelfilepath);
value=data{1,1};
app.EditField.Value = num2str(value);
end
what is wrong with code
it gives parse erorr
thanksexcelfilepath= ‘D:mirror1.xlsx’;
data =readtable(excelfilepath);
value=data{1,1};
app.EditField.Value = num2str(value);
end
what is wrong with code
it gives parse erorr
thanks excelfilepath= ‘D:mirror1.xlsx’;
data =readtable(excelfilepath);
value=data{1,1};
app.EditField.Value = num2str(value);
end
what is wrong with code
it gives parse erorr
thanks app designer, excel MATLAB Answers — New Questions
Interactively show polygon label on choropleth map
I need to map a polygon shapefile in a choropleth map and interactively show the name of the specific polygon on which I click with the mouse. The default data tool tip does not work for me because: (1) information gets displayed for each polygon vertex, while I need the information only when clicking in the inner part of the polygon; (2) apparently, the only information it can show are coordinates.
To give an idea of what I am after, I produce hereby a minimum working example. In the last line of this example, I add all polygon names via the text command, associating each polygon to a unique inner point. This determines the placement of the text. What I need, instead, is for such text to be displayed only for the single polygon on which I click with the mouse.
Any help would be greatly appreciated.
% Minimum working example
% pgn = shaperead(‘pgn.shp’);
% pts = shaperead(‘pts.shp’);
load(‘pgn.mat’)
load(‘pts.mat’)
colorgradient = parula(height(pgn));
cbarlim = [floor(min([pgn.MA1911])) ceil(max([pgn.MA1911]))];
symbpgn = makesymbolspec(‘Polygon’, …
{‘MA1911’, cbarlim, ‘FaceColor’, colorgradient});
mapshow(pgn,’SymbolSpec’,symbpgn);
disableDefaultInteractivity(gca) % This prevents polygon vertex coordinates from showing in the tooltip
ax = gca;
ax.CLim = cbarlim;
h = colorbar;
h.Label.String = ‘people’;
axis equal
axis off
hold on
text([pts.X]’,[pts.Y]’,{pts.UNIT}’) % This is what needs to become interactiveI need to map a polygon shapefile in a choropleth map and interactively show the name of the specific polygon on which I click with the mouse. The default data tool tip does not work for me because: (1) information gets displayed for each polygon vertex, while I need the information only when clicking in the inner part of the polygon; (2) apparently, the only information it can show are coordinates.
To give an idea of what I am after, I produce hereby a minimum working example. In the last line of this example, I add all polygon names via the text command, associating each polygon to a unique inner point. This determines the placement of the text. What I need, instead, is for such text to be displayed only for the single polygon on which I click with the mouse.
Any help would be greatly appreciated.
% Minimum working example
% pgn = shaperead(‘pgn.shp’);
% pts = shaperead(‘pts.shp’);
load(‘pgn.mat’)
load(‘pts.mat’)
colorgradient = parula(height(pgn));
cbarlim = [floor(min([pgn.MA1911])) ceil(max([pgn.MA1911]))];
symbpgn = makesymbolspec(‘Polygon’, …
{‘MA1911’, cbarlim, ‘FaceColor’, colorgradient});
mapshow(pgn,’SymbolSpec’,symbpgn);
disableDefaultInteractivity(gca) % This prevents polygon vertex coordinates from showing in the tooltip
ax = gca;
ax.CLim = cbarlim;
h = colorbar;
h.Label.String = ‘people’;
axis equal
axis off
hold on
text([pts.X]’,[pts.Y]’,{pts.UNIT}’) % This is what needs to become interactive I need to map a polygon shapefile in a choropleth map and interactively show the name of the specific polygon on which I click with the mouse. The default data tool tip does not work for me because: (1) information gets displayed for each polygon vertex, while I need the information only when clicking in the inner part of the polygon; (2) apparently, the only information it can show are coordinates.
To give an idea of what I am after, I produce hereby a minimum working example. In the last line of this example, I add all polygon names via the text command, associating each polygon to a unique inner point. This determines the placement of the text. What I need, instead, is for such text to be displayed only for the single polygon on which I click with the mouse.
Any help would be greatly appreciated.
% Minimum working example
% pgn = shaperead(‘pgn.shp’);
% pts = shaperead(‘pts.shp’);
load(‘pgn.mat’)
load(‘pts.mat’)
colorgradient = parula(height(pgn));
cbarlim = [floor(min([pgn.MA1911])) ceil(max([pgn.MA1911]))];
symbpgn = makesymbolspec(‘Polygon’, …
{‘MA1911’, cbarlim, ‘FaceColor’, colorgradient});
mapshow(pgn,’SymbolSpec’,symbpgn);
disableDefaultInteractivity(gca) % This prevents polygon vertex coordinates from showing in the tooltip
ax = gca;
ax.CLim = cbarlim;
h = colorbar;
h.Label.String = ‘people’;
axis equal
axis off
hold on
text([pts.X]’,[pts.Y]’,{pts.UNIT}’) % This is what needs to become interactive mapshow, tooltip MATLAB Answers — New Questions
I am trying to generate a plot for the 3x+1 problem for the seed 10^310 but i am unable to get the plot? Why
% Code for 3x+1 Problem
seed = 10^309; % Starting number
x = seed; % Initialize x with the seed
trajectory = x; % Store the trajectory
tic
while x ~= 1
if mod(x, 2) == 0 % Check if x is even
x = x / 2;
else % If x is odd
x = 3 * x + 1;
end
trajectory = [trajectory, x]; % Append x to trajectory
end
toc
% Plot the trajectory
figure;
plot(trajectory, ‘-o’, ‘LineWidth’, 1, ‘MarkerSize’, 5,’MarkerFaceColor’, ‘r’);
title(‘Plot of the Collatz Sequence for positive Seed 10^310’);
xlabel(‘Step’);
ylabel(‘Value’);
grid on;% Code for 3x+1 Problem
seed = 10^309; % Starting number
x = seed; % Initialize x with the seed
trajectory = x; % Store the trajectory
tic
while x ~= 1
if mod(x, 2) == 0 % Check if x is even
x = x / 2;
else % If x is odd
x = 3 * x + 1;
end
trajectory = [trajectory, x]; % Append x to trajectory
end
toc
% Plot the trajectory
figure;
plot(trajectory, ‘-o’, ‘LineWidth’, 1, ‘MarkerSize’, 5,’MarkerFaceColor’, ‘r’);
title(‘Plot of the Collatz Sequence for positive Seed 10^310’);
xlabel(‘Step’);
ylabel(‘Value’);
grid on; % Code for 3x+1 Problem
seed = 10^309; % Starting number
x = seed; % Initialize x with the seed
trajectory = x; % Store the trajectory
tic
while x ~= 1
if mod(x, 2) == 0 % Check if x is even
x = x / 2;
else % If x is odd
x = 3 * x + 1;
end
trajectory = [trajectory, x]; % Append x to trajectory
end
toc
% Plot the trajectory
figure;
plot(trajectory, ‘-o’, ‘LineWidth’, 1, ‘MarkerSize’, 5,’MarkerFaceColor’, ‘r’);
title(‘Plot of the Collatz Sequence for positive Seed 10^310’);
xlabel(‘Step’);
ylabel(‘Value’);
grid on; collatz conjecture, 3x +1 problem MATLAB Answers — New Questions
How can I add bulleted list in Matlab annotation textbox
I am trying to add a bulleted list in a Matlab annotation textbox. I’ve tried using LaTex commands but all I get is: Unable to interpret latex string, such as
str = ‘begin{itemized} item First Line item Second Line end{itemized}’;
figure;
ha = annotation(‘textbox’, [0.5 0.5 0.4 0.2], ‘Interpreter’, ‘latex’);
set(ha, ‘String’, str)
This is similar to the way you put a table in an annotated textbox:
<http://www.mathworks.com/matlabcentral/answers/99523-how-do-i-create-a-latex-table-in-a-matlab-text-box Latex Table>I am trying to add a bulleted list in a Matlab annotation textbox. I’ve tried using LaTex commands but all I get is: Unable to interpret latex string, such as
str = ‘begin{itemized} item First Line item Second Line end{itemized}’;
figure;
ha = annotation(‘textbox’, [0.5 0.5 0.4 0.2], ‘Interpreter’, ‘latex’);
set(ha, ‘String’, str)
This is similar to the way you put a table in an annotated textbox:
<http://www.mathworks.com/matlabcentral/answers/99523-how-do-i-create-a-latex-table-in-a-matlab-text-box Latex Table> I am trying to add a bulleted list in a Matlab annotation textbox. I’ve tried using LaTex commands but all I get is: Unable to interpret latex string, such as
str = ‘begin{itemized} item First Line item Second Line end{itemized}’;
figure;
ha = annotation(‘textbox’, [0.5 0.5 0.4 0.2], ‘Interpreter’, ‘latex’);
set(ha, ‘String’, str)
This is similar to the way you put a table in an annotated textbox:
<http://www.mathworks.com/matlabcentral/answers/99523-how-do-i-create-a-latex-table-in-a-matlab-text-box Latex Table> latex, bulleted list, annotation MATLAB Answers — New Questions
How to generate multiple output in Simulink with multiple input
Recently, in order to get more familiar with simulink, I tried to establish some easy simulink model(figure shown in the following), however, there is a wierd bug. I inserted a sine wave with different amplitude, equivalently, two inputs into the matlab function block. Intuitively, this testbench should gives two output, but my workspace window only showed one ! so I want to consult what kind of consideration that I miss, thanks for you guys answer this question!(attatched file is the code of function block )Recently, in order to get more familiar with simulink, I tried to establish some easy simulink model(figure shown in the following), however, there is a wierd bug. I inserted a sine wave with different amplitude, equivalently, two inputs into the matlab function block. Intuitively, this testbench should gives two output, but my workspace window only showed one ! so I want to consult what kind of consideration that I miss, thanks for you guys answer this question!(attatched file is the code of function block ) Recently, in order to get more familiar with simulink, I tried to establish some easy simulink model(figure shown in the following), however, there is a wierd bug. I inserted a sine wave with different amplitude, equivalently, two inputs into the matlab function block. Intuitively, this testbench should gives two output, but my workspace window only showed one ! so I want to consult what kind of consideration that I miss, thanks for you guys answer this question!(attatched file is the code of function block ) simulink MATLAB Answers — New Questions