Category: News
How to normalize an image position in a subplot?
I have some data which I then overlay a figure on top of like this:
plot(rand(10),rand(10),’*’)
[img,~,alphachannel] = imread(‘ImageFile.png’);
axes(‘units’,’normalized’, ‘Position’,[0.35 0.23 0.35 0.35]);
image(img,’AlphaData’,alphachannel);
axis off
The position of the image on the figure is normalized, so even if the data I plot change scale, the image stays in the same position on the figure.
Now, this all works beautifully.
All I want to do is make this plot into a subplot instead of a standalone figure.
However, I can’t seem to figure out how to do this because the image position always gets referenced to the whole figure rather than the subplot.
Any solutions?I have some data which I then overlay a figure on top of like this:
plot(rand(10),rand(10),’*’)
[img,~,alphachannel] = imread(‘ImageFile.png’);
axes(‘units’,’normalized’, ‘Position’,[0.35 0.23 0.35 0.35]);
image(img,’AlphaData’,alphachannel);
axis off
The position of the image on the figure is normalized, so even if the data I plot change scale, the image stays in the same position on the figure.
Now, this all works beautifully.
All I want to do is make this plot into a subplot instead of a standalone figure.
However, I can’t seem to figure out how to do this because the image position always gets referenced to the whole figure rather than the subplot.
Any solutions? I have some data which I then overlay a figure on top of like this:
plot(rand(10),rand(10),’*’)
[img,~,alphachannel] = imread(‘ImageFile.png’);
axes(‘units’,’normalized’, ‘Position’,[0.35 0.23 0.35 0.35]);
image(img,’AlphaData’,alphachannel);
axis off
The position of the image on the figure is normalized, so even if the data I plot change scale, the image stays in the same position on the figure.
Now, this all works beautifully.
All I want to do is make this plot into a subplot instead of a standalone figure.
However, I can’t seem to figure out how to do this because the image position always gets referenced to the whole figure rather than the subplot.
Any solutions? image, figure, subplot MATLAB Answers — New Questions
Digitizing a black and white Electrocardiogram scan
I’m trying to digitize a black-and-white scanned image of an electrocardiogram (BW_ECG.png is an example image with the scale bar for the vertical grid lines). I have already performed edge detection and dilated the image to isolate the prominent features (BW_ECG_dilated.png):
% Detect edges within the region of interest
bw_image = im2gray(roi_image);
edge_image = edge(bw_image, ‘sobel’);
% Display the edge image
figure;
imshow(edge_image);
title(‘Edge detected image’);
% Dilate the edge detected image
background_dots_size = 7;
dilated_image = imdilate(edge_image, strel(‘disk’, background_dots_size));
figure;
imshow(dilated_image);
title(‘Dilated image’);
How can I now:
Remove the background grid dots
Extract a numerical vector representing the ECG signalI’m trying to digitize a black-and-white scanned image of an electrocardiogram (BW_ECG.png is an example image with the scale bar for the vertical grid lines). I have already performed edge detection and dilated the image to isolate the prominent features (BW_ECG_dilated.png):
% Detect edges within the region of interest
bw_image = im2gray(roi_image);
edge_image = edge(bw_image, ‘sobel’);
% Display the edge image
figure;
imshow(edge_image);
title(‘Edge detected image’);
% Dilate the edge detected image
background_dots_size = 7;
dilated_image = imdilate(edge_image, strel(‘disk’, background_dots_size));
figure;
imshow(dilated_image);
title(‘Dilated image’);
How can I now:
Remove the background grid dots
Extract a numerical vector representing the ECG signal I’m trying to digitize a black-and-white scanned image of an electrocardiogram (BW_ECG.png is an example image with the scale bar for the vertical grid lines). I have already performed edge detection and dilated the image to isolate the prominent features (BW_ECG_dilated.png):
% Detect edges within the region of interest
bw_image = im2gray(roi_image);
edge_image = edge(bw_image, ‘sobel’);
% Display the edge image
figure;
imshow(edge_image);
title(‘Edge detected image’);
% Dilate the edge detected image
background_dots_size = 7;
dilated_image = imdilate(edge_image, strel(‘disk’, background_dots_size));
figure;
imshow(dilated_image);
title(‘Dilated image’);
How can I now:
Remove the background grid dots
Extract a numerical vector representing the ECG signal image processing, image analysis MATLAB Answers — New Questions
how can i make Hr may be obtained using MakeONFilter from wavelab toolbox? for this code
function f = MakeONFilter(Type,Par)
% MakeONFilter — Generate Orthonormal QMF Filter for Wavelet Transform
% Usage
% qmf = MakeONFilter(Type,Par)
% Inputs
% Type string, ‘Haar’, ‘Beylkin’, ‘Coiflet’, ‘Daubechies’,
% ‘Symmlet’, ‘Vaidyanathan’,’Battle’
% Par integer, it is a parameter related to the support and vanishing
% moments of the wavelets, explained below for each wavelet.
%
% Outputs
% qmf quadrature mirror filter
%
% Description
% The Haar filter (which could be considered a Daubechies-2) was the
% first wavelet, though not called as such, and is discontinuous.
%
% The Beylkin filter places roots for the frequency response function
% close to the Nyquist frequency on the real axis.
%
% The Coiflet filters are designed to give both the mother and father
% wavelets 2*Par vanishing moments; here Par may be one of 1,2,3,4 or 5.
%
% The Daubechies filters are minimal phase filters that generate wavelets
% which have a minimal support for a given number of vanishing moments.
% They are indexed by their length, Par, which may be one of
% 4,6,8,10,12,14,16,18 or 20. The number of vanishing moments is par/2.
%
% Symmlets are also wavelets within a minimum size support for a given
% number of vanishing moments, but they are as symmetrical as possible,
% as opposed to the Daubechies filters which are highly asymmetrical.
% They are indexed by Par, which specifies the number of vanishing
% moments and is equal to half the size of the support. It ranges
% from 4 to 10.
%
% The Vaidyanathan filter gives an exact reconstruction, but does not
% satisfy any moment condition. The filter has been optimized for
% speech coding.
%
% The Battle-Lemarie filter generate spline orthogonal wavelet basis.
% The parameter Par gives the degree of the spline. The number of
% vanishing moments is Par+1.
%
% See Also
% FWT_PO, IWT_PO, FWT2_PO, IWT2_PO, WPAnalysis
%
% References
% The books by Daubechies and Wickerhauser.
%
if strcmp(Type,’Haar’),
f = [1 1] ./ sqrt(2);
end
if strcmp(Type,’Beylkin’),
f = [ .099305765374 .424215360813 .699825214057 …
.449718251149 -.110927598348 -.264497231446 …
.026900308804 .155538731877 -.017520746267 …
-.088543630623 .019679866044 .042916387274 …
-.017460408696 -.014365807969 .010040411845 …
.001484234782 -.002736031626 .000640485329 ];
end
if strcmp(Type,’Coiflet’),
if Par==1,
f = [ .038580777748 -.126969125396 -.077161555496 …
.607491641386 .745687558934 .226584265197 ];
end
if Par==2,
f = [ .016387336463 -.041464936782 -.067372554722 …
.386110066823 .812723635450 .417005184424 …
-.076488599078 -.059434418646 .023680171947 …
.005611434819 -.001823208871 -.000720549445 ];
end
if Par==3,
f = [ -.003793512864 .007782596426 .023452696142 …
-.065771911281 -.061123390003 .405176902410 …
.793777222626 .428483476378 -.071799821619 …
-.082301927106 .034555027573 .015880544864 …
-.009007976137 -.002574517688 .001117518771 …
.000466216960 -.000070983303 -.000034599773 ];
end
if Par==4,
f = [ .000892313668 -.001629492013 -.007346166328 …
.016068943964 .026682300156 -.081266699680 …
-.056077313316 .415308407030 .782238930920 …
.434386056491 -.066627474263 -.096220442034 …
.039334427123 .025082261845 -.015211731527 …
-.005658286686 .003751436157 .001266561929 …
-.000589020757 -.000259974552 .000062339034 …
.000031229876 -.000003259680 -.000001784985 ];
end
if Par==5,
f = [ -.000212080863 .000358589677 .002178236305 …
-.004159358782 -.010131117538 .023408156762 …
.028168029062 -.091920010549 -.052043163216 …
.421566206729 .774289603740 .437991626228 …
-.062035963906 -.105574208706 .041289208741 …
.032683574283 -.019761779012 -.009164231153 …
.006764185419 .002433373209 -.001662863769 …
-.000638131296 .000302259520 .000140541149 …
-.000041340484 -.000021315014 .000003734597 …
.000002063806 -.000000167408 -.000000095158 ];
end
end
if strcmp(Type,’Daubechies’),
if Par==4,
f = [ .482962913145 .836516303738 …
.224143868042 -.129409522551 ];
end
if Par==6,
f = [ .332670552950 .806891509311 …
.459877502118 -.135011020010 …
-.085441273882 .035226291882 ];
end
if Par==8,
f = [ .230377813309 .714846570553 …
.630880767930 -.027983769417 …
-.187034811719 .030841381836 …
.032883011667 -.010597401785 ];
end
if Par==10,
f = [ .160102397974 .603829269797 .724308528438 …
.138428145901 -.242294887066 -.032244869585 …
.077571493840 -.006241490213 -.012580751999 …
.003335725285 ];
end
if Par==12,
f = [ .111540743350 .494623890398 .751133908021 …
.315250351709 -.226264693965 -.129766867567 …
.097501605587 .027522865530 -.031582039317 …
.000553842201 .004777257511 -.001077301085 ];
end
if Par==14,
f = [ .077852054085 .396539319482 .729132090846 …
.469782287405 -.143906003929 -.224036184994 …
.071309219267 .080612609151 -.038029936935 …
-.016574541631 .012550998556 .000429577973 …
-.001801640704 .000353713800 ];
end
if Par==16,
f = [ .054415842243 .312871590914 .675630736297 …
.585354683654 -.015829105256 -.284015542962 …
.000472484574 .128747426620 -.017369301002 …
-.044088253931 .013981027917 .008746094047 …
-.004870352993 -.000391740373 .000675449406 …
-.000117476784 ];
end
if Par==18,
f = [ .038077947364 .243834674613 .604823123690 …
.657288078051 .133197385825 -.293273783279 …
-.096840783223 .148540749338 .030725681479 …
-.067632829061 .000250947115 .022361662124 …
-.004723204758 -.004281503682 .001847646883 …
.000230385764 -.000251963189 .000039347320 ];
end
if Par==20,
f = [ .026670057901 .188176800078 .527201188932 …
.688459039454 .281172343661 -.249846424327 …
-.195946274377 .127369340336 .093057364604 …
-.071394147166 -.029457536822 .033212674059 …
.003606553567 -.010733175483 .001395351747 …
.001992405295 -.000685856695 -.000116466855 …
.000093588670 -.000013264203 ];
end
end
if strcmp(Type,’Symmlet’),
if Par==4,
f = [ -.107148901418 -.041910965125 .703739068656 …
1.136658243408 .421234534204 -.140317624179 …
-.017824701442 .045570345896 ];
end
if Par==5,
f = [ .038654795955 .041746864422 -.055344186117 …
.281990696854 1.023052966894 .896581648380 …
.023478923136 -.247951362613 -.029842499869 …
.027632152958 ];
end
if Par==6,
f = [ .021784700327 .004936612372 -.166863215412 …
-.068323121587 .694457972958 1.113892783926 …
.477904371333 -.102724969862 -.029783751299 …
.063250562660 .002499922093 -.011031867509 ];
end
if Par==7,
f = [ .003792658534 -.001481225915 -.017870431651 …
.043155452582 .096014767936 -.070078291222 …
.024665659489 .758162601964 1.085782709814 …
.408183939725 -.198056706807 -.152463871896 …
.005671342686 .014521394762 ];
end
if Par==8,
f = [ .002672793393 -.000428394300 -.021145686528 …
.005386388754 .069490465911 -.038493521263 …
-.073462508761 .515398670374 1.099106630537 …
.680745347190 -.086653615406 -.202648655286 …
.010758611751 .044823623042 -.000766690896 …
-.004783458512 ];
end
if Par==9,
f = [ .001512487309 -.000669141509 -.014515578553 …
.012528896242 .087791251554 -.025786445930 …
-.270893783503 .049882830959 .873048407349 …
1.015259790832 .337658923602 -.077172161097 …
.000825140929 .042744433602 -.016303351226 …
-.018769396836 .000876502539 .001981193736 ];
end
if Par==10,
f = [ .001089170447 .000135245020 -.012220642630 …
-.002072363923 .064950924579 .016418869426 …
-.225558972234 -.100240215031 .667071338154 …
1.088251530500 .542813011213 -.050256540092 …
-.045240772218 .070703567550 .008152816799 …
-.028786231926 -.001137535314 .006495728375 …
.000080661204 -.000649589896 ];
end
end
if strcmp(Type,’Vaidyanathan’),
f = [ -.000062906118 .000343631905 -.000453956620 …
-.000944897136 .002843834547 .000708137504 …
-.008839103409 .003153847056 .019687215010 …
-.014853448005 -.035470398607 .038742619293 …
.055892523691 -.077709750902 -.083928884366 …
.131971661417 .135084227129 -.194450471766 …
-.263494802488 .201612161775 .635601059872 …
.572797793211 .250184129505 .045799334111 ];
end
if strcmp(Type,’Battle’),
if Par == 1,
g = [0.578163 0.280931 -0.0488618 -0.0367309 …
0.012003 0.00706442 -0.00274588 -0.00155701 …
0.000652922 0.000361781 -0.000158601 -0.0000867523
];
end
if Par == 3,
g = [0.541736 0.30683 -0.035498 -0.0778079 …
0.0226846 0.0297468 -0.0121455 -0.0127154 …
0.00614143 0.00579932 -0.00307863 -0.00274529 …
0.00154624 0.00133086 -0.000780468 -0.00065562 …
0.000395946 0.000326749 -0.000201818 -0.000164264 …
0.000103307
];
end
if Par == 5,
g = [0.528374 0.312869 -0.0261771 -0.0914068 …
0.0208414 0.0433544 -0.0148537 -0.0229951 …
0.00990635 0.0128754 -0.00639886 -0.00746848 …
0.00407882 0.00444002 -0.00258816 -0.00268646 …
0.00164132 0.00164659 -0.00104207 -0.00101912 …
0.000662836 0.000635563 -0.000422485 -0.000398759 …
0.000269842 0.000251419 -0.000172685 -0.000159168 …
0.000110709 0.000101113
];
end
l = length(g);
f = zeros(1,2*l-1);
f(l:2*l-1) = g;
f(1:l-1) = reverse(g(2:l));
end
f = f ./ norm(f);function f = MakeONFilter(Type,Par)
% MakeONFilter — Generate Orthonormal QMF Filter for Wavelet Transform
% Usage
% qmf = MakeONFilter(Type,Par)
% Inputs
% Type string, ‘Haar’, ‘Beylkin’, ‘Coiflet’, ‘Daubechies’,
% ‘Symmlet’, ‘Vaidyanathan’,’Battle’
% Par integer, it is a parameter related to the support and vanishing
% moments of the wavelets, explained below for each wavelet.
%
% Outputs
% qmf quadrature mirror filter
%
% Description
% The Haar filter (which could be considered a Daubechies-2) was the
% first wavelet, though not called as such, and is discontinuous.
%
% The Beylkin filter places roots for the frequency response function
% close to the Nyquist frequency on the real axis.
%
% The Coiflet filters are designed to give both the mother and father
% wavelets 2*Par vanishing moments; here Par may be one of 1,2,3,4 or 5.
%
% The Daubechies filters are minimal phase filters that generate wavelets
% which have a minimal support for a given number of vanishing moments.
% They are indexed by their length, Par, which may be one of
% 4,6,8,10,12,14,16,18 or 20. The number of vanishing moments is par/2.
%
% Symmlets are also wavelets within a minimum size support for a given
% number of vanishing moments, but they are as symmetrical as possible,
% as opposed to the Daubechies filters which are highly asymmetrical.
% They are indexed by Par, which specifies the number of vanishing
% moments and is equal to half the size of the support. It ranges
% from 4 to 10.
%
% The Vaidyanathan filter gives an exact reconstruction, but does not
% satisfy any moment condition. The filter has been optimized for
% speech coding.
%
% The Battle-Lemarie filter generate spline orthogonal wavelet basis.
% The parameter Par gives the degree of the spline. The number of
% vanishing moments is Par+1.
%
% See Also
% FWT_PO, IWT_PO, FWT2_PO, IWT2_PO, WPAnalysis
%
% References
% The books by Daubechies and Wickerhauser.
%
if strcmp(Type,’Haar’),
f = [1 1] ./ sqrt(2);
end
if strcmp(Type,’Beylkin’),
f = [ .099305765374 .424215360813 .699825214057 …
.449718251149 -.110927598348 -.264497231446 …
.026900308804 .155538731877 -.017520746267 …
-.088543630623 .019679866044 .042916387274 …
-.017460408696 -.014365807969 .010040411845 …
.001484234782 -.002736031626 .000640485329 ];
end
if strcmp(Type,’Coiflet’),
if Par==1,
f = [ .038580777748 -.126969125396 -.077161555496 …
.607491641386 .745687558934 .226584265197 ];
end
if Par==2,
f = [ .016387336463 -.041464936782 -.067372554722 …
.386110066823 .812723635450 .417005184424 …
-.076488599078 -.059434418646 .023680171947 …
.005611434819 -.001823208871 -.000720549445 ];
end
if Par==3,
f = [ -.003793512864 .007782596426 .023452696142 …
-.065771911281 -.061123390003 .405176902410 …
.793777222626 .428483476378 -.071799821619 …
-.082301927106 .034555027573 .015880544864 …
-.009007976137 -.002574517688 .001117518771 …
.000466216960 -.000070983303 -.000034599773 ];
end
if Par==4,
f = [ .000892313668 -.001629492013 -.007346166328 …
.016068943964 .026682300156 -.081266699680 …
-.056077313316 .415308407030 .782238930920 …
.434386056491 -.066627474263 -.096220442034 …
.039334427123 .025082261845 -.015211731527 …
-.005658286686 .003751436157 .001266561929 …
-.000589020757 -.000259974552 .000062339034 …
.000031229876 -.000003259680 -.000001784985 ];
end
if Par==5,
f = [ -.000212080863 .000358589677 .002178236305 …
-.004159358782 -.010131117538 .023408156762 …
.028168029062 -.091920010549 -.052043163216 …
.421566206729 .774289603740 .437991626228 …
-.062035963906 -.105574208706 .041289208741 …
.032683574283 -.019761779012 -.009164231153 …
.006764185419 .002433373209 -.001662863769 …
-.000638131296 .000302259520 .000140541149 …
-.000041340484 -.000021315014 .000003734597 …
.000002063806 -.000000167408 -.000000095158 ];
end
end
if strcmp(Type,’Daubechies’),
if Par==4,
f = [ .482962913145 .836516303738 …
.224143868042 -.129409522551 ];
end
if Par==6,
f = [ .332670552950 .806891509311 …
.459877502118 -.135011020010 …
-.085441273882 .035226291882 ];
end
if Par==8,
f = [ .230377813309 .714846570553 …
.630880767930 -.027983769417 …
-.187034811719 .030841381836 …
.032883011667 -.010597401785 ];
end
if Par==10,
f = [ .160102397974 .603829269797 .724308528438 …
.138428145901 -.242294887066 -.032244869585 …
.077571493840 -.006241490213 -.012580751999 …
.003335725285 ];
end
if Par==12,
f = [ .111540743350 .494623890398 .751133908021 …
.315250351709 -.226264693965 -.129766867567 …
.097501605587 .027522865530 -.031582039317 …
.000553842201 .004777257511 -.001077301085 ];
end
if Par==14,
f = [ .077852054085 .396539319482 .729132090846 …
.469782287405 -.143906003929 -.224036184994 …
.071309219267 .080612609151 -.038029936935 …
-.016574541631 .012550998556 .000429577973 …
-.001801640704 .000353713800 ];
end
if Par==16,
f = [ .054415842243 .312871590914 .675630736297 …
.585354683654 -.015829105256 -.284015542962 …
.000472484574 .128747426620 -.017369301002 …
-.044088253931 .013981027917 .008746094047 …
-.004870352993 -.000391740373 .000675449406 …
-.000117476784 ];
end
if Par==18,
f = [ .038077947364 .243834674613 .604823123690 …
.657288078051 .133197385825 -.293273783279 …
-.096840783223 .148540749338 .030725681479 …
-.067632829061 .000250947115 .022361662124 …
-.004723204758 -.004281503682 .001847646883 …
.000230385764 -.000251963189 .000039347320 ];
end
if Par==20,
f = [ .026670057901 .188176800078 .527201188932 …
.688459039454 .281172343661 -.249846424327 …
-.195946274377 .127369340336 .093057364604 …
-.071394147166 -.029457536822 .033212674059 …
.003606553567 -.010733175483 .001395351747 …
.001992405295 -.000685856695 -.000116466855 …
.000093588670 -.000013264203 ];
end
end
if strcmp(Type,’Symmlet’),
if Par==4,
f = [ -.107148901418 -.041910965125 .703739068656 …
1.136658243408 .421234534204 -.140317624179 …
-.017824701442 .045570345896 ];
end
if Par==5,
f = [ .038654795955 .041746864422 -.055344186117 …
.281990696854 1.023052966894 .896581648380 …
.023478923136 -.247951362613 -.029842499869 …
.027632152958 ];
end
if Par==6,
f = [ .021784700327 .004936612372 -.166863215412 …
-.068323121587 .694457972958 1.113892783926 …
.477904371333 -.102724969862 -.029783751299 …
.063250562660 .002499922093 -.011031867509 ];
end
if Par==7,
f = [ .003792658534 -.001481225915 -.017870431651 …
.043155452582 .096014767936 -.070078291222 …
.024665659489 .758162601964 1.085782709814 …
.408183939725 -.198056706807 -.152463871896 …
.005671342686 .014521394762 ];
end
if Par==8,
f = [ .002672793393 -.000428394300 -.021145686528 …
.005386388754 .069490465911 -.038493521263 …
-.073462508761 .515398670374 1.099106630537 …
.680745347190 -.086653615406 -.202648655286 …
.010758611751 .044823623042 -.000766690896 …
-.004783458512 ];
end
if Par==9,
f = [ .001512487309 -.000669141509 -.014515578553 …
.012528896242 .087791251554 -.025786445930 …
-.270893783503 .049882830959 .873048407349 …
1.015259790832 .337658923602 -.077172161097 …
.000825140929 .042744433602 -.016303351226 …
-.018769396836 .000876502539 .001981193736 ];
end
if Par==10,
f = [ .001089170447 .000135245020 -.012220642630 …
-.002072363923 .064950924579 .016418869426 …
-.225558972234 -.100240215031 .667071338154 …
1.088251530500 .542813011213 -.050256540092 …
-.045240772218 .070703567550 .008152816799 …
-.028786231926 -.001137535314 .006495728375 …
.000080661204 -.000649589896 ];
end
end
if strcmp(Type,’Vaidyanathan’),
f = [ -.000062906118 .000343631905 -.000453956620 …
-.000944897136 .002843834547 .000708137504 …
-.008839103409 .003153847056 .019687215010 …
-.014853448005 -.035470398607 .038742619293 …
.055892523691 -.077709750902 -.083928884366 …
.131971661417 .135084227129 -.194450471766 …
-.263494802488 .201612161775 .635601059872 …
.572797793211 .250184129505 .045799334111 ];
end
if strcmp(Type,’Battle’),
if Par == 1,
g = [0.578163 0.280931 -0.0488618 -0.0367309 …
0.012003 0.00706442 -0.00274588 -0.00155701 …
0.000652922 0.000361781 -0.000158601 -0.0000867523
];
end
if Par == 3,
g = [0.541736 0.30683 -0.035498 -0.0778079 …
0.0226846 0.0297468 -0.0121455 -0.0127154 …
0.00614143 0.00579932 -0.00307863 -0.00274529 …
0.00154624 0.00133086 -0.000780468 -0.00065562 …
0.000395946 0.000326749 -0.000201818 -0.000164264 …
0.000103307
];
end
if Par == 5,
g = [0.528374 0.312869 -0.0261771 -0.0914068 …
0.0208414 0.0433544 -0.0148537 -0.0229951 …
0.00990635 0.0128754 -0.00639886 -0.00746848 …
0.00407882 0.00444002 -0.00258816 -0.00268646 …
0.00164132 0.00164659 -0.00104207 -0.00101912 …
0.000662836 0.000635563 -0.000422485 -0.000398759 …
0.000269842 0.000251419 -0.000172685 -0.000159168 …
0.000110709 0.000101113
];
end
l = length(g);
f = zeros(1,2*l-1);
f(l:2*l-1) = g;
f(1:l-1) = reverse(g(2:l));
end
f = f ./ norm(f); function f = MakeONFilter(Type,Par)
% MakeONFilter — Generate Orthonormal QMF Filter for Wavelet Transform
% Usage
% qmf = MakeONFilter(Type,Par)
% Inputs
% Type string, ‘Haar’, ‘Beylkin’, ‘Coiflet’, ‘Daubechies’,
% ‘Symmlet’, ‘Vaidyanathan’,’Battle’
% Par integer, it is a parameter related to the support and vanishing
% moments of the wavelets, explained below for each wavelet.
%
% Outputs
% qmf quadrature mirror filter
%
% Description
% The Haar filter (which could be considered a Daubechies-2) was the
% first wavelet, though not called as such, and is discontinuous.
%
% The Beylkin filter places roots for the frequency response function
% close to the Nyquist frequency on the real axis.
%
% The Coiflet filters are designed to give both the mother and father
% wavelets 2*Par vanishing moments; here Par may be one of 1,2,3,4 or 5.
%
% The Daubechies filters are minimal phase filters that generate wavelets
% which have a minimal support for a given number of vanishing moments.
% They are indexed by their length, Par, which may be one of
% 4,6,8,10,12,14,16,18 or 20. The number of vanishing moments is par/2.
%
% Symmlets are also wavelets within a minimum size support for a given
% number of vanishing moments, but they are as symmetrical as possible,
% as opposed to the Daubechies filters which are highly asymmetrical.
% They are indexed by Par, which specifies the number of vanishing
% moments and is equal to half the size of the support. It ranges
% from 4 to 10.
%
% The Vaidyanathan filter gives an exact reconstruction, but does not
% satisfy any moment condition. The filter has been optimized for
% speech coding.
%
% The Battle-Lemarie filter generate spline orthogonal wavelet basis.
% The parameter Par gives the degree of the spline. The number of
% vanishing moments is Par+1.
%
% See Also
% FWT_PO, IWT_PO, FWT2_PO, IWT2_PO, WPAnalysis
%
% References
% The books by Daubechies and Wickerhauser.
%
if strcmp(Type,’Haar’),
f = [1 1] ./ sqrt(2);
end
if strcmp(Type,’Beylkin’),
f = [ .099305765374 .424215360813 .699825214057 …
.449718251149 -.110927598348 -.264497231446 …
.026900308804 .155538731877 -.017520746267 …
-.088543630623 .019679866044 .042916387274 …
-.017460408696 -.014365807969 .010040411845 …
.001484234782 -.002736031626 .000640485329 ];
end
if strcmp(Type,’Coiflet’),
if Par==1,
f = [ .038580777748 -.126969125396 -.077161555496 …
.607491641386 .745687558934 .226584265197 ];
end
if Par==2,
f = [ .016387336463 -.041464936782 -.067372554722 …
.386110066823 .812723635450 .417005184424 …
-.076488599078 -.059434418646 .023680171947 …
.005611434819 -.001823208871 -.000720549445 ];
end
if Par==3,
f = [ -.003793512864 .007782596426 .023452696142 …
-.065771911281 -.061123390003 .405176902410 …
.793777222626 .428483476378 -.071799821619 …
-.082301927106 .034555027573 .015880544864 …
-.009007976137 -.002574517688 .001117518771 …
.000466216960 -.000070983303 -.000034599773 ];
end
if Par==4,
f = [ .000892313668 -.001629492013 -.007346166328 …
.016068943964 .026682300156 -.081266699680 …
-.056077313316 .415308407030 .782238930920 …
.434386056491 -.066627474263 -.096220442034 …
.039334427123 .025082261845 -.015211731527 …
-.005658286686 .003751436157 .001266561929 …
-.000589020757 -.000259974552 .000062339034 …
.000031229876 -.000003259680 -.000001784985 ];
end
if Par==5,
f = [ -.000212080863 .000358589677 .002178236305 …
-.004159358782 -.010131117538 .023408156762 …
.028168029062 -.091920010549 -.052043163216 …
.421566206729 .774289603740 .437991626228 …
-.062035963906 -.105574208706 .041289208741 …
.032683574283 -.019761779012 -.009164231153 …
.006764185419 .002433373209 -.001662863769 …
-.000638131296 .000302259520 .000140541149 …
-.000041340484 -.000021315014 .000003734597 …
.000002063806 -.000000167408 -.000000095158 ];
end
end
if strcmp(Type,’Daubechies’),
if Par==4,
f = [ .482962913145 .836516303738 …
.224143868042 -.129409522551 ];
end
if Par==6,
f = [ .332670552950 .806891509311 …
.459877502118 -.135011020010 …
-.085441273882 .035226291882 ];
end
if Par==8,
f = [ .230377813309 .714846570553 …
.630880767930 -.027983769417 …
-.187034811719 .030841381836 …
.032883011667 -.010597401785 ];
end
if Par==10,
f = [ .160102397974 .603829269797 .724308528438 …
.138428145901 -.242294887066 -.032244869585 …
.077571493840 -.006241490213 -.012580751999 …
.003335725285 ];
end
if Par==12,
f = [ .111540743350 .494623890398 .751133908021 …
.315250351709 -.226264693965 -.129766867567 …
.097501605587 .027522865530 -.031582039317 …
.000553842201 .004777257511 -.001077301085 ];
end
if Par==14,
f = [ .077852054085 .396539319482 .729132090846 …
.469782287405 -.143906003929 -.224036184994 …
.071309219267 .080612609151 -.038029936935 …
-.016574541631 .012550998556 .000429577973 …
-.001801640704 .000353713800 ];
end
if Par==16,
f = [ .054415842243 .312871590914 .675630736297 …
.585354683654 -.015829105256 -.284015542962 …
.000472484574 .128747426620 -.017369301002 …
-.044088253931 .013981027917 .008746094047 …
-.004870352993 -.000391740373 .000675449406 …
-.000117476784 ];
end
if Par==18,
f = [ .038077947364 .243834674613 .604823123690 …
.657288078051 .133197385825 -.293273783279 …
-.096840783223 .148540749338 .030725681479 …
-.067632829061 .000250947115 .022361662124 …
-.004723204758 -.004281503682 .001847646883 …
.000230385764 -.000251963189 .000039347320 ];
end
if Par==20,
f = [ .026670057901 .188176800078 .527201188932 …
.688459039454 .281172343661 -.249846424327 …
-.195946274377 .127369340336 .093057364604 …
-.071394147166 -.029457536822 .033212674059 …
.003606553567 -.010733175483 .001395351747 …
.001992405295 -.000685856695 -.000116466855 …
.000093588670 -.000013264203 ];
end
end
if strcmp(Type,’Symmlet’),
if Par==4,
f = [ -.107148901418 -.041910965125 .703739068656 …
1.136658243408 .421234534204 -.140317624179 …
-.017824701442 .045570345896 ];
end
if Par==5,
f = [ .038654795955 .041746864422 -.055344186117 …
.281990696854 1.023052966894 .896581648380 …
.023478923136 -.247951362613 -.029842499869 …
.027632152958 ];
end
if Par==6,
f = [ .021784700327 .004936612372 -.166863215412 …
-.068323121587 .694457972958 1.113892783926 …
.477904371333 -.102724969862 -.029783751299 …
.063250562660 .002499922093 -.011031867509 ];
end
if Par==7,
f = [ .003792658534 -.001481225915 -.017870431651 …
.043155452582 .096014767936 -.070078291222 …
.024665659489 .758162601964 1.085782709814 …
.408183939725 -.198056706807 -.152463871896 …
.005671342686 .014521394762 ];
end
if Par==8,
f = [ .002672793393 -.000428394300 -.021145686528 …
.005386388754 .069490465911 -.038493521263 …
-.073462508761 .515398670374 1.099106630537 …
.680745347190 -.086653615406 -.202648655286 …
.010758611751 .044823623042 -.000766690896 …
-.004783458512 ];
end
if Par==9,
f = [ .001512487309 -.000669141509 -.014515578553 …
.012528896242 .087791251554 -.025786445930 …
-.270893783503 .049882830959 .873048407349 …
1.015259790832 .337658923602 -.077172161097 …
.000825140929 .042744433602 -.016303351226 …
-.018769396836 .000876502539 .001981193736 ];
end
if Par==10,
f = [ .001089170447 .000135245020 -.012220642630 …
-.002072363923 .064950924579 .016418869426 …
-.225558972234 -.100240215031 .667071338154 …
1.088251530500 .542813011213 -.050256540092 …
-.045240772218 .070703567550 .008152816799 …
-.028786231926 -.001137535314 .006495728375 …
.000080661204 -.000649589896 ];
end
end
if strcmp(Type,’Vaidyanathan’),
f = [ -.000062906118 .000343631905 -.000453956620 …
-.000944897136 .002843834547 .000708137504 …
-.008839103409 .003153847056 .019687215010 …
-.014853448005 -.035470398607 .038742619293 …
.055892523691 -.077709750902 -.083928884366 …
.131971661417 .135084227129 -.194450471766 …
-.263494802488 .201612161775 .635601059872 …
.572797793211 .250184129505 .045799334111 ];
end
if strcmp(Type,’Battle’),
if Par == 1,
g = [0.578163 0.280931 -0.0488618 -0.0367309 …
0.012003 0.00706442 -0.00274588 -0.00155701 …
0.000652922 0.000361781 -0.000158601 -0.0000867523
];
end
if Par == 3,
g = [0.541736 0.30683 -0.035498 -0.0778079 …
0.0226846 0.0297468 -0.0121455 -0.0127154 …
0.00614143 0.00579932 -0.00307863 -0.00274529 …
0.00154624 0.00133086 -0.000780468 -0.00065562 …
0.000395946 0.000326749 -0.000201818 -0.000164264 …
0.000103307
];
end
if Par == 5,
g = [0.528374 0.312869 -0.0261771 -0.0914068 …
0.0208414 0.0433544 -0.0148537 -0.0229951 …
0.00990635 0.0128754 -0.00639886 -0.00746848 …
0.00407882 0.00444002 -0.00258816 -0.00268646 …
0.00164132 0.00164659 -0.00104207 -0.00101912 …
0.000662836 0.000635563 -0.000422485 -0.000398759 …
0.000269842 0.000251419 -0.000172685 -0.000159168 …
0.000110709 0.000101113
];
end
l = length(g);
f = zeros(1,2*l-1);
f(l:2*l-1) = g;
f(1:l-1) = reverse(g(2:l));
end
f = f ./ norm(f); curvelet MATLAB Answers — New Questions
Stl file pdegplot in App designer
Hi,
I am looking for a solution to find names of the faces after importing the stl file. pdegplot command does that but how can I use it in App Designer. I am trying the command but it throws different error. Looked for a solution but it isn’t available.
Is there any other command where i can use it to see name faces in the App designer so that i can use it to apply BC.
Thanks,
JigarHi,
I am looking for a solution to find names of the faces after importing the stl file. pdegplot command does that but how can I use it in App Designer. I am trying the command but it throws different error. Looked for a solution but it isn’t available.
Is there any other command where i can use it to see name faces in the App designer so that i can use it to apply BC.
Thanks,
Jigar Hi,
I am looking for a solution to find names of the faces after importing the stl file. pdegplot command does that but how can I use it in App Designer. I am trying the command but it throws different error. Looked for a solution but it isn’t available.
Is there any other command where i can use it to see name faces in the App designer so that i can use it to apply BC.
Thanks,
Jigar appdesigner, pdegplot, stl, pde MATLAB Answers — New Questions
MS Project and PWA
When I try to upload a new MS Project schedule into PWA, the window for PWA does not appear to type in the Project Name and view the Enterprise fields. The window that appears is a typical Save As to my computer vs PWA. I’m clearly connected to PWA as the Info option indicates it. I also don’t have the Publish feature at this point either. Strange thing is that I use to be able to upload a new schedule to PWA and now I cannot. After seeking company IT support and not being successful, I received a new laptop, hoping it would fix my issue. It fixed it for 1d. Any ideas as to why I can’t upload to PWA?
Note: I can open a project that’s on PWA via the Desktop App via Browse, show me a list of all projects.
When I try to upload a new MS Project schedule into PWA, the window for PWA does not appear to type in the Project Name and view the Enterprise fields. The window that appears is a typical Save As to my computer vs PWA. I’m clearly connected to PWA as the Info option indicates it. I also don’t have the Publish feature at this point either. Strange thing is that I use to be able to upload a new schedule to PWA and now I cannot. After seeking company IT support and not being successful, I received a new laptop, hoping it would fix my issue. It fixed it for 1d. Any ideas as to why I can’t upload to PWA? Note: I can open a project that’s on PWA via the Desktop App via Browse, show me a list of all projects. Read More
Cannot delete organisation from Teams
Hello,
I tried hundreds of times to delete (Leave) the organization I used to work for 5 years ago. It appears to be impossible to delete an organization from my account
When I try to Leave (delete), then I receive the next message
When I try to change organization in order to delete Spirit from my account
Then I receive the next message
I tried everything and numerous times and also tried contacting you before and received no answer. I need someone to help me deleting Spirit from my account PLEASE.
THANK YOU
Hello, I tried hundreds of times to delete (Leave) the organization I used to work for 5 years ago. It appears to be impossible to delete an organization from my account When I try to Leave (delete), then I receive the next message When I try to change organization in order to delete Spirit from my account Then I receive the next messageI tried everything and numerous times and also tried contacting you before and received no answer. I need someone to help me deleting Spirit from my account PLEASE. THANK YOU Read More
Raspberry Pi and Simulink setup error
Hello,
I’m trying to connect a Raspberry Pi B+ to use through Simulink. I have downloaded and installed the Simulink Support Package and connected the Raspberry to my computer using an Ethernet cable. I tested the connection with ‘ping’ at the terminal, and it’s working. While configuring the Simulink Support Package, I noticed that the interface differs from that in the tutorials. There is no option to set up hardware with the MathWorks Respbian Image. I tried to use the new interface with my Raspberry but without success. The SSH is enabled in the Raspberry, and the user and password are ok. I attached a print of the error.
Would you please give me some guidance on how to proceed?
Thanks
New interface
Interface in the totorials
ErrorHello,
I’m trying to connect a Raspberry Pi B+ to use through Simulink. I have downloaded and installed the Simulink Support Package and connected the Raspberry to my computer using an Ethernet cable. I tested the connection with ‘ping’ at the terminal, and it’s working. While configuring the Simulink Support Package, I noticed that the interface differs from that in the tutorials. There is no option to set up hardware with the MathWorks Respbian Image. I tried to use the new interface with my Raspberry but without success. The SSH is enabled in the Raspberry, and the user and password are ok. I attached a print of the error.
Would you please give me some guidance on how to proceed?
Thanks
New interface
Interface in the totorials
Error Hello,
I’m trying to connect a Raspberry Pi B+ to use through Simulink. I have downloaded and installed the Simulink Support Package and connected the Raspberry to my computer using an Ethernet cable. I tested the connection with ‘ping’ at the terminal, and it’s working. While configuring the Simulink Support Package, I noticed that the interface differs from that in the tutorials. There is no option to set up hardware with the MathWorks Respbian Image. I tried to use the new interface with my Raspberry but without success. The SSH is enabled in the Raspberry, and the user and password are ok. I attached a print of the error.
Would you please give me some guidance on how to proceed?
Thanks
New interface
Interface in the totorials
Error raspberry, simulink MATLAB Answers — New Questions
Adjacency list by a “from” vector and a “to” vector
I have 2 vectors, A and B of equal dimension. Each value of A indicates the origin element of the element given by its position. Each value of B indicates the destination element of the element given by its position. Some values of A and B are NaN, but they have the same indices (they occupy the same positions in A and B). Some values of A and B may be repeated.
For example:
A=[NaN NaN NaN NaN NaN NaN 3 2 4 4 1 5 … ];
B=[NaN NaN NaN NaN NaN NaN 1 6 2 8 9 1 … ];
I would like to get a cell array, C, that is an adjacency list of these elements. That is, a cell array where each cell is a vector with the destination elements, and its position is the origin element. In this case it would be like this:
Origin () -> Destination (find())
3 -> 7 ()
2 -> 8 ()
4 -> 9 ()
4 -> 10 ()
1 -> 11 ()
5 -> 12 ()
On the other hand:
Origin (find()) -> Destination ()
7 () -> 1
8 () -> 6
9 () -> 2
10 () -> 8
11 () -> 9
12 () -> 1
Therefore:
C={[11], [8], [7], [9, 10], [12], [1], [6], [2], [8], [9], [1], …};
I have managed to do it with “for”, but A and B are very large and it takes too long to calculate. Could it be done in batch?
Thanks in advanceI have 2 vectors, A and B of equal dimension. Each value of A indicates the origin element of the element given by its position. Each value of B indicates the destination element of the element given by its position. Some values of A and B are NaN, but they have the same indices (they occupy the same positions in A and B). Some values of A and B may be repeated.
For example:
A=[NaN NaN NaN NaN NaN NaN 3 2 4 4 1 5 … ];
B=[NaN NaN NaN NaN NaN NaN 1 6 2 8 9 1 … ];
I would like to get a cell array, C, that is an adjacency list of these elements. That is, a cell array where each cell is a vector with the destination elements, and its position is the origin element. In this case it would be like this:
Origin () -> Destination (find())
3 -> 7 ()
2 -> 8 ()
4 -> 9 ()
4 -> 10 ()
1 -> 11 ()
5 -> 12 ()
On the other hand:
Origin (find()) -> Destination ()
7 () -> 1
8 () -> 6
9 () -> 2
10 () -> 8
11 () -> 9
12 () -> 1
Therefore:
C={[11], [8], [7], [9, 10], [12], [1], [6], [2], [8], [9], [1], …};
I have managed to do it with “for”, but A and B are very large and it takes too long to calculate. Could it be done in batch?
Thanks in advance I have 2 vectors, A and B of equal dimension. Each value of A indicates the origin element of the element given by its position. Each value of B indicates the destination element of the element given by its position. Some values of A and B are NaN, but they have the same indices (they occupy the same positions in A and B). Some values of A and B may be repeated.
For example:
A=[NaN NaN NaN NaN NaN NaN 3 2 4 4 1 5 … ];
B=[NaN NaN NaN NaN NaN NaN 1 6 2 8 9 1 … ];
I would like to get a cell array, C, that is an adjacency list of these elements. That is, a cell array where each cell is a vector with the destination elements, and its position is the origin element. In this case it would be like this:
Origin () -> Destination (find())
3 -> 7 ()
2 -> 8 ()
4 -> 9 ()
4 -> 10 ()
1 -> 11 ()
5 -> 12 ()
On the other hand:
Origin (find()) -> Destination ()
7 () -> 1
8 () -> 6
9 () -> 2
10 () -> 8
11 () -> 9
12 () -> 1
Therefore:
C={[11], [8], [7], [9, 10], [12], [1], [6], [2], [8], [9], [1], …};
I have managed to do it with “for”, but A and B are very large and it takes too long to calculate. Could it be done in batch?
Thanks in advance adjacency list MATLAB Answers — New Questions
Calculating the area of the black objects in mm2
hi, i am struggling to find the area of whole black objects in the image down blown and i dont know how to convert this area from pixels to mm2hi, i am struggling to find the area of whole black objects in the image down blown and i dont know how to convert this area from pixels to mm2 hi, i am struggling to find the area of whole black objects in the image down blown and i dont know how to convert this area from pixels to mm2 image processing MATLAB Answers — New Questions
issue in calculation of wave speed
hi, i’m aiming to calculate wave speed of solution of "u_{t}=u_{xx}+u_{yy}+u-u^2" so i use first finite difference scheme but my issue is that wen i run the code i get error "unrecognized function’average speed’ how to solve that? THANKS
D = 1; % Diffusion coefficient
r = 1; % Reaction rate
Lx = 100; % Width of the domain
Ly = 100; % Height of the domain
nx = 510; % Number of grid points in x-direction
ny = 510; % Parameters
% Number of grid points in y-directionn
nt = 5000; % Number of time steps
dx = Lx / (nx-1); % Spacing of grid in x-direction
dy = Ly / (ny-1); % Spacing of grid in y-direction
C = 0.05; % Courant number
dt = C * dx; % Time step size
% Initialize concentration profile
un = zeros(ny, nx);
x = linspace(-Lx/2, Lx/2, nx);
y = linspace(-Ly/2, Ly/2, ny);
[X, Y] = meshgrid(x, y);
% Initial concentration
un(:,:,:) = exp(-X.^2 – Y.^2 );
t = 0;
% Loop over time steps
for n = 1:nt
uc = un;
t = t + dt;
for i = 2:nx-1
for j = 2:ny-1
un(j, i) = uc(j, i) +…
dt *(uc(j-1, i) – 4 * uc(j, i) + uc(j+1, i) + …
uc(j, i-1) + uc(j, i+1)) / (dy * dy) + …
dt * uc(j, i) * (1 – uc(j,i)) / (dy * dy);
end
end
% Apply Dirichlet boundary conditions
un(1,:,:) = 0;
un(end,:,:) = 0;
un(:,1,:) = 0;
un(:,end,:) = 0;
un(:,:,1) = 0;
un(:,:,end) = 0;
% Store front positions and times
if ~isempty(half_max_positions)
[front_rows, front_cols] = ind2sub(size(un), half_max_positions);
front_positions = [front_positions; (front_cols – 1) * dx];
front_times = [front_times; ones(size(front_cols)) * t];
end
end
% Calculate the speed of the wave
front_velocity = diff(front_positions) ./ diff(front_times);
% Calculate the average speed of the wave
average_speed = mean(front_velocity);
% Display the average speed of the wave
disp(‘Average speed of the wave:’);
disp(average_speed);hi, i’m aiming to calculate wave speed of solution of "u_{t}=u_{xx}+u_{yy}+u-u^2" so i use first finite difference scheme but my issue is that wen i run the code i get error "unrecognized function’average speed’ how to solve that? THANKS
D = 1; % Diffusion coefficient
r = 1; % Reaction rate
Lx = 100; % Width of the domain
Ly = 100; % Height of the domain
nx = 510; % Number of grid points in x-direction
ny = 510; % Parameters
% Number of grid points in y-directionn
nt = 5000; % Number of time steps
dx = Lx / (nx-1); % Spacing of grid in x-direction
dy = Ly / (ny-1); % Spacing of grid in y-direction
C = 0.05; % Courant number
dt = C * dx; % Time step size
% Initialize concentration profile
un = zeros(ny, nx);
x = linspace(-Lx/2, Lx/2, nx);
y = linspace(-Ly/2, Ly/2, ny);
[X, Y] = meshgrid(x, y);
% Initial concentration
un(:,:,:) = exp(-X.^2 – Y.^2 );
t = 0;
% Loop over time steps
for n = 1:nt
uc = un;
t = t + dt;
for i = 2:nx-1
for j = 2:ny-1
un(j, i) = uc(j, i) +…
dt *(uc(j-1, i) – 4 * uc(j, i) + uc(j+1, i) + …
uc(j, i-1) + uc(j, i+1)) / (dy * dy) + …
dt * uc(j, i) * (1 – uc(j,i)) / (dy * dy);
end
end
% Apply Dirichlet boundary conditions
un(1,:,:) = 0;
un(end,:,:) = 0;
un(:,1,:) = 0;
un(:,end,:) = 0;
un(:,:,1) = 0;
un(:,:,end) = 0;
% Store front positions and times
if ~isempty(half_max_positions)
[front_rows, front_cols] = ind2sub(size(un), half_max_positions);
front_positions = [front_positions; (front_cols – 1) * dx];
front_times = [front_times; ones(size(front_cols)) * t];
end
end
% Calculate the speed of the wave
front_velocity = diff(front_positions) ./ diff(front_times);
% Calculate the average speed of the wave
average_speed = mean(front_velocity);
% Display the average speed of the wave
disp(‘Average speed of the wave:’);
disp(average_speed); hi, i’m aiming to calculate wave speed of solution of "u_{t}=u_{xx}+u_{yy}+u-u^2" so i use first finite difference scheme but my issue is that wen i run the code i get error "unrecognized function’average speed’ how to solve that? THANKS
D = 1; % Diffusion coefficient
r = 1; % Reaction rate
Lx = 100; % Width of the domain
Ly = 100; % Height of the domain
nx = 510; % Number of grid points in x-direction
ny = 510; % Parameters
% Number of grid points in y-directionn
nt = 5000; % Number of time steps
dx = Lx / (nx-1); % Spacing of grid in x-direction
dy = Ly / (ny-1); % Spacing of grid in y-direction
C = 0.05; % Courant number
dt = C * dx; % Time step size
% Initialize concentration profile
un = zeros(ny, nx);
x = linspace(-Lx/2, Lx/2, nx);
y = linspace(-Ly/2, Ly/2, ny);
[X, Y] = meshgrid(x, y);
% Initial concentration
un(:,:,:) = exp(-X.^2 – Y.^2 );
t = 0;
% Loop over time steps
for n = 1:nt
uc = un;
t = t + dt;
for i = 2:nx-1
for j = 2:ny-1
un(j, i) = uc(j, i) +…
dt *(uc(j-1, i) – 4 * uc(j, i) + uc(j+1, i) + …
uc(j, i-1) + uc(j, i+1)) / (dy * dy) + …
dt * uc(j, i) * (1 – uc(j,i)) / (dy * dy);
end
end
% Apply Dirichlet boundary conditions
un(1,:,:) = 0;
un(end,:,:) = 0;
un(:,1,:) = 0;
un(:,end,:) = 0;
un(:,:,1) = 0;
un(:,:,end) = 0;
% Store front positions and times
if ~isempty(half_max_positions)
[front_rows, front_cols] = ind2sub(size(un), half_max_positions);
front_positions = [front_positions; (front_cols – 1) * dx];
front_times = [front_times; ones(size(front_cols)) * t];
end
end
% Calculate the speed of the wave
front_velocity = diff(front_positions) ./ diff(front_times);
% Calculate the average speed of the wave
average_speed = mean(front_velocity);
% Display the average speed of the wave
disp(‘Average speed of the wave:’);
disp(average_speed); transferred MATLAB Answers — New Questions
PROGRAMME FOR DESIGN OF SHAFT
I wish to write a programme for this particular question,please help me.
A line shaft rotating at 200 r.p.m. is to transmit 20 kW. The shaft may be assumedto be made of mild steel with an allowable shear stress of 42 MPa. Determine the diameter of theshaft, neglecting the bending moment on the shaft?I wish to write a programme for this particular question,please help me.
A line shaft rotating at 200 r.p.m. is to transmit 20 kW. The shaft may be assumedto be made of mild steel with an allowable shear stress of 42 MPa. Determine the diameter of theshaft, neglecting the bending moment on the shaft? I wish to write a programme for this particular question,please help me.
A line shaft rotating at 200 r.p.m. is to transmit 20 kW. The shaft may be assumedto be made of mild steel with an allowable shear stress of 42 MPa. Determine the diameter of theshaft, neglecting the bending moment on the shaft? designing, shaft, matlab, programme MATLAB Answers — New Questions
Editing a Document
Howdy everyone, I’m a Financial Advisor and I need help with one page of my document that needs to be edited. It needs to be lined up and cleaned up. I need to save the copy to a PDF. The page did not come from a word document.
Howdy everyone, I’m a Financial Advisor and I need help with one page of my document that needs to be edited. It needs to be lined up and cleaned up. I need to save the copy to a PDF. The page did not come from a word document. Read More
Windows 2022 Server Standard SHA256 Checksum
Hi everyone,
I’ve recently downloaded the Windows Server 2022 ISO from the Microsoft Evaluation Center, and I want to ensure the integrity of the file by verifying its SHA256 checksum. Unfortunately, I couldn’t find the official checksum listed anywhere on the Microsoft site or documentation.
Could any experts here guide me on where to find the official SHA256 checksum for the Windows Server 2022 ISO? Alternatively, if anyone has successfully verified their download, could you please share the checksum value and the source of verification?
I appreciate any help or insights you can provide. Thank you!
Best regards,
Richie
Hi everyone, I’ve recently downloaded the Windows Server 2022 ISO from the Microsoft Evaluation Center, and I want to ensure the integrity of the file by verifying its SHA256 checksum. Unfortunately, I couldn’t find the official checksum listed anywhere on the Microsoft site or documentation. Could any experts here guide me on where to find the official SHA256 checksum for the Windows Server 2022 ISO? Alternatively, if anyone has successfully verified their download, could you please share the checksum value and the source of verification?I appreciate any help or insights you can provide. Thank you! Best regards,Richie Read More
Got hacked a while back
Hi, you know the drill downloaded something sketch of the internet lost my Microsoft account and all the things connected to it. To be honest at first i wasn’t upset till it realized I’d lost my Minecraft account along side it due to the migration. I dont know how to get it back to be completely honest and atp im kinda miffed about it. I bought Minecraft waaay back. but im sure the receipt is still floating in my inbox somewhere. Does anyone know what to do here? I have the email that the account is connected to. Not sure of the rules so I’m not gonna just post it. But if anyone higher up see this I can definitely provide it. The reason ive taken to posting here is because i tried filling out the support form except i dont use many of the Microsoft products its requesting proof of. I didnt use outlook and I never purchased anything off the Microsoft store. If you need proof I owned the account once I’m sure I can provide it, I just hope someone who can help me sees the post
Hi, you know the drill downloaded something sketch of the internet lost my Microsoft account and all the things connected to it. To be honest at first i wasn’t upset till it realized I’d lost my Minecraft account along side it due to the migration. I dont know how to get it back to be completely honest and atp im kinda miffed about it. I bought Minecraft waaay back. but im sure the receipt is still floating in my inbox somewhere. Does anyone know what to do here? I have the email that the account is connected to. Not sure of the rules so I’m not gonna just post it. But if anyone higher up see this I can definitely provide it. The reason ive taken to posting here is because i tried filling out the support form except i dont use many of the Microsoft products its requesting proof of. I didnt use outlook and I never purchased anything off the Microsoft store. If you need proof I owned the account once I’m sure I can provide it, I just hope someone who can help me sees the post Read More
Codice referral K U C O I N: rMN4U8Y (bonus di iscrizione 700 USDT)
### Cos’è il codice di riferimento K U C O I N?
L’ultimo codice di riferimento K U C O I N per il 2024 è **rMN4U8Y**. Utilizzando questo codice, puoi usufruire di uno sconto del 40% sulle commissioni di negoziazione. Inoltre, i nuovi utenti di K U C O I N possono richiedere un premio promozionale esclusivo fino a $ 700 USDT registrandosi con il codice promozionale “rMN4U8Y”.
### Qual è il miglior codice di riferimento K U C O I N per il 2024?
Il miglior codice di riferimento K U C O I N per il 2024 è **rMN4U8Y**. Unisciti a K U C O I N utilizzando questo codice e incoraggia anche i tuoi amici a iscriversi per beneficiare di un consistente rimborso del 40% sulle commissioni di negoziazione. K U C O I N supporta il trading in Bitcoin, Ethereum e oltre 700 altre criptovalute con commissioni di trading basse, garantendo un’esperienza di trading conveniente. La piattaforma enfatizza anche la sicurezza, fornendo un ambiente di trading sicuro.
### Come utilizzare il codice di riferimento K U C O I N: rMN4U8Y
Usare il codice di riferimento K U C O I N **rMN4U8Y** è semplice e offre numerosi vantaggi. Ecco come iniziare:
1. Visita il sito ufficiale di K U C O I N.
2. Fai clic sul pulsante “Iscriviti” nell’angolo in alto a destra della home page.
3. Inserisci il tuo indirizzo email e crea una password complessa.
4. Inserisci il codice di riferimento **rMN4U8Y** nel campo “Codice di riferimento (facoltativo)”.
5. Completa il processo di registrazione seguendo le istruzioni visualizzate sullo schermo.
### Vantaggi del programma referral K U C O I N
Il programma referral K U C O I N offre numerosi vantaggi sia per i referrer che per gli arbitri:
1. **Bonus di riferimento**: inserendo il codice di riferimento **rMN4U8Y** durante la registrazione, hai diritto a ricevere un bonus equivalente a una percentuale delle tue commissioni di negoziazione. Questo funge da ricompensa per l’adesione alla piattaforma tramite il codice di riferimento.
2. **Guadagni a vita**: come utente K U C O I N, puoi invitare altri e guadagnare continuamente una percentuale delle loro commissioni di trading finché rimangono attivi sulla piattaforma. Più persone inviti, maggiori saranno i tuoi guadagni potenziali, creando un flusso di reddito passivo che integra i tuoi profitti di trading.
3. **Struttura delle commissioni a scaglioni**: K U C O I N utilizza una struttura delle commissioni a scaglioni nel suo programma di riferimento. Man mano che inviti con successo più utenti, la tua commissione aumenta, permettendoti di guadagnare ancora più entrate dai tuoi referral. Questo approccio a più livelli migliora la redditività del programma di riferimento, incoraggiando gli utenti ad espandere la propria rete e massimizzare il proprio potenziale di guadagno.
Unisciti a K U C O I N oggi con il codice referral **rMN4U8Y** e sblocca premi e bonus esclusivi!
### Cos’è il codice di riferimento K U C O I N? L’ultimo codice di riferimento K U C O I N per il 2024 è **rMN4U8Y**. Utilizzando questo codice, puoi usufruire di uno sconto del 40% sulle commissioni di negoziazione. Inoltre, i nuovi utenti di K U C O I N possono richiedere un premio promozionale esclusivo fino a $ 700 USDT registrandosi con il codice promozionale “rMN4U8Y”. ### Qual è il miglior codice di riferimento K U C O I N per il 2024?Il miglior codice di riferimento K U C O I N per il 2024 è **rMN4U8Y**. Unisciti a K U C O I N utilizzando questo codice e incoraggia anche i tuoi amici a iscriversi per beneficiare di un consistente rimborso del 40% sulle commissioni di negoziazione. K U C O I N supporta il trading in Bitcoin, Ethereum e oltre 700 altre criptovalute con commissioni di trading basse, garantendo un’esperienza di trading conveniente. La piattaforma enfatizza anche la sicurezza, fornendo un ambiente di trading sicuro. ### Come utilizzare il codice di riferimento K U C O I N: rMN4U8Y Usare il codice di riferimento K U C O I N **rMN4U8Y** è semplice e offre numerosi vantaggi. Ecco come iniziare:1. Visita il sito ufficiale di K U C O I N.2. Fai clic sul pulsante “Iscriviti” nell’angolo in alto a destra della home page.3. Inserisci il tuo indirizzo email e crea una password complessa.4. Inserisci il codice di riferimento **rMN4U8Y** nel campo “Codice di riferimento (facoltativo)”.5. Completa il processo di registrazione seguendo le istruzioni visualizzate sullo schermo.### Vantaggi del programma referral K U C O I NIl programma referral K U C O I N offre numerosi vantaggi sia per i referrer che per gli arbitri:1. **Bonus di riferimento**: inserendo il codice di riferimento **rMN4U8Y** durante la registrazione, hai diritto a ricevere un bonus equivalente a una percentuale delle tue commissioni di negoziazione. Questo funge da ricompensa per l’adesione alla piattaforma tramite il codice di riferimento.2. **Guadagni a vita**: come utente K U C O I N, puoi invitare altri e guadagnare continuamente una percentuale delle loro commissioni di trading finché rimangono attivi sulla piattaforma. Più persone inviti, maggiori saranno i tuoi guadagni potenziali, creando un flusso di reddito passivo che integra i tuoi profitti di trading.3. **Struttura delle commissioni a scaglioni**: K U C O I N utilizza una struttura delle commissioni a scaglioni nel suo programma di riferimento. Man mano che inviti con successo più utenti, la tua commissione aumenta, permettendoti di guadagnare ancora più entrate dai tuoi referral. Questo approccio a più livelli migliora la redditività del programma di riferimento, incoraggiando gli utenti ad espandere la propria rete e massimizzare il proprio potenziale di guadagno.Unisciti a K U C O I N oggi con il codice referral **rMN4U8Y** e sblocca premi e bonus esclusivi! Read More
Request for step-by-step video or tutorials for green hydrogen production from wind power including modelling, simulation and optimization
I have master’s thesis on green hydrogen production from wind power and integration with combined heat power engines including modelling, simulation and optimization. The model will be as follows:
Hydrogen will be produced from wind power or grid power via electrolyzer.
Hydrogen will be compressed if necessary and stored in the storage tank.
Hydrogen will be mixed with natural gas.
This blended gas or pure Hydrogen will be used for CHP engines to produce heat and power.
I want construct a model, simulate it and optimize it using MATLAB/Simulink.
Could you please suggest me how should I proceed, suggest me some step by step video or tutorials regarding my project??
Thanks
KayesI have master’s thesis on green hydrogen production from wind power and integration with combined heat power engines including modelling, simulation and optimization. The model will be as follows:
Hydrogen will be produced from wind power or grid power via electrolyzer.
Hydrogen will be compressed if necessary and stored in the storage tank.
Hydrogen will be mixed with natural gas.
This blended gas or pure Hydrogen will be used for CHP engines to produce heat and power.
I want construct a model, simulate it and optimize it using MATLAB/Simulink.
Could you please suggest me how should I proceed, suggest me some step by step video or tutorials regarding my project??
Thanks
Kayes I have master’s thesis on green hydrogen production from wind power and integration with combined heat power engines including modelling, simulation and optimization. The model will be as follows:
Hydrogen will be produced from wind power or grid power via electrolyzer.
Hydrogen will be compressed if necessary and stored in the storage tank.
Hydrogen will be mixed with natural gas.
This blended gas or pure Hydrogen will be used for CHP engines to produce heat and power.
I want construct a model, simulate it and optimize it using MATLAB/Simulink.
Could you please suggest me how should I proceed, suggest me some step by step video or tutorials regarding my project??
Thanks
Kayes matlab, simulink, simscape MATLAB Answers — New Questions
Use a string as a struct name
In different files, I have a struct. Each struct has the same underlying structure and variable names. But the name of each struct is different, yet predicable by the filename
I want to programatically load the files (no problem), create a string from information in the filename (no problem), and then use this string as the structname. For example (getting data in the matrix ‘age’):
filename = ‘output_setting1.mat’
structname = ‘setting1’
data = setting1.age
How can I convert structname = ‘setting1’ so I can use it as shown in the last line?In different files, I have a struct. Each struct has the same underlying structure and variable names. But the name of each struct is different, yet predicable by the filename
I want to programatically load the files (no problem), create a string from information in the filename (no problem), and then use this string as the structname. For example (getting data in the matrix ‘age’):
filename = ‘output_setting1.mat’
structname = ‘setting1’
data = setting1.age
How can I convert structname = ‘setting1’ so I can use it as shown in the last line? In different files, I have a struct. Each struct has the same underlying structure and variable names. But the name of each struct is different, yet predicable by the filename
I want to programatically load the files (no problem), create a string from information in the filename (no problem), and then use this string as the structname. For example (getting data in the matrix ‘age’):
filename = ‘output_setting1.mat’
structname = ‘setting1’
data = setting1.age
How can I convert structname = ‘setting1’ so I can use it as shown in the last line? structures, string MATLAB Answers — New Questions
Fitting a data set by optimising multiple parameters
Hello,
I am developing a model for simulating experimental data sets. Each data set corresponds to two specific variables (P and T). The model is generally represented by the following equation:
V_total = V1 + V2 + A log (a/a1) + B log (a/a2)
where a = 0:1.5:700;
The terms of V1, V2, A and B are calculated through specific equations so you can consider them constants. The coefficients of a1 and a2 are functions of P and T as follows:
a1 = x1 * P^0.5 * exp(16.95 – (5052 / T))
a2 = x2 * P^0.5 * exp(8.47 – (2526 / T))
For each data set, I want to obtain the best fitting by optimising coefficients x1 and x2.
For better understanding, here is a plot of the data set of P = 5 & T = 90. I randomly used x1 = 0.1 and x2 = 0.005.
I would be grateful if someone helps me in solving this issue.
Thank you in advance.Hello,
I am developing a model for simulating experimental data sets. Each data set corresponds to two specific variables (P and T). The model is generally represented by the following equation:
V_total = V1 + V2 + A log (a/a1) + B log (a/a2)
where a = 0:1.5:700;
The terms of V1, V2, A and B are calculated through specific equations so you can consider them constants. The coefficients of a1 and a2 are functions of P and T as follows:
a1 = x1 * P^0.5 * exp(16.95 – (5052 / T))
a2 = x2 * P^0.5 * exp(8.47 – (2526 / T))
For each data set, I want to obtain the best fitting by optimising coefficients x1 and x2.
For better understanding, here is a plot of the data set of P = 5 & T = 90. I randomly used x1 = 0.1 and x2 = 0.005.
I would be grateful if someone helps me in solving this issue.
Thank you in advance. Hello,
I am developing a model for simulating experimental data sets. Each data set corresponds to two specific variables (P and T). The model is generally represented by the following equation:
V_total = V1 + V2 + A log (a/a1) + B log (a/a2)
where a = 0:1.5:700;
The terms of V1, V2, A and B are calculated through specific equations so you can consider them constants. The coefficients of a1 and a2 are functions of P and T as follows:
a1 = x1 * P^0.5 * exp(16.95 – (5052 / T))
a2 = x2 * P^0.5 * exp(8.47 – (2526 / T))
For each data set, I want to obtain the best fitting by optimising coefficients x1 and x2.
For better understanding, here is a plot of the data set of P = 5 & T = 90. I randomly used x1 = 0.1 and x2 = 0.005.
I would be grateful if someone helps me in solving this issue.
Thank you in advance. curve fitting, optimization MATLAB Answers — New Questions
libmwlaunchermain.so file MATLAB 2019b
Good day everyone!
I am trying to run freesurfer (neuroimaging program) in a hpc. One freesufer command requires me to have the libmwlaunchermain.so file from MATLAB’s 2019b runtime under (/optnfs/freesurfer/7.4.1/MCRv97/bin/glnxa64).
I downloaded the MATLAB’s 2019b runtime here, but I can’t install it locally (and thereby get the libmwlaunchermain.so) because I have a Mac and not Linux. I don’t have root permissions in the hpc.
Question: Is there an alternative way I could get this file and then copy it into the appropiate path on the hpc? I have a valid MATLAB’s license.
Thank you!Good day everyone!
I am trying to run freesurfer (neuroimaging program) in a hpc. One freesufer command requires me to have the libmwlaunchermain.so file from MATLAB’s 2019b runtime under (/optnfs/freesurfer/7.4.1/MCRv97/bin/glnxa64).
I downloaded the MATLAB’s 2019b runtime here, but I can’t install it locally (and thereby get the libmwlaunchermain.so) because I have a Mac and not Linux. I don’t have root permissions in the hpc.
Question: Is there an alternative way I could get this file and then copy it into the appropiate path on the hpc? I have a valid MATLAB’s license.
Thank you! Good day everyone!
I am trying to run freesurfer (neuroimaging program) in a hpc. One freesufer command requires me to have the libmwlaunchermain.so file from MATLAB’s 2019b runtime under (/optnfs/freesurfer/7.4.1/MCRv97/bin/glnxa64).
I downloaded the MATLAB’s 2019b runtime here, but I can’t install it locally (and thereby get the libmwlaunchermain.so) because I have a Mac and not Linux. I don’t have root permissions in the hpc.
Question: Is there an alternative way I could get this file and then copy it into the appropiate path on the hpc? I have a valid MATLAB’s license.
Thank you! runtime, libmwlaunchermain MATLAB Answers — New Questions
calculate the area of the black colored objectes in a image
hi, sorry to bother you but it seems i have an issue over here but before i start talkin about that issue i have to say that i dont use matlab that often this is why i am still unable to solve this issue and i hope u can help me to solve it. so the problem that i am having is i got this image whit only black and white colors aka "binary image" from my desktop and i am trying to calculate the area of black colored objects and i also wanna calculate the area of the whole image,i tried solving this problem by seeing some community posts but its seems i am unable to solve it and this is why i requested your helphi, sorry to bother you but it seems i have an issue over here but before i start talkin about that issue i have to say that i dont use matlab that often this is why i am still unable to solve this issue and i hope u can help me to solve it. so the problem that i am having is i got this image whit only black and white colors aka "binary image" from my desktop and i am trying to calculate the area of black colored objects and i also wanna calculate the area of the whole image,i tried solving this problem by seeing some community posts but its seems i am unable to solve it and this is why i requested your help hi, sorry to bother you but it seems i have an issue over here but before i start talkin about that issue i have to say that i dont use matlab that often this is why i am still unable to solve this issue and i hope u can help me to solve it. so the problem that i am having is i got this image whit only black and white colors aka "binary image" from my desktop and i am trying to calculate the area of black colored objects and i also wanna calculate the area of the whole image,i tried solving this problem by seeing some community posts but its seems i am unable to solve it and this is why i requested your help image processing MATLAB Answers — New Questions