Author: PuTI
How do I export data to a file?
Hello,
I’m getting out of memory errors when trying to copy a large dataset (9003×9003 double) using Ctrl+C with the intention of pasting it to Excel, even though I’ve increased the Java Heap memory to the maximum. The error window suggests copying portions (I’m not doing that with such a large dataset) or exporting the dataset to a file – how do I do that please? I would expect such an option in its right-click menu but it’s not there – i.e. let’s make the paid software as complicated as we can :)))
xlswrite leaves me with empty files, csvwrite with corrupt files – even though it’s plain data
Thank youHello,
I’m getting out of memory errors when trying to copy a large dataset (9003×9003 double) using Ctrl+C with the intention of pasting it to Excel, even though I’ve increased the Java Heap memory to the maximum. The error window suggests copying portions (I’m not doing that with such a large dataset) or exporting the dataset to a file – how do I do that please? I would expect such an option in its right-click menu but it’s not there – i.e. let’s make the paid software as complicated as we can :)))
xlswrite leaves me with empty files, csvwrite with corrupt files – even though it’s plain data
Thank you Hello,
I’m getting out of memory errors when trying to copy a large dataset (9003×9003 double) using Ctrl+C with the intention of pasting it to Excel, even though I’ve increased the Java Heap memory to the maximum. The error window suggests copying portions (I’m not doing that with such a large dataset) or exporting the dataset to a file – how do I do that please? I would expect such an option in its right-click menu but it’s not there – i.e. let’s make the paid software as complicated as we can :)))
xlswrite leaves me with empty files, csvwrite with corrupt files – even though it’s plain data
Thank you matlab, export, excel, memory MATLAB Answers — New Questions
Draw arrows between Simulink blocks…
I just want to add (dummy) bi-directional (and uni) thick arrows between Simulink blocks. No luck from ChatGPT either for R2024a.I just want to add (dummy) bi-directional (and uni) thick arrows between Simulink blocks. No luck from ChatGPT either for R2024a. I just want to add (dummy) bi-directional (and uni) thick arrows between Simulink blocks. No luck from ChatGPT either for R2024a. arrows, add line MATLAB Answers — New Questions
Cell balancing Uniform for DTSC ?
I have make double tiered Switched capacitor Based Active cell balancing of lithium ion cells closed loop simulation and it’s working. But as I have to Connect Sum to lower soc among 3 from. What should I do to make it uniform ?
<</matlabcentral/answers/uploaded_files/1832378/IMG-20250420-WA0071.jpg>>I have make double tiered Switched capacitor Based Active cell balancing of lithium ion cells closed loop simulation and it’s working. But as I have to Connect Sum to lower soc among 3 from. What should I do to make it uniform ?
<</matlabcentral/answers/uploaded_files/1832378/IMG-20250420-WA0071.jpg>> I have make double tiered Switched capacitor Based Active cell balancing of lithium ion cells closed loop simulation and it’s working. But as I have to Connect Sum to lower soc among 3 from. What should I do to make it uniform ?
<</matlabcentral/answers/uploaded_files/1832378/IMG-20250420-WA0071.jpg>> #cellbalancing, #bms MATLAB Answers — New Questions
Heatmap and surf plot of same data is looking different. Also is there a better way to 2D smooth
Hello, I am trying to estimate the background of this image. One way I would like to try is to break the image up into small regions and take the minium value in each region and then peform a surface fit to these. The aim would be to then subtract this from my main image (one thing I definetly need is smoothness, i.e no sharp jumps between regions)
My raw image showing the regions
The min in each region is obtained via blockproc (data attached)
blockMin =
183.00 185.00 184.00 195.00 198.00 185.00 203.00
194.00 204.00 188.00 192.00 217.00 190.00 212.00
202.00 213.00 204.00 191.00 208.00 210.00 209.00
204.00 205.00 225.00 204.00 202.00 210.00 211.00
225.00 240.00 219.00 209.00 210.00 227.00 210.00
225.00 213.00 217.00 241.00 223.00 226.00 223.00
219.00 222.00 232.00 233.00 217.00 238.00 231.00
Very strangely, the heatmap and surf plot of the same data set is showing a difference (I know I must rotate the surf plot, but its clear the peak regions are in different positions (shown by green circles). On the heatmap, the value of 241 is on the 3rd row, yet on the surf plot its on the 2nd row and on the wrong column.
This is my code (Im showing the pure surf plot above, not the smoothdata2 version)
blockFwhm;
figure
h=heatmap(blockFwhm, ‘Colormap’,cool,’FontSize’,10); % app.PanelScan,
h.CellLabelFormat = ‘%.0f’;
figure
ax1=subplot(1,2,1); ax2=subplot(1,2,2);
surf(ax1,blockFwhm); colormap cool; colorbar
% Try to smotth the data *** Although this isn’t very good so
% far
B=smoothdata2(blockFwhm);
s=surf(ax2,B); colormap cool;Hello, I am trying to estimate the background of this image. One way I would like to try is to break the image up into small regions and take the minium value in each region and then peform a surface fit to these. The aim would be to then subtract this from my main image (one thing I definetly need is smoothness, i.e no sharp jumps between regions)
My raw image showing the regions
The min in each region is obtained via blockproc (data attached)
blockMin =
183.00 185.00 184.00 195.00 198.00 185.00 203.00
194.00 204.00 188.00 192.00 217.00 190.00 212.00
202.00 213.00 204.00 191.00 208.00 210.00 209.00
204.00 205.00 225.00 204.00 202.00 210.00 211.00
225.00 240.00 219.00 209.00 210.00 227.00 210.00
225.00 213.00 217.00 241.00 223.00 226.00 223.00
219.00 222.00 232.00 233.00 217.00 238.00 231.00
Very strangely, the heatmap and surf plot of the same data set is showing a difference (I know I must rotate the surf plot, but its clear the peak regions are in different positions (shown by green circles). On the heatmap, the value of 241 is on the 3rd row, yet on the surf plot its on the 2nd row and on the wrong column.
This is my code (Im showing the pure surf plot above, not the smoothdata2 version)
blockFwhm;
figure
h=heatmap(blockFwhm, ‘Colormap’,cool,’FontSize’,10); % app.PanelScan,
h.CellLabelFormat = ‘%.0f’;
figure
ax1=subplot(1,2,1); ax2=subplot(1,2,2);
surf(ax1,blockFwhm); colormap cool; colorbar
% Try to smotth the data *** Although this isn’t very good so
% far
B=smoothdata2(blockFwhm);
s=surf(ax2,B); colormap cool; Hello, I am trying to estimate the background of this image. One way I would like to try is to break the image up into small regions and take the minium value in each region and then peform a surface fit to these. The aim would be to then subtract this from my main image (one thing I definetly need is smoothness, i.e no sharp jumps between regions)
My raw image showing the regions
The min in each region is obtained via blockproc (data attached)
blockMin =
183.00 185.00 184.00 195.00 198.00 185.00 203.00
194.00 204.00 188.00 192.00 217.00 190.00 212.00
202.00 213.00 204.00 191.00 208.00 210.00 209.00
204.00 205.00 225.00 204.00 202.00 210.00 211.00
225.00 240.00 219.00 209.00 210.00 227.00 210.00
225.00 213.00 217.00 241.00 223.00 226.00 223.00
219.00 222.00 232.00 233.00 217.00 238.00 231.00
Very strangely, the heatmap and surf plot of the same data set is showing a difference (I know I must rotate the surf plot, but its clear the peak regions are in different positions (shown by green circles). On the heatmap, the value of 241 is on the 3rd row, yet on the surf plot its on the 2nd row and on the wrong column.
This is my code (Im showing the pure surf plot above, not the smoothdata2 version)
blockFwhm;
figure
h=heatmap(blockFwhm, ‘Colormap’,cool,’FontSize’,10); % app.PanelScan,
h.CellLabelFormat = ‘%.0f’;
figure
ax1=subplot(1,2,1); ax2=subplot(1,2,2);
surf(ax1,blockFwhm); colormap cool; colorbar
% Try to smotth the data *** Although this isn’t very good so
% far
B=smoothdata2(blockFwhm);
s=surf(ax2,B); colormap cool; image, heatmap, surf, smoothdata2 MATLAB Answers — New Questions
How to extract sphere from a tetrahedra 3D and meshing the rest???
I went to extract 3D sphere from tetrahedra and meshing the rest i do this code and i have error
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
axis equalI went to extract 3D sphere from tetrahedra and meshing the rest i do this code and i have error
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
axis equal I went to extract 3D sphere from tetrahedra and meshing the rest i do this code and i have error
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
axis equal sphere 3d MATLAB Answers — New Questions
I found a colormap problem with Matlab 2025a
Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’;Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’; Hei. I am beginner of Mablab, today (04/19/2025, helsinki time), I played around the Matlab 2025a )pre-release(, what i want to do was to visualize the ‘mpg’ dataset in R. The example figure is like below:
What i got with Matlab 2025a was like:
as youcan see, the coclor bar is looks strange. So, I swithched to Matlab 2024b with same script. And i got:
colormap is back to normal now. So, i was thinking some thing happends in Matlab2025a, which i don’t know.
Code (colormap from ‘200 colormap ‘ add-on):
mpg = readtable(‘mpg.csv’);
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height];
% we need transfor the class column as catereory variable
mpg.class = categorical(mpg.class);
fig = figure;
fig.Position = [100, 100, 800, 300]; % [left, bottom, width, height]
clp = slanCM("538",7);
t = tiledlayout(1,2);
ax1 = nexttile;
scatter(mpg.displ,mpg.hwy,[],mpg.class,’filled’)
colormap(clp);
colorbar(‘TickLabels’, cellstr(unique(mpg.class)));
ax2 = nexttile;
gscatter(mpg.displ,mpg.hwy,mpg.class,[],’+o*.xsd’)
legend(‘Location’,’eastoutside’)
axs = [ax1;ax2];
for i = 1:2
set(axs(i), ‘FontSize’, 12, ‘FontName’, ‘Times New Roman’);
axs(i).XLim = [0 8];
grid(axs(i),’on’)
end
t.TileSpacing = ‘compact’;
t.XLabel.String = ‘Disp’;
t.YLabel.String = ‘Hwy’;
t.XLabel.FontName = ‘Times New Roman’;
t.YLabel.FontName = ‘Times New Roman’; 2025a, pre-release, plot, scatter, colorer MATLAB Answers — New Questions
How to change composite three phase port to expandable three phase port in BLDC model of simscape electrical with the Matlab 2022b version?
How to change composite three phase port to expandable three phase port in BLDC model of simscape electrical with the Matlab 2022b version?
I have searcher extensively and was not able to do it. can someone please help me? Thanks in advace!!How to change composite three phase port to expandable three phase port in BLDC model of simscape electrical with the Matlab 2022b version?
I have searcher extensively and was not able to do it. can someone please help me? Thanks in advace!! How to change composite three phase port to expandable three phase port in BLDC model of simscape electrical with the Matlab 2022b version?
I have searcher extensively and was not able to do it. can someone please help me? Thanks in advace!! bldc model ports MATLAB Answers — New Questions
Failed to run matlab gui in Fedora 42
os: Fedora 42
DE: KDE Plasma 6.3.4
WM: KWin (Wayland)
Kernel: Linux 6.14.2-300.fc42.x86_64
Everything works well in Fedora 41, but I cannot run matlab After upgrading to Fedora 42. And get the output below.
MATLAB is selecting SOFTWARE rendering.
Unable to communicate with required MathWorks services (error 5201).
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5201
I have read this Why do I receive Error 5201 – Unable to access services required to run MATLAB, reinstalled MathWorksServiceHost and reboot my computer. Those cannot solve. The autostart script of Mathworks Service Host always crash. See the output below:os: Fedora 42
DE: KDE Plasma 6.3.4
WM: KWin (Wayland)
Kernel: Linux 6.14.2-300.fc42.x86_64
Everything works well in Fedora 41, but I cannot run matlab After upgrading to Fedora 42. And get the output below.
MATLAB is selecting SOFTWARE rendering.
Unable to communicate with required MathWorks services (error 5201).
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5201
I have read this Why do I receive Error 5201 – Unable to access services required to run MATLAB, reinstalled MathWorksServiceHost and reboot my computer. Those cannot solve. The autostart script of Mathworks Service Host always crash. See the output below: os: Fedora 42
DE: KDE Plasma 6.3.4
WM: KWin (Wayland)
Kernel: Linux 6.14.2-300.fc42.x86_64
Everything works well in Fedora 41, but I cannot run matlab After upgrading to Fedora 42. And get the output below.
MATLAB is selecting SOFTWARE rendering.
Unable to communicate with required MathWorks services (error 5201).
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/5201
I have read this Why do I receive Error 5201 – Unable to access services required to run MATLAB, reinstalled MathWorksServiceHost and reboot my computer. Those cannot solve. The autostart script of Mathworks Service Host always crash. See the output below: matlab, matlab gui MATLAB Answers — New Questions
How to use both mean and standard deviation/variance of each data to build a surrogate model?
I have the following data coming from a stochastic experiment. I ran the experiment for 10 times for each x and tabulated the mean and standard deviations. How can I use both the mean and standard deviation to train a surrogate model? I tried using fitrgp but it does not take standard deviations. I could use sigma, but it takes a scaler value, not a vector.
x = [5; 7; 9; 11; 13];
mean_output= [103.78; 108.84; 117.68; 109.57; 72.26];
std_output = [4.20; 3.44; 4.25; 10.09; 10.71];
gprModels = fitrgp(x, mean_output, …
‘KernelFunction’, ‘squaredexponential’, …
‘BasisFunction’, ‘constant’, …
‘FitMethod’, ‘exact’, …
‘PredictMethod’, ‘exact’)I have the following data coming from a stochastic experiment. I ran the experiment for 10 times for each x and tabulated the mean and standard deviations. How can I use both the mean and standard deviation to train a surrogate model? I tried using fitrgp but it does not take standard deviations. I could use sigma, but it takes a scaler value, not a vector.
x = [5; 7; 9; 11; 13];
mean_output= [103.78; 108.84; 117.68; 109.57; 72.26];
std_output = [4.20; 3.44; 4.25; 10.09; 10.71];
gprModels = fitrgp(x, mean_output, …
‘KernelFunction’, ‘squaredexponential’, …
‘BasisFunction’, ‘constant’, …
‘FitMethod’, ‘exact’, …
‘PredictMethod’, ‘exact’) I have the following data coming from a stochastic experiment. I ran the experiment for 10 times for each x and tabulated the mean and standard deviations. How can I use both the mean and standard deviation to train a surrogate model? I tried using fitrgp but it does not take standard deviations. I could use sigma, but it takes a scaler value, not a vector.
x = [5; 7; 9; 11; 13];
mean_output= [103.78; 108.84; 117.68; 109.57; 72.26];
std_output = [4.20; 3.44; 4.25; 10.09; 10.71];
gprModels = fitrgp(x, mean_output, …
‘KernelFunction’, ‘squaredexponential’, …
‘BasisFunction’, ‘constant’, …
‘FitMethod’, ‘exact’, …
‘PredictMethod’, ‘exact’) surrogate, fitrgp MATLAB Answers — New Questions
Plot solution of pde toolbox on a line (or submanifold)
I’m using the pde toolbox to solve a certain elliptic equation in 2D.
Solution is fine, although I do need to plot it along a given line, i.e. to cut a planar slice from the 3D mesh representing the solution.
I can’t figure out a way that smartly involves the toolbox functions.
Any help appreciated.I’m using the pde toolbox to solve a certain elliptic equation in 2D.
Solution is fine, although I do need to plot it along a given line, i.e. to cut a planar slice from the 3D mesh representing the solution.
I can’t figure out a way that smartly involves the toolbox functions.
Any help appreciated. I’m using the pde toolbox to solve a certain elliptic equation in 2D.
Solution is fine, although I do need to plot it along a given line, i.e. to cut a planar slice from the 3D mesh representing the solution.
I can’t figure out a way that smartly involves the toolbox functions.
Any help appreciated. pde toolbox, plot, pde, plotting MATLAB Answers — New Questions
GPU Recommendation for XGBoost with MATLAB R2022b
Hi,
I’m currently planning to use XGBoost with GPU acceleration, mainly for parameter optimization. Right now, I’m performing leave-one-out cross-validation, and my feature dimensions are around 1000.
I haven’t purchased a GPU yet, but I’m considering either:
GeForce RTX 5060 Ti (though I couldn’t find its compute capability listed on the official NVIDIA site: https://developer.nvidia.com/cuda-gpus), or
GeForce RTX 4070 Ti, which has a compute capability of 8.9.
I’m using MATLAB R2022b, and according to the documentation, "MATLAB® supports NVIDIA® GPU architectures with compute capability 3.5 to 8.x."
Could anyone clarify whether either (or both) of these GPUs would be supported? Or perhaps suggest an alternative GPU that would work well with my setup?
Thanks in advance!Hi,
I’m currently planning to use XGBoost with GPU acceleration, mainly for parameter optimization. Right now, I’m performing leave-one-out cross-validation, and my feature dimensions are around 1000.
I haven’t purchased a GPU yet, but I’m considering either:
GeForce RTX 5060 Ti (though I couldn’t find its compute capability listed on the official NVIDIA site: https://developer.nvidia.com/cuda-gpus), or
GeForce RTX 4070 Ti, which has a compute capability of 8.9.
I’m using MATLAB R2022b, and according to the documentation, "MATLAB® supports NVIDIA® GPU architectures with compute capability 3.5 to 8.x."
Could anyone clarify whether either (or both) of these GPUs would be supported? Or perhaps suggest an alternative GPU that would work well with my setup?
Thanks in advance! Hi,
I’m currently planning to use XGBoost with GPU acceleration, mainly for parameter optimization. Right now, I’m performing leave-one-out cross-validation, and my feature dimensions are around 1000.
I haven’t purchased a GPU yet, but I’m considering either:
GeForce RTX 5060 Ti (though I couldn’t find its compute capability listed on the official NVIDIA site: https://developer.nvidia.com/cuda-gpus), or
GeForce RTX 4070 Ti, which has a compute capability of 8.9.
I’m using MATLAB R2022b, and according to the documentation, "MATLAB® supports NVIDIA® GPU architectures with compute capability 3.5 to 8.x."
Could anyone clarify whether either (or both) of these GPUs would be supported? Or perhaps suggest an alternative GPU that would work well with my setup?
Thanks in advance! matlab, gpu, xgboost, r2022b MATLAB Answers — New Questions
How to paste matlab table into Excel with headers
Hi,
I have a table in Matlab with many rows. I can copy from Matlab and paste into Excel.
But the headers are gone. How to copy the headers into Excel as well?
Thanks for any help.
JZHi,
I have a table in Matlab with many rows. I can copy from Matlab and paste into Excel.
But the headers are gone. How to copy the headers into Excel as well?
Thanks for any help.
JZ Hi,
I have a table in Matlab with many rows. I can copy from Matlab and paste into Excel.
But the headers are gone. How to copy the headers into Excel as well?
Thanks for any help.
JZ matlab MATLAB Answers — New Questions
I’m new to matlab i want to estimate kinetic parameter from experimental data.
I have substrate concentration, biomass concentration and production concentration as a function of time now i want to fit logistic model, using curve fit tool. Can anyone pls help to use the curve fit tool to kinetic parametersI have substrate concentration, biomass concentration and production concentration as a function of time now i want to fit logistic model, using curve fit tool. Can anyone pls help to use the curve fit tool to kinetic parameters I have substrate concentration, biomass concentration and production concentration as a function of time now i want to fit logistic model, using curve fit tool. Can anyone pls help to use the curve fit tool to kinetic parameters cfit MATLAB Answers — New Questions
Is there any kind of firewall models and networking add-on available in simulink?
I am modelling a cyber-physical system. However, I want to verify the cyber properties of my system. I wonder if there is any networking add on, ethernet channel. whcih just model the networking components of my system like firewall, router etc.I am modelling a cyber-physical system. However, I want to verify the cyber properties of my system. I wonder if there is any networking add on, ethernet channel. whcih just model the networking components of my system like firewall, router etc. I am modelling a cyber-physical system. However, I want to verify the cyber properties of my system. I wonder if there is any networking add on, ethernet channel. whcih just model the networking components of my system like firewall, router etc. simulink, cyber physical system MATLAB Answers — New Questions
ERA5 average hourly data and yearly data
I have data netcdf from ERA hourly, i choose 1940-2024 for all of days ech month and also because of value of data i consider just 4 hours 0:00, 6:00, 12:00, 18:00 for every grid point and my parameters are u10 & v10. my goal is to have in a map average time series that compute total days we have wind speed more than 15 m/s, and we khnow that wind speed = sqrt (u^2+v^2),
my data time is for example for jan is as 1940-01-01-0:00, 1940-01-01-6:00, ….., 2024-01-31-18:00. i need atfirst get average hourly to be daily data for every grid point every year and than compute for every grid point total days have wind speed more than 15 m/s , and after that for every grid point compute average 85 yerly to show on the map , please guide me
my code is
clear
clc
year = 1940:2024;
filename1 = ‘uv1.nc’;filename2 = ‘uv2.nc’;filename3 = ‘uv3.nc’;filename4 = ‘uv4.nc’;filename5 = ‘uv5.nc’;filename6 = ‘uv6.nc’;
filename7 = ‘uv7.nc’;filename8 = ‘uv8.nc’;filename9 = ‘uv9.nc’;filename10 = ‘uv10.nc’;filename11 = ‘uv11.nc’;filename12 = ‘uv12.nc’;
u1 = ncread(filename1, ‘u10’);u2 = ncread(filename2, ‘u10’);u3 = ncread(filename3, ‘u10’);u4 = ncread(filename4, ‘u10’);
u5 = ncread(filename5, ‘u10’);u6 = ncread(filename6, ‘u10’);u7 = ncread(filename7, ‘u10’);u8 = ncread(filename8, ‘u10’);
u9 = ncread(filename9, ‘u10’);u10 = ncread(filename10, ‘u10’);u11 = ncread(filename11, ‘u10’);u12 = ncread(filename12, ‘u10’);
v1 = ncread(filename1, ‘v10’);v2 = ncread(filename2, ‘v10’);v3 = ncread(filename3, ‘v10’);v4 = ncread(filename4, ‘v10’);
v5 = ncread(filename5, ‘v10’);v6 = ncread(filename6, ‘v10’);v7 = ncread(filename7, ‘v10’);v8 = ncread(filename8, ‘v10’);
v9 = ncread(filename9, ‘v10’);v10 = ncread(filename10, ‘v10’);v11 = ncread(filename11, ‘v10’); v12 = ncread(filename12, ‘v10’);
time1 = double(ncread(filename1, ‘valid_time’));time2 = double(ncread(filename2, ‘valid_time’));time3 = double(ncread(filename3, ‘valid_time’));
time4 = double(ncread(filename4, ‘valid_time’));time5 = double(ncread(filename5, ‘valid_time’));time6 = double(ncread(filename6, ‘valid_time’));
time7 = double(ncread(filename7, ‘valid_time’));time8 = double(ncread(filename8, ‘valid_time’));time9 = double(ncread(filename9, ‘valid_time’));
time10 = double(ncread(filename10, ‘valid_time’));time11 = double(ncread(filename11, ‘valid_time’));time12 = double(ncread(filename12, ‘valid_time’));
lat = double(ncread(filename1,’latitude’));lon = double(ncread(filename1,’longitude’));[Lat,Lon] = meshgrid(lat,lon);
% % compute land-sea mask and wind speed for every month Jan to dec
land = island(Lat,Lon);
ws1 = sqrt(u1.^2 + v1.^2);ws2 = sqrt(u2.^2 + v2.^2);ws3 = sqrt(u3.^2 + v3.^2);ws4 = sqrt(u4.^2 + v4.^2);
ws5 = sqrt(u5.^2 + v5.^2);ws6 = sqrt(u6.^2 + v6.^2);ws7 = sqrt(u7.^2 + v7.^2);ws8 = sqrt(u8.^2 + v8.^2);
ws9 = sqrt(u9.^2 + v9.^2);ws10 = sqrt(u10.^2 + v10.^2);ws11 = sqrt(u11.^2 + v11.^2);ws12 = sqrt(u12.^2 + v12.^2);
ws1(land==0)=NaN;ws2(land==0)=NaN;ws3(land==0)=NaN;ws4(land==0)=NaN;ws5(land==0)=NaN;ws6(land==0)=NaN;
ws7(land==0)=NaN;ws8(land==0)=NaN;ws9(land==0)=NaN;ws10(land==0)=NaN;ws11(land==0)=NaN;ws12(land==0)=NaN;I have data netcdf from ERA hourly, i choose 1940-2024 for all of days ech month and also because of value of data i consider just 4 hours 0:00, 6:00, 12:00, 18:00 for every grid point and my parameters are u10 & v10. my goal is to have in a map average time series that compute total days we have wind speed more than 15 m/s, and we khnow that wind speed = sqrt (u^2+v^2),
my data time is for example for jan is as 1940-01-01-0:00, 1940-01-01-6:00, ….., 2024-01-31-18:00. i need atfirst get average hourly to be daily data for every grid point every year and than compute for every grid point total days have wind speed more than 15 m/s , and after that for every grid point compute average 85 yerly to show on the map , please guide me
my code is
clear
clc
year = 1940:2024;
filename1 = ‘uv1.nc’;filename2 = ‘uv2.nc’;filename3 = ‘uv3.nc’;filename4 = ‘uv4.nc’;filename5 = ‘uv5.nc’;filename6 = ‘uv6.nc’;
filename7 = ‘uv7.nc’;filename8 = ‘uv8.nc’;filename9 = ‘uv9.nc’;filename10 = ‘uv10.nc’;filename11 = ‘uv11.nc’;filename12 = ‘uv12.nc’;
u1 = ncread(filename1, ‘u10’);u2 = ncread(filename2, ‘u10’);u3 = ncread(filename3, ‘u10’);u4 = ncread(filename4, ‘u10’);
u5 = ncread(filename5, ‘u10’);u6 = ncread(filename6, ‘u10’);u7 = ncread(filename7, ‘u10’);u8 = ncread(filename8, ‘u10’);
u9 = ncread(filename9, ‘u10’);u10 = ncread(filename10, ‘u10’);u11 = ncread(filename11, ‘u10’);u12 = ncread(filename12, ‘u10’);
v1 = ncread(filename1, ‘v10’);v2 = ncread(filename2, ‘v10’);v3 = ncread(filename3, ‘v10’);v4 = ncread(filename4, ‘v10’);
v5 = ncread(filename5, ‘v10’);v6 = ncread(filename6, ‘v10’);v7 = ncread(filename7, ‘v10’);v8 = ncread(filename8, ‘v10’);
v9 = ncread(filename9, ‘v10’);v10 = ncread(filename10, ‘v10’);v11 = ncread(filename11, ‘v10’); v12 = ncread(filename12, ‘v10’);
time1 = double(ncread(filename1, ‘valid_time’));time2 = double(ncread(filename2, ‘valid_time’));time3 = double(ncread(filename3, ‘valid_time’));
time4 = double(ncread(filename4, ‘valid_time’));time5 = double(ncread(filename5, ‘valid_time’));time6 = double(ncread(filename6, ‘valid_time’));
time7 = double(ncread(filename7, ‘valid_time’));time8 = double(ncread(filename8, ‘valid_time’));time9 = double(ncread(filename9, ‘valid_time’));
time10 = double(ncread(filename10, ‘valid_time’));time11 = double(ncread(filename11, ‘valid_time’));time12 = double(ncread(filename12, ‘valid_time’));
lat = double(ncread(filename1,’latitude’));lon = double(ncread(filename1,’longitude’));[Lat,Lon] = meshgrid(lat,lon);
% % compute land-sea mask and wind speed for every month Jan to dec
land = island(Lat,Lon);
ws1 = sqrt(u1.^2 + v1.^2);ws2 = sqrt(u2.^2 + v2.^2);ws3 = sqrt(u3.^2 + v3.^2);ws4 = sqrt(u4.^2 + v4.^2);
ws5 = sqrt(u5.^2 + v5.^2);ws6 = sqrt(u6.^2 + v6.^2);ws7 = sqrt(u7.^2 + v7.^2);ws8 = sqrt(u8.^2 + v8.^2);
ws9 = sqrt(u9.^2 + v9.^2);ws10 = sqrt(u10.^2 + v10.^2);ws11 = sqrt(u11.^2 + v11.^2);ws12 = sqrt(u12.^2 + v12.^2);
ws1(land==0)=NaN;ws2(land==0)=NaN;ws3(land==0)=NaN;ws4(land==0)=NaN;ws5(land==0)=NaN;ws6(land==0)=NaN;
ws7(land==0)=NaN;ws8(land==0)=NaN;ws9(land==0)=NaN;ws10(land==0)=NaN;ws11(land==0)=NaN;ws12(land==0)=NaN; I have data netcdf from ERA hourly, i choose 1940-2024 for all of days ech month and also because of value of data i consider just 4 hours 0:00, 6:00, 12:00, 18:00 for every grid point and my parameters are u10 & v10. my goal is to have in a map average time series that compute total days we have wind speed more than 15 m/s, and we khnow that wind speed = sqrt (u^2+v^2),
my data time is for example for jan is as 1940-01-01-0:00, 1940-01-01-6:00, ….., 2024-01-31-18:00. i need atfirst get average hourly to be daily data for every grid point every year and than compute for every grid point total days have wind speed more than 15 m/s , and after that for every grid point compute average 85 yerly to show on the map , please guide me
my code is
clear
clc
year = 1940:2024;
filename1 = ‘uv1.nc’;filename2 = ‘uv2.nc’;filename3 = ‘uv3.nc’;filename4 = ‘uv4.nc’;filename5 = ‘uv5.nc’;filename6 = ‘uv6.nc’;
filename7 = ‘uv7.nc’;filename8 = ‘uv8.nc’;filename9 = ‘uv9.nc’;filename10 = ‘uv10.nc’;filename11 = ‘uv11.nc’;filename12 = ‘uv12.nc’;
u1 = ncread(filename1, ‘u10’);u2 = ncread(filename2, ‘u10’);u3 = ncread(filename3, ‘u10’);u4 = ncread(filename4, ‘u10’);
u5 = ncread(filename5, ‘u10’);u6 = ncread(filename6, ‘u10’);u7 = ncread(filename7, ‘u10’);u8 = ncread(filename8, ‘u10’);
u9 = ncread(filename9, ‘u10’);u10 = ncread(filename10, ‘u10’);u11 = ncread(filename11, ‘u10’);u12 = ncread(filename12, ‘u10’);
v1 = ncread(filename1, ‘v10’);v2 = ncread(filename2, ‘v10’);v3 = ncread(filename3, ‘v10’);v4 = ncread(filename4, ‘v10’);
v5 = ncread(filename5, ‘v10’);v6 = ncread(filename6, ‘v10’);v7 = ncread(filename7, ‘v10’);v8 = ncread(filename8, ‘v10’);
v9 = ncread(filename9, ‘v10’);v10 = ncread(filename10, ‘v10’);v11 = ncread(filename11, ‘v10’); v12 = ncread(filename12, ‘v10’);
time1 = double(ncread(filename1, ‘valid_time’));time2 = double(ncread(filename2, ‘valid_time’));time3 = double(ncread(filename3, ‘valid_time’));
time4 = double(ncread(filename4, ‘valid_time’));time5 = double(ncread(filename5, ‘valid_time’));time6 = double(ncread(filename6, ‘valid_time’));
time7 = double(ncread(filename7, ‘valid_time’));time8 = double(ncread(filename8, ‘valid_time’));time9 = double(ncread(filename9, ‘valid_time’));
time10 = double(ncread(filename10, ‘valid_time’));time11 = double(ncread(filename11, ‘valid_time’));time12 = double(ncread(filename12, ‘valid_time’));
lat = double(ncread(filename1,’latitude’));lon = double(ncread(filename1,’longitude’));[Lat,Lon] = meshgrid(lat,lon);
% % compute land-sea mask and wind speed for every month Jan to dec
land = island(Lat,Lon);
ws1 = sqrt(u1.^2 + v1.^2);ws2 = sqrt(u2.^2 + v2.^2);ws3 = sqrt(u3.^2 + v3.^2);ws4 = sqrt(u4.^2 + v4.^2);
ws5 = sqrt(u5.^2 + v5.^2);ws6 = sqrt(u6.^2 + v6.^2);ws7 = sqrt(u7.^2 + v7.^2);ws8 = sqrt(u8.^2 + v8.^2);
ws9 = sqrt(u9.^2 + v9.^2);ws10 = sqrt(u10.^2 + v10.^2);ws11 = sqrt(u11.^2 + v11.^2);ws12 = sqrt(u12.^2 + v12.^2);
ws1(land==0)=NaN;ws2(land==0)=NaN;ws3(land==0)=NaN;ws4(land==0)=NaN;ws5(land==0)=NaN;ws6(land==0)=NaN;
ws7(land==0)=NaN;ws8(land==0)=NaN;ws9(land==0)=NaN;ws10(land==0)=NaN;ws11(land==0)=NaN;ws12(land==0)=NaN; netcdf, climate, stormy MATLAB Answers — New Questions
How do I request a return for a Student Version or Home Use License?
I purchased a Student Version or Home Use License from The MathWorks and would like to return the License for a full refund.
How do I return my MATLAB Student or Home Use License?I purchased a Student Version or Home Use License from The MathWorks and would like to return the License for a full refund.
How do I return my MATLAB Student or Home Use License? I purchased a Student Version or Home Use License from The MathWorks and would like to return the License for a full refund.
How do I return my MATLAB Student or Home Use License? MATLAB Answers — New Questions
integration tolerance has not met
Hi
I encountered an issue in implementing the growth rate of the tumor. In the following equation, both tumor carrying capacity and tumor volume are species
(d/dt)TumorVolume = r * TumorVolume * log(TumorCarryingCapacity/TumorVolume)
I received a message error that the integration tolerance has not met. I believe it is because tumor carrying capacity and tumor volume are species and they have to be that.
How would I solve this?
Appreciate your helpHi
I encountered an issue in implementing the growth rate of the tumor. In the following equation, both tumor carrying capacity and tumor volume are species
(d/dt)TumorVolume = r * TumorVolume * log(TumorCarryingCapacity/TumorVolume)
I received a message error that the integration tolerance has not met. I believe it is because tumor carrying capacity and tumor volume are species and they have to be that.
How would I solve this?
Appreciate your help Hi
I encountered an issue in implementing the growth rate of the tumor. In the following equation, both tumor carrying capacity and tumor volume are species
(d/dt)TumorVolume = r * TumorVolume * log(TumorCarryingCapacity/TumorVolume)
I received a message error that the integration tolerance has not met. I believe it is because tumor carrying capacity and tumor volume are species and they have to be that.
How would I solve this?
Appreciate your help integration tolerance MATLAB Answers — New Questions
NaN output only when using three ouput for QR
I’m trying to use the canoncorr function. I removed all features with NaN values from my two input matrices. Still, I get the error
Error using canoncorr (line 86)
X must contain at least one non-constant column.
This is because the function qr in
[Q1,T11,perm1] = qr(X,0);
returns all-NaN Q1 and T11, therefore at the next line rankX is 0.
Nonetheless, I noted that if I run only [Q1,T11] = qr(X,0); or [T11] = qr(X,0); all looks ok.
Any guess on what is going on?
Thank youI’m trying to use the canoncorr function. I removed all features with NaN values from my two input matrices. Still, I get the error
Error using canoncorr (line 86)
X must contain at least one non-constant column.
This is because the function qr in
[Q1,T11,perm1] = qr(X,0);
returns all-NaN Q1 and T11, therefore at the next line rankX is 0.
Nonetheless, I noted that if I run only [Q1,T11] = qr(X,0); or [T11] = qr(X,0); all looks ok.
Any guess on what is going on?
Thank you I’m trying to use the canoncorr function. I removed all features with NaN values from my two input matrices. Still, I get the error
Error using canoncorr (line 86)
X must contain at least one non-constant column.
This is because the function qr in
[Q1,T11,perm1] = qr(X,0);
returns all-NaN Q1 and T11, therefore at the next line rankX is 0.
Nonetheless, I noted that if I run only [Q1,T11] = qr(X,0); or [T11] = qr(X,0); all looks ok.
Any guess on what is going on?
Thank you qr, matlab, canoncorr MATLAB Answers — New Questions
writecell messes up merge and center when writing to Excel
I tried to switch some of my old xlswrite functions over to writecell as this newer function seems superior in terms of efficiency, however I found that when writing data to cells that have already been merged and centered in an Excel file, writecell wipes out the merge/center. In fact, it seems like writecell wipes other formatting as well (column widths are resized to fit the data). This is pretty annoying as I am just trying to write cell data in specific cells without altering the formatting of the file.
xlswrite does not have this issue. It just puts the data in there.
Any workarounds that don’t involve activexserver would be appreciated. At a minimum I would like to understand why this is happening.I tried to switch some of my old xlswrite functions over to writecell as this newer function seems superior in terms of efficiency, however I found that when writing data to cells that have already been merged and centered in an Excel file, writecell wipes out the merge/center. In fact, it seems like writecell wipes other formatting as well (column widths are resized to fit the data). This is pretty annoying as I am just trying to write cell data in specific cells without altering the formatting of the file.
xlswrite does not have this issue. It just puts the data in there.
Any workarounds that don’t involve activexserver would be appreciated. At a minimum I would like to understand why this is happening. I tried to switch some of my old xlswrite functions over to writecell as this newer function seems superior in terms of efficiency, however I found that when writing data to cells that have already been merged and centered in an Excel file, writecell wipes out the merge/center. In fact, it seems like writecell wipes other formatting as well (column widths are resized to fit the data). This is pretty annoying as I am just trying to write cell data in specific cells without altering the formatting of the file.
xlswrite does not have this issue. It just puts the data in there.
Any workarounds that don’t involve activexserver would be appreciated. At a minimum I would like to understand why this is happening. writecell xlswrite formatting MATLAB Answers — New Questions
Confusion with Coordinates System of objectDetection() in trackerGNN
I have a confusion regarding objectDetection() as we input that into trackerGNN. If I give measurements in this form and specify the field Frame of MeasurementParameters to be ‘Spherical’. Then I run tracker and get measurements using getTrackPositions(……., "constvel"). Then I have to convert that into cartesian coordinates for plotting using plotTrack().
But the issue is that I get the same exact "squigly lines" on plot if I dont specify MeasurmentParameters field at all. None other parameters changed (No change in this phenomenon is observed if we change units from theta to degrees).
So either the case is that trackerGNN interprets as x and y measurements at face value regardless of whether I specify it to be Spherical or not. Or there is something I missed. Either way, Please clarify what is going on.I have a confusion regarding objectDetection() as we input that into trackerGNN. If I give measurements in this form and specify the field Frame of MeasurementParameters to be ‘Spherical’. Then I run tracker and get measurements using getTrackPositions(……., "constvel"). Then I have to convert that into cartesian coordinates for plotting using plotTrack().
But the issue is that I get the same exact "squigly lines" on plot if I dont specify MeasurmentParameters field at all. None other parameters changed (No change in this phenomenon is observed if we change units from theta to degrees).
So either the case is that trackerGNN interprets as x and y measurements at face value regardless of whether I specify it to be Spherical or not. Or there is something I missed. Either way, Please clarify what is going on. I have a confusion regarding objectDetection() as we input that into trackerGNN. If I give measurements in this form and specify the field Frame of MeasurementParameters to be ‘Spherical’. Then I run tracker and get measurements using getTrackPositions(……., "constvel"). Then I have to convert that into cartesian coordinates for plotting using plotTrack().
But the issue is that I get the same exact "squigly lines" on plot if I dont specify MeasurmentParameters field at all. None other parameters changed (No change in this phenomenon is observed if we change units from theta to degrees).
So either the case is that trackerGNN interprets as x and y measurements at face value regardless of whether I specify it to be Spherical or not. Or there is something I missed. Either way, Please clarify what is going on. trackergnn MATLAB Answers — New Questions