Month: August 2024
Adjust the fitting for non-unique values data (alternative to the fuction smoothing spline, createFit.f)
Good morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_sizeGood morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_size Good morning everyone,
I am trying to extract the fracture aperture from a tomography image. I have written the code for the extraction, and everything works using the fitting smoothing spline (createFit function attached) for clu_sli_12.mat and I_12.mat, but not on clu_sli_1400.mat and I_1400.mat in which we have non-unique data (presented directly in the code below). The variable clu_sli_1400 represents the point cloud used as reference for selecting data in the tomography slice (variable I_1400). We tried using other functions in matlab, without success. Can anybody help suggesting a specific function for fitting this data?
thanks in advance for any help!!!!!!!!
clear;
close all;
clc;
warning off;
load(‘I_1400.mat’)
load(‘clu_sli_1400.mat’)
voxel_size=70.69*10^-3;
%% Iteration on the slices
mean_widths = [];
std_widths = [];
min_widths = [];
max_widths = [];
areas = [];
% for ii = 12 %we have to iterate to ii = 12 and ii = 1400 (the last one not working properly on the fitting)
% fitting data
X = clu_sli(:,1);
Y = clu_sli(:,2);
% Create model fitting
[fitresult, gof] = createFit(X, Y);
% Calcolare i valori della curva di fitting
vv = ppval(fitresult.p, X);
% Calcolare la prima derivata della curva di fitting
d1 = ppval(fnder(fitresult.p, 1), X);
% Calcolare la normale alla curva di fitting
epsilon = 1e-10; % Evita la divisione per zero
nn = 1 ./ (d1 + epsilon);
% Calcolare gli angoli delle normali
theta = atan(-1 ./ d1); % Angolo della normale (in radianti)
% Calcolare le componenti della normale
normal_x = cos(theta); % Componente x della normale
normal_y = sin(theta); % Componente y della normale
% Calcolare l’ampiezza della crepa e visualizzare i segmenti
span = 50;
largh = zeros(size(clu_sli, 1), 1);
% Creare una figura con due subplot
figure;
% Primo subplot: Visualizzare la slice con i pallini rossi
subplot(1, 2, 1);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
xlabel(‘X’);
ylabel(‘Y’);
% Secondo subplot: Visualizzare la slice con i segmenti verdi
subplot(1, 2, 2);
pcolor(I);
shading interp;
axis equal;
hold on;
scatter(clu_sli(:,1), clu_sli(:,2), ‘r’);
plot(X, vv, ‘b’, ‘LineWidth’, 2);
quiver(X, vv, normal_x, normal_y, 0.5, ‘k’, ‘LineWidth’, 1);
intensity_profiles = cell(size(clu_sli, 1), 1);
vet_in = zeros(size(clu_sli, 1), 2);
vet_fin = zeros(size(clu_sli, 1), 2);
for kk = 1:size(clu_sli, 1)
c = round(X(kk));
r = round(vv(kk));
% Genera i pixel lungo la normale
x_profile = round(c + (-span:span) * normal_x(kk));
y_profile = round(r + (-span:span) * normal_y(kk));
% Assicurarsi che i pixel siano all’interno dell’immagine
valid_idx = x_profile > 0 & x_profile <= size(I, 2) & y_profile > 0 & y_profile <= size(I, 1);
x_profile = x_profile(valid_idx);
y_profile = y_profile(valid_idx);
% Estrarre i valori del profilo dall’immagine
profilo = I(sub2ind(size(I), y_profile, x_profile));
intensity_profiles{kk} = profilo;
% Calcolare l’ampiezza della crepa
largh(kk) = conv_crepa(profilo);
% Calcolare i punti del segmento di larghezza
half_width = largh(kk) / 2;
segment_x = [c – half_width * normal_x(kk), c + half_width * normal_x(kk)];
segment_y = [r – half_width * normal_y(kk), r + half_width * normal_y(kk)];
vet_in(kk,1) = c – half_width * normal_x(kk);
vet_fin(kk,1) = c + half_width * normal_x(kk);
vet_in(kk,2) = r – half_width * normal_y(kk);
vet_fin(kk,2) = r + half_width * normal_y(kk);
% Visualizzare il segmento di larghezza
plot(segment_x, segment_y, ‘g’, ‘LineWidth’, 2);
end
hold off;
% Calcolare la media, la deviazione standard, il minimo e il massimo della larghezza della crepa
mean_width = mean(largh, ‘omitnan’);
std_width = std(largh, ‘omitnan’);
min_width = min(largh, [], ‘omitnan’);
max_width = max(largh, [], ‘omitnan’);
mean_widths = [mean_widths; mean_width];
std_widths = [std_widths; std_width];
min_widths = [min_widths; min_width];
max_widths = [max_widths; max_width];
% Calcolo dell’area all’interno delle curve usando trapz
% Creazione del poligono per calcolare l’area
all_x = [vet_in(:,1); flip(vet_fin(:,1))];
all_y = [vet_in(:,2); flip(vet_fin(:,2))];
% Rimuovi i NaN
valid_idx = ~isnan(all_x) & ~isnan(all_y);
all_x = all_x(valid_idx);
all_y = all_y(valid_idx);
% Assicurarsi che i punti formino un poligono chiuso
if length(all_x) > 1 && (all_x(1) ~= all_x(end) || all_y(1) ~= all_y(end))
all_x(end+1) = all_x(1);
all_y(end+1) = all_y(1);
end
% Calcolo dell’area del poligono usando trapz
area = trapz(all_x, all_y);
areas = [areas; area];
title(‘Area Between Curves per Slice’);
%% calcoli in mm
areas_mm = areas.* voxel_size^2
std_mm=std_widths.*voxel_size
mean_mm=mean_widths.*voxel_size
min_mm=min_widths.*voxel_size
max_mm=max_widths.*voxel_size curve fitting, non-unique data, createfit MATLAB Answers — New Questions
A simple allocation of array places to zero does not work in MATLAB R2020B
I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated!I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated! I have a numeric array KSE
I have identified a number of locations where there are peaks,
locations =
Columns 1 through 10
147 827 3772 4762 5192 5618 6048 6481 6915 7350
Columns 11 through 20
7781 8206 8637 9070 9502 9938 10367 10793 11225 11657
Columns 21 through 26
12922 13876 20315 23377 24431 25492
I have identified in that array a number of locations where there are short lived transients, a number of which I wish to remove.
Those unwanted transients are identified by
ii =
1 2 3 21 22 23 24 25 26
The command
KSE(locations(ii)-50:locations(ii)+50)=0
is meant to replace 50 array elements on either side of the transient location with a zero.
It works well at the first location but not in the remaining 8 locations!
Is this a bug or am I doing some sort of stupid coding mistake?
Any soultions would be appreciated! setting array elements to zero MATLAB Answers — New Questions
I want to add two histograms with error bars to a piece of code I already have that is generating two plots
I have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
AlexI have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
Alex I have a piece of code that is currently calculating stress/strain and force/extension.
It groups them into catagories based on the temperature and time they were sintered for.
I would like to add histograsm that can also show the modulus of elasticity and the ultimate tensile strength for these groups. The modulus of elasticity should be for say a range from ~0.05 to 0.15 extension, or similar. The error bars should show +/- the stdev for the data sets
would also like to make it so that the legend expressly states the sintering cycle.
For example ‘conventional sintering’ two-stage sintering’, ‘sintered at x°C for x hours’ etc
below is the code
clear
close all
Nsamples = 14;
G=ones(1,2*Nsamples);
G(1:12)=1;
G([2:1:4 10:1:11])=2;
G(5:1:9)=3;
G(13:14)=4;
%%
load(‘E:DICsintering_dataOXmcdata.mat’)
% G(15)=5;
% G(16)=6;
% G(13:14)=5;
% M={‘x’,’+’,’*’,’s’,’d’}; % a marker for each group
C={‘r’,’b’,’m’,’g’,’m’,’y’}; % and a color
L = 90; % coupon gauge section (mm)
A = 18; % coupon cross-sectional area (mm^2)
figure(1);
hold on
figure(2);
hold on
for k = 1:Nsamples
file_name = [‘Sample’ num2str(k) ‘.csv’];
T = readtable(file_name,’VariableNamingRule’,’preserve’);
[test(k).disp,test(k).force,test(k).eyy] = post_fun(T);
ig=G(k); % get group id for kth file
figure(1)
% h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
h(k) = plot(test(k).disp,test(k).force,’LineWidth’,2,’Color’,C{ig});
figure(2)
% g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Marker’,M(ig),’Color’,C{ig});
g(k) = plot(test(k).eyy*100,1000*test(k).force/A,’LineWidth’,2,’Color’,C{ig});
leg_string{k} = [‘Sintering schedule ‘ num2str(ig)];
end
%
%%
figure(1)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Displacement (mm)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Force (kN)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Force / extension curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(h([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%%
figure(2)
set(gcf,’Position’,[200 200 1024 768],’Color’,[1 1 1]);
set(gca,’FontSize’,24);
xlabel(‘Strain (%)’,’FontSize’,32,’Interpreter’,’latex’);
ylabel(‘Stress (MPa)’,’FontSize’,32,’Interpreter’,’latex’);
box on
grid on
title(‘Stress / strain curves for of various sintering schedules’,’FontSize’, 20,’Interpreter’,’latex’)
legend(g([1 2 5 13]),leg_string([1 2 5 13]),’FontSize’,28,’Interpreter’,’latex’,’location’,’southeast’);
%
plot(OXmcdata(:,1),OXmcdata(:,2),’DisplayName’,’Farhandi et al (2021)’,’LineWidth’,3,’Color’,’k’,’LineStyle’,’–‘);
%
xlim([0 3E-1]);
ylim([0 350]);
%%
function [displ,force,eyy] = post_fun(T)
displ=T{:,4};
force=T{:,end};
eyy =T{:,10};
ix=all(isfinite([displ force eyy]),2) & all([displ force eyy]>0,2);
displ=displ(ix);
force=force(ix);
eyy=eyy(ix);
[~,imax] = max(force);
displ(imax+1:end) = [];
force(imax+1:end) = [];
eyy(imax+1:end) = [];
end
Hopefully you can help.
Thanks
Alex histogram, bar, error, errorbars MATLAB Answers — New Questions
Save as option greyed out
The Save as option on the new Outlook and OWA has been greyed out for a few weeks now, meaning I can’t save emails as .eml to include the attachments. Does anyone know why this is? It’s getting very frustrating.
The Save as option on the new Outlook and OWA has been greyed out for a few weeks now, meaning I can’t save emails as .eml to include the attachments. Does anyone know why this is? It’s getting very frustrating. Read More
Update not getting installed: Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB
Hi team,
For my device the Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB5040543) is not getting installed and getting error message Install error – 0x800f0993 while trying to install. Kindly get this fixed and assist to get it installed on my device.
Hi team, For my device the Cumulative Update for Windows 11 Insider Preview (10.0.26120.1330) (KB5040543) is not getting installed and getting error message Install error – 0x800f0993 while trying to install. Kindly get this fixed and assist to get it installed on my device. Read More
Error when adding users to MS Teams Channel
I work in the NHS as an admin for a country wide network.
We add users from accross the United Kingdom into Teams Channels we have created for cross-working.
I have come accross an issue where when trying to add a user to a Teams channel (Created in Manchester, I am the owner) I recieve an error saying 0 of 1 members were added, there was an error.
My colleague (also an owner) can’t add them either but when accessing MS Teams on their phone app can see that the individual is already added to the channel, but can’t see them in desktop.
The user cannot access the Teams channel and when either trying to switch accounts to Manchester University (where the channel is accessible for all other users) or following a link to the channel they receive an error stating their log in credentials are invalid and their account is locked.
I haved tried reaching out to our IT team and they are unable to assist, any ideas on what could be causing the issue?
Thanks
I work in the NHS as an admin for a country wide network.We add users from accross the United Kingdom into Teams Channels we have created for cross-working.I have come accross an issue where when trying to add a user to a Teams channel (Created in Manchester, I am the owner) I recieve an error saying 0 of 1 members were added, there was an error.My colleague (also an owner) can’t add them either but when accessing MS Teams on their phone app can see that the individual is already added to the channel, but can’t see them in desktop.The user cannot access the Teams channel and when either trying to switch accounts to Manchester University (where the channel is accessible for all other users) or following a link to the channel they receive an error stating their log in credentials are invalid and their account is locked.I haved tried reaching out to our IT team and they are unable to assist, any ideas on what could be causing the issue?Thanks Read More
Extracting data across sheets based on variables in sheet 1
Hello all, I am trying to find a way to extract data in column 1, into another sheet to be viewed in a list there, but based on variables in column 3. This is for work so I cant share the actual example, but I have thrown together a simple example to show it in excel. Based on my example attached, I am trying to extract the tasks that are “not done” into the other dashboard sheet to be able to use the sheet as a quick overview without having to go through the table
I have tried to write an XLOOKUP formula to do this but I can’t seem to get it working, any help would be greatly appreciated!!
Hello all, I am trying to find a way to extract data in column 1, into another sheet to be viewed in a list there, but based on variables in column 3. This is for work so I cant share the actual example, but I have thrown together a simple example to show it in excel. Based on my example attached, I am trying to extract the tasks that are “not done” into the other dashboard sheet to be able to use the sheet as a quick overview without having to go through the table I have tried to write an XLOOKUP formula to do this but I can’t seem to get it working, any help would be greatly appreciated!! Read More
User Forms with Dependent Drop-down Selections
Hi all,
I have two doubts I would like to share to the wider community for help. I am trying to enable multiple dependent drop-down forms with multiple selections (combining some VBA code) to collect some data. Nonetheless, I am facing two issues when doing so.
I have a drop-down in which you can select from 1 to 9 options. This should trigger a second drop-down based on the concatenated sub-categories made in those selections on the next column (e.g.: If you selected “fish” and “vegetables”; in the next column you should have all fishes and all vegetables inside the dropdown [mackerel, salmon, cucumber, spinach]). This, which can be intuitive, has been a nightmare on the backend:I had to go to a programming language (R in my case) to create all the different 511 possible combinations of items from the selections, putting all titles alphabetically ordered and in named_ranges style.I pasted that creation to Excel, the 511 different named ranges and automatically created a formula for crafting 511 named ranges taking into account the different lengths.Finally, I created on the main table a helper column ordering the first selection alphabetically (with yet again another VBA formula) so that I could match with =INDIRECT(“helper_column_cell”) the different possible concatentations. A long journey given the fact I did not see a way to seamlessly join different named ranges…A second issue has to do with the multiple selection. I achieved having the dropdown with the right data depending on the first 1 to 9 combinations input; enabling me to select multiple items from the resulting list, concatenating them with commas and not allowing repetitions. Nonetheless, each input requires reopening the drop-down again, and I would like that to be done in one shot. I thought about a user form, but it looks as adapting the options to the 511 possible combinations is dreamland. Below you see the code I do have for now:Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDataMapping As Range
Dim Oldvalue As String
Dim Newvalue As String
Dim arr() As String
Dim Output As String
Dim i As Integer
‘ Set the range for the multiple drop-down (columns O and R in this case)
Set rngDataMapping = Intersect(Me.Range(“O:O, R:R, S:S”), Target)
If Not rngDataMapping Is Nothing Then
Application.EnableEvents = False
On Error GoTo Exitsub
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then GoTo Exitsub Else
If Target.Value = “” Then GoTo Exitsub Else
Application.Undo
Oldvalue = Target.Value
Application.Undo
Newvalue = Target.Value
‘ Check if the new value already exists
If InStr(1, Oldvalue, Newvalue) = 0 Then
If Oldvalue = “” Then
Target.Value = Newvalue
Else
arr = Split(Oldvalue, “, “)
Output = “”
For i = LBound(arr) To UBound(arr)
If arr(i) <> Newvalue Then
If Output = “” Then
Output = arr(i)
Else
Output = Output & “, ” & arr(i)
End If
End If
Next i
If Output = “” Then
Output = Newvalue
Else
Output = Newvalue & “, ” & Output
End If
Target.Value = Output
End If
End If
End If
Exitsub:
Application.EnableEvents = True
Exit Sub
End Sub
Do you have any recommendation on better and more efficient solutions to Problem 1? Is there any way to sort out the issue on problem 2 to allow the users to do multiple selections without the drop-down collapsing with any new input? I would really appreciate your mastery and comments!
Hi all, I have two doubts I would like to share to the wider community for help. I am trying to enable multiple dependent drop-down forms with multiple selections (combining some VBA code) to collect some data. Nonetheless, I am facing two issues when doing so. I have a drop-down in which you can select from 1 to 9 options. This should trigger a second drop-down based on the concatenated sub-categories made in those selections on the next column (e.g.: If you selected “fish” and “vegetables”; in the next column you should have all fishes and all vegetables inside the dropdown [mackerel, salmon, cucumber, spinach]). This, which can be intuitive, has been a nightmare on the backend:I had to go to a programming language (R in my case) to create all the different 511 possible combinations of items from the selections, putting all titles alphabetically ordered and in named_ranges style.I pasted that creation to Excel, the 511 different named ranges and automatically created a formula for crafting 511 named ranges taking into account the different lengths.Finally, I created on the main table a helper column ordering the first selection alphabetically (with yet again another VBA formula) so that I could match with =INDIRECT(“helper_column_cell”) the different possible concatentations. A long journey given the fact I did not see a way to seamlessly join different named ranges…A second issue has to do with the multiple selection. I achieved having the dropdown with the right data depending on the first 1 to 9 combinations input; enabling me to select multiple items from the resulting list, concatenating them with commas and not allowing repetitions. Nonetheless, each input requires reopening the drop-down again, and I would like that to be done in one shot. I thought about a user form, but it looks as adapting the options to the 511 possible combinations is dreamland. Below you see the code I do have for now:Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDataMapping As Range
Dim Oldvalue As String
Dim Newvalue As String
Dim arr() As String
Dim Output As String
Dim i As Integer
‘ Set the range for the multiple drop-down (columns O and R in this case)
Set rngDataMapping = Intersect(Me.Range(“O:O, R:R, S:S”), Target)
If Not rngDataMapping Is Nothing Then
Application.EnableEvents = False
On Error GoTo Exitsub
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then GoTo Exitsub Else
If Target.Value = “” Then GoTo Exitsub Else
Application.Undo
Oldvalue = Target.Value
Application.Undo
Newvalue = Target.Value
‘ Check if the new value already exists
If InStr(1, Oldvalue, Newvalue) = 0 Then
If Oldvalue = “” Then
Target.Value = Newvalue
Else
arr = Split(Oldvalue, “, “)
Output = “”
For i = LBound(arr) To UBound(arr)
If arr(i) <> Newvalue Then
If Output = “” Then
Output = arr(i)
Else
Output = Output & “, ” & arr(i)
End If
End If
Next i
If Output = “” Then
Output = Newvalue
Else
Output = Newvalue & “, ” & Output
End If
Target.Value = Output
End If
End If
End If
Exitsub:
Application.EnableEvents = True
Exit Sub
End SubDo you have any recommendation on better and more efficient solutions to Problem 1? Is there any way to sort out the issue on problem 2 to allow the users to do multiple selections without the drop-down collapsing with any new input? I would really appreciate your mastery and comments! Read More
The Best Spotify Music Downloader for Saving Songs as MP3 for Windows 11?
I found out the music downloaded from Spotify is in OGG format, which is not compatible with many devices and media players. This limitation has been quite frustrating as it restricts my ability to enjoy my Spotify playlist on different devices such as my Windows 11 laptop and car.
Recently, I stumbled upon some Spotify music downloader tools that claim to save Spotify tracks as MP3. However, with so many options available, it’s challenging to determine which one is the best in terms of performance, quality, and ease of use.
If you have used any such tools, please share your insights on their features, user-friendliness, and overall effectiveness. Your feedback will be invaluable in helping me and others find the best solution for enjoying Spotify music seamlessly across multiple devices.
I found out the music downloaded from Spotify is in OGG format, which is not compatible with many devices and media players. This limitation has been quite frustrating as it restricts my ability to enjoy my Spotify playlist on different devices such as my Windows 11 laptop and car. Recently, I stumbled upon some Spotify music downloader tools that claim to save Spotify tracks as MP3. However, with so many options available, it’s challenging to determine which one is the best in terms of performance, quality, and ease of use. If you have used any such tools, please share your insights on their features, user-friendliness, and overall effectiveness. Your feedback will be invaluable in helping me and others find the best solution for enjoying Spotify music seamlessly across multiple devices. Read More
servicePrincipals?$expand=appRoleAssignedTo incomplete result
For an inventory script, I use servicePrincipals?$expand=appRoleAssignedTo to get all serviceprinciples including “approleassignedTo” info.
To make an inventory of the approle assignments, I loop through all apps (~2250) and for each app, I loop through approles, and foreach approle I loop through appRoleAssignedTo data.
In my environment this results in ~3000 approle assignments.
When I analyze the result, I estimate 5% of role assignments are missing.
I do see all roles, just not all roleassignments. When I look up a missing assignments in the Entra portal I do see them.
The missing role assignment aren’t special, they are assigned to normal Entra ID groups like other assigned approles.
When I rerun the script, the same assignments are missing each time.
When I don’t use $expand query parameter, but query the data directly using ‘servicePrincipals/{id}/appRoleAssignedTo’, I do get all assignments.
Did I run into a bug?
For an inventory script, I use servicePrincipals?$expand=appRoleAssignedTo to get all serviceprinciples including “approleassignedTo” info.To make an inventory of the approle assignments, I loop through all apps (~2250) and for each app, I loop through approles, and foreach approle I loop through appRoleAssignedTo data.In my environment this results in ~3000 approle assignments. When I analyze the result, I estimate 5% of role assignments are missing.I do see all roles, just not all roleassignments. When I look up a missing assignments in the Entra portal I do see them.The missing role assignment aren’t special, they are assigned to normal Entra ID groups like other assigned approles. When I rerun the script, the same assignments are missing each time. When I don’t use $expand query parameter, but query the data directly using ‘servicePrincipals/{id}/appRoleAssignedTo’, I do get all assignments. Did I run into a bug? Read More
Searching for the nearest point on a grid using dsearchn
I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1 I am trying to compare field data with classified sattellite imagery.
What I am aiming for is to find the nearest pixel in the sattellite image to the location of the field data.
The coordinates of the pixels are in X & Y represented by blue circles below, spacing is 30m x 30m.
The coordinates of the field data is in TransectDataStats.Easting & .Northing represented by "x’s" below.
The dots are the "closest point" as determined by the matlab function dsearchn.
Most of the results look ok but there are some werid ones highlighted in red below that don’t seem right. Some there appears to be a closer point than the one selected and one that doesn’t seem to have a field point anywhere near it.
Questions
Am I using this function correctly?
Can anyone explain why the oddball "nearest points"?
What could be done to fix this?
Is there an alternative function or method to acheive the result I am aiming for?
NearestPoint = dsearchn([X(:),Y(:)],[TransectDataStats.Easting,TransectDataStats.Northing])
figure
plot(X(:),Y(:),’o’)
hold on
plot(X(NearestPoint),Y(NearestPoint),’.’)
plot(TransectDataStats.Easting,TransectDataStats.Northing,’x’)
axis equal
size(X)
ans =
2895 921
size(TransectDataStats.Easting)
ans =
654 1 dsearchn, satellite imagery, closest pixel, image processing MATLAB Answers — New Questions
How can I find the coefficients of the 2D interpolated function?
My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’);My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’); My function is . I used following code to interpolation. How can I find the coefficients of the interpolated function ?
Eta = load(‘Eta.txt’);
t = 0:5:(8.25*60); % time
x = [0,3750,7500,8000]; % distance
[X,T] = meshgrid(x,t);
% interpolation
[xq,tq] = meshgrid(0:2:8000,0:(8.25*60)) ;
Eta_intp = interp2(X,T,eta,xq,tq,’spline’); 2d interpolation MATLAB Answers — New Questions
Unfamiliar error message from ode45: “Unrecognized function or variable ‘packageAsFuncHandle”.
One of my students is receiving this message when trying to run ode45 from her computer. Running the exact same script on another machine does not throw an error. I’ve had her uninstall and reinstall MATLAB but getting the same results. Has anyone else experienced this? Haven’t seen it anywhere else on the forum/community. Thanks!One of my students is receiving this message when trying to run ode45 from her computer. Running the exact same script on another machine does not throw an error. I’ve had her uninstall and reinstall MATLAB but getting the same results. Has anyone else experienced this? Haven’t seen it anywhere else on the forum/community. Thanks! One of my students is receiving this message when trying to run ode45 from her computer. Running the exact same script on another machine does not throw an error. I’ve had her uninstall and reinstall MATLAB but getting the same results. Has anyone else experienced this? Haven’t seen it anywhere else on the forum/community. Thanks! ode45, function MATLAB Answers — New Questions
Detect a collision between 2 robotPlatform
Hello,
I imported 2 URDF files using the importrobot function. Then, I created a robotScenario by adding a robotPlatform for each robot. I want to check during the scenario that there are no collisions between the robots.
I tried using the checkCollision function between the 2 robotPlatforms, but this function does not accept non-rigidBodyTree-based platforms.
Then, I tried to create a robotPlatform ‘hand’ from an STL file and attach ‘hand’ to the ‘robot2Scn’ platform using the attach function, but the position of ‘hand’ does not update when I use the checkCollision(robotScn, ‘hand’, IgnoreSelfCollision="on") function. This function returns 1 when ‘robotScn’ is at the initial position of ‘hand’, otherwise it returns 0.
Is there a function or have you a suggestion to check for collisions between 2 robotPlatforms in a robotScenario?
Thank you.
robot = importrobot("robot.urdf");
robot2 = importrobot("robot_2.urdf");
scenario = robotScenario(UpdateRate=1,StopTime=10);
robotScn = robotPlatform("robot1",scenario,RigidBodyTree=robot);
robotScn2 = robotPlatform("robot2",scenario,RigidBodyTree=robot2);
% Trying to manually add a collision zone (Test with and without using clearCollision on robot2)
stlData = stlread(‘hand_link.stl’);
vertices = stlData.Points;
faces = stlData.ConnectivityList;
handMesh = collisionMesh(vertices);
base = robotPlatform("hand",scenario,Collision=handMesh, initialBasePosition[0.2 0.2 0.2]);
attach(robotScn2,"hand","hand_link",ChildToParentTransform=trvec2tform([0 0 0]))
checkCollision(robotScn,"hand", IgnoreSelfCollision="on")Hello,
I imported 2 URDF files using the importrobot function. Then, I created a robotScenario by adding a robotPlatform for each robot. I want to check during the scenario that there are no collisions between the robots.
I tried using the checkCollision function between the 2 robotPlatforms, but this function does not accept non-rigidBodyTree-based platforms.
Then, I tried to create a robotPlatform ‘hand’ from an STL file and attach ‘hand’ to the ‘robot2Scn’ platform using the attach function, but the position of ‘hand’ does not update when I use the checkCollision(robotScn, ‘hand’, IgnoreSelfCollision="on") function. This function returns 1 when ‘robotScn’ is at the initial position of ‘hand’, otherwise it returns 0.
Is there a function or have you a suggestion to check for collisions between 2 robotPlatforms in a robotScenario?
Thank you.
robot = importrobot("robot.urdf");
robot2 = importrobot("robot_2.urdf");
scenario = robotScenario(UpdateRate=1,StopTime=10);
robotScn = robotPlatform("robot1",scenario,RigidBodyTree=robot);
robotScn2 = robotPlatform("robot2",scenario,RigidBodyTree=robot2);
% Trying to manually add a collision zone (Test with and without using clearCollision on robot2)
stlData = stlread(‘hand_link.stl’);
vertices = stlData.Points;
faces = stlData.ConnectivityList;
handMesh = collisionMesh(vertices);
base = robotPlatform("hand",scenario,Collision=handMesh, initialBasePosition[0.2 0.2 0.2]);
attach(robotScn2,"hand","hand_link",ChildToParentTransform=trvec2tform([0 0 0]))
checkCollision(robotScn,"hand", IgnoreSelfCollision="on") Hello,
I imported 2 URDF files using the importrobot function. Then, I created a robotScenario by adding a robotPlatform for each robot. I want to check during the scenario that there are no collisions between the robots.
I tried using the checkCollision function between the 2 robotPlatforms, but this function does not accept non-rigidBodyTree-based platforms.
Then, I tried to create a robotPlatform ‘hand’ from an STL file and attach ‘hand’ to the ‘robot2Scn’ platform using the attach function, but the position of ‘hand’ does not update when I use the checkCollision(robotScn, ‘hand’, IgnoreSelfCollision="on") function. This function returns 1 when ‘robotScn’ is at the initial position of ‘hand’, otherwise it returns 0.
Is there a function or have you a suggestion to check for collisions between 2 robotPlatforms in a robotScenario?
Thank you.
robot = importrobot("robot.urdf");
robot2 = importrobot("robot_2.urdf");
scenario = robotScenario(UpdateRate=1,StopTime=10);
robotScn = robotPlatform("robot1",scenario,RigidBodyTree=robot);
robotScn2 = robotPlatform("robot2",scenario,RigidBodyTree=robot2);
% Trying to manually add a collision zone (Test with and without using clearCollision on robot2)
stlData = stlread(‘hand_link.stl’);
vertices = stlData.Points;
faces = stlData.ConnectivityList;
handMesh = collisionMesh(vertices);
base = robotPlatform("hand",scenario,Collision=handMesh, initialBasePosition[0.2 0.2 0.2]);
attach(robotScn2,"hand","hand_link",ChildToParentTransform=trvec2tform([0 0 0]))
checkCollision(robotScn,"hand", IgnoreSelfCollision="on") robotics, collision MATLAB Answers — New Questions
Ihor Zahorodnii “Retirement: Azure Synapse Runtime for Apache Spark 3.3”
Ihor Zahorodnii “End of Support for Azure Synapse Runtime for Apache Spark 3.3 was announced on July 12th, 2024. We recommend that you upgrade your Apache Spark 3.3-based workloads to Azure Synapse Runtime for Apache Spark 3.4 – Azure Synapse Analytics | Microsoft Learn. Azure Synapse runtime for Apache Spark 3.3 will be retired and disabled March 2025.”
Ihor Zahorodnii “End of Support for Azure Synapse Runtime for Apache Spark 3.3 was announced on July 12th, 2024. We recommend that you upgrade your Apache Spark 3.3-based workloads to Azure Synapse Runtime for Apache Spark 3.4 – Azure Synapse Analytics | Microsoft Learn. Azure Synapse runtime for Apache Spark 3.3 will be retired and disabled March 2025.” Read More
Ihor Zahorodnii FinOps with Azure
Ihor Zahorodnii
Microsoft Azure Tools for FinOps:
Microsoft Azure offers a variety of tools that can help you implement FinOps principles and practices in your organization. These tools can help you gain visibility into your cloud costs enforce policies and standards, analyze and report on your spending patterns, optimize your resource utilization, communicate and collaborate with your stakeholders, and learn and improve your cloud skills. Here are some of the tools that I recommend:
Microsoft Cost Management: Monitor, allocate, and optimize your Azure costs with this powerful tool. You can track your spending by various dimensions such as resource group, subscription, service type, location, tag, or any other dimension. You can also create budgets and alerts to manage your spending limits and thresholds. You can also generate reports and dashboards to visualize and share your cost data with others.
Azure Policy: Enforce rules and standards for your Azure resources with this useful tool. You can create policies that define what actions are allowed or denied for your resources based on criteria such as location, size, type, tag, or configuration. You can also audit your compliance status and remediate any violations.
Microsoft Power BI: Analyze and report on your Azure data with this great tool. You can connect to various data sources such as the Cost Management Connector, which provides access to your cost and usage data from Cost Management, or the Azure Retail Prices REST API, which provides access to the retail prices of Azure services. You can use these data sources to create interactive reports and dashboards to explore and visualize your data. You can also share your insights and collaborate with others using Power BI.
Azure Monitor Workbooks: Create custom visualizations and dashboards for your Azure data with this handy tool. You can combine text, metrics, logs, queries and parameters to create rich and interactive reports. You can also use it to troubleshoot issues, perform root cause analysis, and optimize your performance.
Microsoft Teams: Communicate and collaborate with your teams and stakeholders with this tool. You can chat, call, meet, and share files and documents with others. You can also integrate with other Azure tools such as Cost Management, Power BI, Monitor Workbooks, Advisor, or Learning paths, and access them from within Teams.
Azure Advisor: Optimize your Azure resources and reduce your costs with this tool. It provides personalized recommendations based on your usage and configuration data. It also helps you improve your performance, security, reliability, and operational excellence.
Microsoft Azure Learning paths: Learn and improve your Azure skills with this tool. It provides curated collections of online courses, videos, labs, quizzes, and certifications that cover various topics and levels of Azure. You can use it to gain the knowledge and expertise you need to implement FinOps in Azure.
Well-Architected Review: Assess your Azure workloads and identify areas for improvement with this tool. It provides a framework of best practices and principles that cover five pillars: cost optimization, operational excellence, performance efficiency, reliability, and security. You can use it to evaluate your current state, identify gaps and risks, and prioritize actions.
Azure savings offers: Save money on your Azure spending with these tools. They include Reservations, Compute Savings Plan, Hybrid Benefit and other discounts and incentives that you can take advantage of to lower your cloud costs.
Ihor Zahorodnii Microsoft Azure Tools for FinOps:Microsoft Azure offers a variety of tools that can help you implement FinOps principles and practices in your organization. These tools can help you gain visibility into your cloud costs enforce policies and standards, analyze and report on your spending patterns, optimize your resource utilization, communicate and collaborate with your stakeholders, and learn and improve your cloud skills. Here are some of the tools that I recommend:Microsoft Cost Management: Monitor, allocate, and optimize your Azure costs with this powerful tool. You can track your spending by various dimensions such as resource group, subscription, service type, location, tag, or any other dimension. You can also create budgets and alerts to manage your spending limits and thresholds. You can also generate reports and dashboards to visualize and share your cost data with others.Azure Policy: Enforce rules and standards for your Azure resources with this useful tool. You can create policies that define what actions are allowed or denied for your resources based on criteria such as location, size, type, tag, or configuration. You can also audit your compliance status and remediate any violations.Microsoft Power BI: Analyze and report on your Azure data with this great tool. You can connect to various data sources such as the Cost Management Connector, which provides access to your cost and usage data from Cost Management, or the Azure Retail Prices REST API, which provides access to the retail prices of Azure services. You can use these data sources to create interactive reports and dashboards to explore and visualize your data. You can also share your insights and collaborate with others using Power BI.Azure Monitor Workbooks: Create custom visualizations and dashboards for your Azure data with this handy tool. You can combine text, metrics, logs, queries and parameters to create rich and interactive reports. You can also use it to troubleshoot issues, perform root cause analysis, and optimize your performance.Microsoft Teams: Communicate and collaborate with your teams and stakeholders with this tool. You can chat, call, meet, and share files and documents with others. You can also integrate with other Azure tools such as Cost Management, Power BI, Monitor Workbooks, Advisor, or Learning paths, and access them from within Teams.Azure Advisor: Optimize your Azure resources and reduce your costs with this tool. It provides personalized recommendations based on your usage and configuration data. It also helps you improve your performance, security, reliability, and operational excellence.Microsoft Azure Learning paths: Learn and improve your Azure skills with this tool. It provides curated collections of online courses, videos, labs, quizzes, and certifications that cover various topics and levels of Azure. You can use it to gain the knowledge and expertise you need to implement FinOps in Azure.Well-Architected Review: Assess your Azure workloads and identify areas for improvement with this tool. It provides a framework of best practices and principles that cover five pillars: cost optimization, operational excellence, performance efficiency, reliability, and security. You can use it to evaluate your current state, identify gaps and risks, and prioritize actions.Azure savings offers: Save money on your Azure spending with these tools. They include Reservations, Compute Savings Plan, Hybrid Benefit and other discounts and incentives that you can take advantage of to lower your cloud costs. Read More
Ihor Zahorodnii Data governance in Microsoft Factory – new Purview
Ihor Zahorodnii
Data governance in Microsoft Factory – new Purview
Microsoft Purview’s data governance solutions create one place for you to manage your on-premises, multicloud, and software-as-a-service (SaaS) data. Using the Microsoft Purview Data Catalog, Data Map, Data Sharing, Data Estate Insights, and Policies you can:
Create an up-to-date map of your business’ entire data landscape.
Empower your users to find useful, trustworthy data.
Classify your sensitive information, so it’s visible and you can manage it.
Automatically map your data’s lineage so you can see where it’s coming from and where it’s going.
Enable your business’ data curators and security administrators with the tools they need to manage and secure your data estate.
Data Catalog
With the Microsoft Purview Data Catalog, business and technical users can quickly and easily find relevant data using a search experience with filters based on lenses such as glossary terms, classifications, sensitivity labels and more. For subject matter experts, data stewards and officers, the Microsoft Purview Data Catalog provides data curation features such as business glossary management and the ability to automate tagging of data assets with glossary terms. Data consumers and producers can also visually trace the lineage of data assets: for example, starting from operational systems on-premises, through movement, transformation & enrichment with various data storage and processing systems in the cloud, to consumption in an analytics system like Power BI. For more information, see our introduction to search using Data Catalog.
Data Map
Microsoft Purview automates data discovery by providing data scanning and classification for assets across your data estate. Metadata and descriptions of discovered data assets are integrated into a holistic map of your data estate. Microsoft Purview Data Map provides the foundation for data discovery and data governance. Microsoft Purview Data Map is a cloud native PaaS service that captures metadata about enterprise data present in analytics and operation systems on-premises and cloud. Microsoft Purview Data Map is automatically kept up to date with built-in automated scanning and classification system. Business users can configure and use the data map through an intuitive UI and developers can programmatically interact with the Data Map using open-source Apache Atlas 2.2 APIs. Microsoft Purview Data Map powers the Microsoft Purview Data Catalog, the Microsoft Purview Data Estate Insights and the Microsoft Purview Data Policy as unified experiences within the Microsoft Purview governance portal.
Ihor Zahorodnii Data governance in Microsoft Factory – new Purview Microsoft Purview’s data governance solutions create one place for you to manage your on-premises, multicloud, and software-as-a-service (SaaS) data. Using the Microsoft Purview Data Catalog, Data Map, Data Sharing, Data Estate Insights, and Policies you can:Create an up-to-date map of your business’ entire data landscape.Empower your users to find useful, trustworthy data.Classify your sensitive information, so it’s visible and you can manage it.Automatically map your data’s lineage so you can see where it’s coming from and where it’s going.Enable your business’ data curators and security administrators with the tools they need to manage and secure your data estate. Data CatalogWith the Microsoft Purview Data Catalog, business and technical users can quickly and easily find relevant data using a search experience with filters based on lenses such as glossary terms, classifications, sensitivity labels and more. For subject matter experts, data stewards and officers, the Microsoft Purview Data Catalog provides data curation features such as business glossary management and the ability to automate tagging of data assets with glossary terms. Data consumers and producers can also visually trace the lineage of data assets: for example, starting from operational systems on-premises, through movement, transformation & enrichment with various data storage and processing systems in the cloud, to consumption in an analytics system like Power BI. For more information, see our introduction to search using Data Catalog. Data MapMicrosoft Purview automates data discovery by providing data scanning and classification for assets across your data estate. Metadata and descriptions of discovered data assets are integrated into a holistic map of your data estate. Microsoft Purview Data Map provides the foundation for data discovery and data governance. Microsoft Purview Data Map is a cloud native PaaS service that captures metadata about enterprise data present in analytics and operation systems on-premises and cloud. Microsoft Purview Data Map is automatically kept up to date with built-in automated scanning and classification system. Business users can configure and use the data map through an intuitive UI and developers can programmatically interact with the Data Map using open-source Apache Atlas 2.2 APIs. Microsoft Purview Data Map powers the Microsoft Purview Data Catalog, the Microsoft Purview Data Estate Insights and the Microsoft Purview Data Policy as unified experiences within the Microsoft Purview governance portal. Read More
The Formula Reference Slippage Problem in MS Excel for Mac
When working with a large, multi-sheet Excel workbook on MacBook Pro (M1), I started encountering a strange issue when inserting rows on one of the worksheets. What happens is that some formulas “slip” or “miss” their intended references after some row insertion/deletion (not those rows having any relation to the affected formulas or references).
In my case the formulas mistakenly referenced a different row, often one row above the original target row. It is as if Excel is confused by (multiple) row deletions or insertions.
Even worse – it was NOT possible to “undo” the action. I made a couple of tests with insert row actions. I could detect the exact moment it happens (in my case, the circular reference occurred because of the reference slip), but no “undo” could fix it. (I had to start from the last saved version, which I paranoiacally make every 15 min or so … luckily).
This makes the whole thing unusable. I took the same excel file and continued working on Windows – it doesn’t happen there.
Anyone had anything similar ever happen with Excel (on Mac)?
When working with a large, multi-sheet Excel workbook on MacBook Pro (M1), I started encountering a strange issue when inserting rows on one of the worksheets. What happens is that some formulas “slip” or “miss” their intended references after some row insertion/deletion (not those rows having any relation to the affected formulas or references). In my case the formulas mistakenly referenced a different row, often one row above the original target row. It is as if Excel is confused by (multiple) row deletions or insertions. Even worse – it was NOT possible to “undo” the action. I made a couple of tests with insert row actions. I could detect the exact moment it happens (in my case, the circular reference occurred because of the reference slip), but no “undo” could fix it. (I had to start from the last saved version, which I paranoiacally make every 15 min or so … luckily). This makes the whole thing unusable. I took the same excel file and continued working on Windows – it doesn’t happen there. Anyone had anything similar ever happen with Excel (on Mac)? Read More
where t0 find planner
SO i just got 365 personal and teams personal but cannot find planner anywhere. can anyone help?
SO i just got 365 personal and teams personal but cannot find planner anywhere. can anyone help? Read More
1000+ Ảnh gái xinh vú đẹp, to tròn, quyến rũ nhất thế giới
Vú đẹp là mong ước của hầu hết tất cả các chị em. Để sở hữu khuôn ngực đầy đặn, căng tròn, quyến rũ để có vóc dáng thêm tự tin. Khi có cặp vú đẹp, việc lựa chọn áo đồ trở nên dễ dàng hơn. Những bộ váy hoặc áo đầm dáng vừa sẽ làm nổi bật và tôn lên vóc dáng thanh mảnh. Vú đẹp là cách chỉ những chị em có vòng 1 căng tràn, tròn trịa, quyến rũ, có độ cong hoàn hảo, cân đối với vóc dáng giúp các nàng thêm phần hấp dẫnproseovip Read More