Month: September 2024
Condtional Statements
Dear Experts,
Greetings!
I have a data like below(A1:E17), In Column “F” , I need an output like this:-
Tried with IF, but too lengthy.. could you please share some other formula to achieve this..
Something like FILTER, INDEX MATCH etc..
Thanks in Advance,
Br,
Anupam
Dear Experts, Greetings! I have a data like below(A1:E17), In Column “F” , I need an output like this:-Tried with IF, but too lengthy.. could you please share some other formula to achieve this.. Something like FILTER, INDEX MATCH etc.. Thanks in Advance,Br,Anupam Read More
Show correct %-Allocation in Resource Usage for a specific project when using Resource Pool
I would like to get Percent Allocation in Resource Usage, by a specific project when I have a pool of resources and a master project using two simple projects (testP1, testP2) like the following to illustrate the point. I have the following:
And I would like to visualize the monthly percent allocation in the Resource Usage view. Considering Sept,2025 which has 168 working hours.
I created the following custom group: Group by Projects as follows, to group by project, so I can have the information I am looking for:
Note: I followed the answer from Ignacio Marin for this question: MS Project Resource Pool Usage. Then I followed the instructions from this post: View resource workloads and availability in Project desktop to add Percent Allocation in the Detail column of the Resource Usage view.
Now using this custom group I would like to get the calculation for %-Allocation for project testP1, so I filter the Project column to select just this project. I am getting the following results:
As you can see the result is as expected for Work, but not for % Allocation. For example for Res1 is working 80 hours, so its allocation should be: 80/168=48%, but the allocation cell is empty for Res1. If it is a single task, as it is for Res2, then the %-Allocation is correct: 40/168=24%. Why it is not possible to calculate the %-Allocation for Res1?
What I am doing wrong here? Is there a way to get the %-Allocation per project when using a pool of resources?
I would like to get Percent Allocation in Resource Usage, by a specific project when I have a pool of resources and a master project using two simple projects (testP1, testP2) like the following to illustrate the point. I have the following: And I would like to visualize the monthly percent allocation in the Resource Usage view. Considering Sept,2025 which has 168 working hours. I created the following custom group: Group by Projects as follows, to group by project, so I can have the information I am looking for:Note: I followed the answer from Ignacio Marin for this question: MS Project Resource Pool Usage. Then I followed the instructions from this post: View resource workloads and availability in Project desktop to add Percent Allocation in the Detail column of the Resource Usage view. Now using this custom group I would like to get the calculation for %-Allocation for project testP1, so I filter the Project column to select just this project. I am getting the following results: As you can see the result is as expected for Work, but not for % Allocation. For example for Res1 is working 80 hours, so its allocation should be: 80/168=48%, but the allocation cell is empty for Res1. If it is a single task, as it is for Res2, then the %-Allocation is correct: 40/168=24%. Why it is not possible to calculate the %-Allocation for Res1? What I am doing wrong here? Is there a way to get the %-Allocation per project when using a pool of resources? Read More
how to sort dlarrays
How to sort dlarrays like in
sort(a)
, where a is a numeric array? Is there a way of sorting next(mbq) by specifying some options in the following code?
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
next(mbq)How to sort dlarrays like in
sort(a)
, where a is a numeric array? Is there a way of sorting next(mbq) by specifying some options in the following code?
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
next(mbq) How to sort dlarrays like in
sort(a)
, where a is a numeric array? Is there a way of sorting next(mbq) by specifying some options in the following code?
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
next(mbq) deep learning MATLAB Answers — New Questions
What can I do to make the output characteristic of the network is two value, that is the implement multivariate input and multivariable output
I want to change the network structure to achieve that the predicted value of the output is two features. the net work is as follows link, but i can’t realize my idea. please help me, thank you very much. hope you have a nice day!
CNN-LSTM 时间序列预测 Matlab 单变量时间系列 – 文件交换 – MATLAB Central (mathworks.cn)I want to change the network structure to achieve that the predicted value of the output is two features. the net work is as follows link, but i can’t realize my idea. please help me, thank you very much. hope you have a nice day!
CNN-LSTM 时间序列预测 Matlab 单变量时间系列 – 文件交换 – MATLAB Central (mathworks.cn) I want to change the network structure to achieve that the predicted value of the output is two features. the net work is as follows link, but i can’t realize my idea. please help me, thank you very much. hope you have a nice day!
CNN-LSTM 时间序列预测 Matlab 单变量时间系列 – 文件交换 – MATLAB Central (mathworks.cn) neural network, cnn, lstm, signal predict, predict MATLAB Answers — New Questions
Spectrogram output versus figure
When using spectrogram to calculate power spectral density for a large dataset, the plot produced by directly running the command with no output arguments is slightly different from what I get when I run it with an output argument and plot that output myself.
For example, the following plots spectrograms for a subset of my data and compares the direct result of spectrogram with the output raster:
load(‘exampledata.mat’)
window = 10000;
noverlap = round(0.1*window);
fs = 10000;
figure(1);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
% Plot spectrogram directly from spectrogram function
s(1) = nexttile;
spectrogram(exampledata,window,noverlap,window,fs);
title(‘Original spectrogram plot (real data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
% Calculate power spectral density and plot as decibels
[~,F,T,PSD] = spectrogram(exampledata,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (real data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
% Calculate ratio of the two approaches above and plot that
PSDdiff = PSDdB_orig./PSDdB;
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
From the figures above, it looks like they produce nearly the same result, except at high frequencies (the middle figure looks more different than the first mostly due to the different color scales).
Comparing the ranges and plotting a cross-section (example spectra at a single time) from each one shows that the difference seems to be that spectrogram’s direct plotting method is cutting off local minima:
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
% Plot example spectra from each approach
figure(2);clf
subplot(2,1,1);
plot(F./1000,PSDdB(10,:),F./1000,PSDdB_orig(10,:),’–‘);
legend(‘Spectrogram output raster’,’Original spectrogram’)
title(‘Example spectra’)
xlabel(‘Frequency (kHz)’)
ylabel(‘Power/frequency (dB/Hz)’)
% zoom in on high frequency range where values differ
subplot(2,1,2,copyobj(gca,gcf))
xlim([4.75 4.85])
title(‘high frequency close-up’)
But weirdly, I can’t reproduce this with randomly generated synthetic data:
x = randn(length(exampledata),1);
figure(3);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
s(1) = nexttile;
spectrogram(x,window,noverlap,window,fs);
title(‘Original spectrogram plot (synthetic data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
[~,F,T,PSD] = spectrogram(x,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
PSDdiff = PSDdB_orig./PSDdB;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (synthetic data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
I do notice that the minimum PSD value for my data (-196 dB) is significantly lower than the minimum of the synthetic data. Is there a lower limit where spectrogram starts to censor spectra (say, around -156.5351 dB)? Or is something else going on here? Any help would be much appreciated!! Thanks!When using spectrogram to calculate power spectral density for a large dataset, the plot produced by directly running the command with no output arguments is slightly different from what I get when I run it with an output argument and plot that output myself.
For example, the following plots spectrograms for a subset of my data and compares the direct result of spectrogram with the output raster:
load(‘exampledata.mat’)
window = 10000;
noverlap = round(0.1*window);
fs = 10000;
figure(1);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
% Plot spectrogram directly from spectrogram function
s(1) = nexttile;
spectrogram(exampledata,window,noverlap,window,fs);
title(‘Original spectrogram plot (real data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
% Calculate power spectral density and plot as decibels
[~,F,T,PSD] = spectrogram(exampledata,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (real data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
% Calculate ratio of the two approaches above and plot that
PSDdiff = PSDdB_orig./PSDdB;
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
From the figures above, it looks like they produce nearly the same result, except at high frequencies (the middle figure looks more different than the first mostly due to the different color scales).
Comparing the ranges and plotting a cross-section (example spectra at a single time) from each one shows that the difference seems to be that spectrogram’s direct plotting method is cutting off local minima:
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
% Plot example spectra from each approach
figure(2);clf
subplot(2,1,1);
plot(F./1000,PSDdB(10,:),F./1000,PSDdB_orig(10,:),’–‘);
legend(‘Spectrogram output raster’,’Original spectrogram’)
title(‘Example spectra’)
xlabel(‘Frequency (kHz)’)
ylabel(‘Power/frequency (dB/Hz)’)
% zoom in on high frequency range where values differ
subplot(2,1,2,copyobj(gca,gcf))
xlim([4.75 4.85])
title(‘high frequency close-up’)
But weirdly, I can’t reproduce this with randomly generated synthetic data:
x = randn(length(exampledata),1);
figure(3);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
s(1) = nexttile;
spectrogram(x,window,noverlap,window,fs);
title(‘Original spectrogram plot (synthetic data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
[~,F,T,PSD] = spectrogram(x,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
PSDdiff = PSDdB_orig./PSDdB;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (synthetic data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
I do notice that the minimum PSD value for my data (-196 dB) is significantly lower than the minimum of the synthetic data. Is there a lower limit where spectrogram starts to censor spectra (say, around -156.5351 dB)? Or is something else going on here? Any help would be much appreciated!! Thanks! When using spectrogram to calculate power spectral density for a large dataset, the plot produced by directly running the command with no output arguments is slightly different from what I get when I run it with an output argument and plot that output myself.
For example, the following plots spectrograms for a subset of my data and compares the direct result of spectrogram with the output raster:
load(‘exampledata.mat’)
window = 10000;
noverlap = round(0.1*window);
fs = 10000;
figure(1);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
% Plot spectrogram directly from spectrogram function
s(1) = nexttile;
spectrogram(exampledata,window,noverlap,window,fs);
title(‘Original spectrogram plot (real data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
% Calculate power spectral density and plot as decibels
[~,F,T,PSD] = spectrogram(exampledata,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (real data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
% Calculate ratio of the two approaches above and plot that
PSDdiff = PSDdB_orig./PSDdB;
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
From the figures above, it looks like they produce nearly the same result, except at high frequencies (the middle figure looks more different than the first mostly due to the different color scales).
Comparing the ranges and plotting a cross-section (example spectra at a single time) from each one shows that the difference seems to be that spectrogram’s direct plotting method is cutting off local minima:
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
% Plot example spectra from each approach
figure(2);clf
subplot(2,1,1);
plot(F./1000,PSDdB(10,:),F./1000,PSDdB_orig(10,:),’–‘);
legend(‘Spectrogram output raster’,’Original spectrogram’)
title(‘Example spectra’)
xlabel(‘Frequency (kHz)’)
ylabel(‘Power/frequency (dB/Hz)’)
% zoom in on high frequency range where values differ
subplot(2,1,2,copyobj(gca,gcf))
xlim([4.75 4.85])
title(‘high frequency close-up’)
But weirdly, I can’t reproduce this with randomly generated synthetic data:
x = randn(length(exampledata),1);
figure(3);clf
t = tiledlayout(3,1, ‘TileIndexing’, ‘columnmajor’);
s(1) = nexttile;
spectrogram(x,window,noverlap,window,fs);
title(‘Original spectrogram plot (synthetic data)’)
PSDdB_orig = get(get(gca,’Children’),’CData’);
caxis([min(PSDdB_orig,[],’all’) max(PSDdB_orig,[],’all’)])
[~,F,T,PSD] = spectrogram(x,window,noverlap,window,fs);
PSDdB = (10.*log10(PSD))’;
PSDdiff = PSDdB_orig./PSDdB;
s(2) = nexttile;
imagesc(F./1000,T./60,PSDdB)
title(‘Spectrogram output raster (synthetic data)’)
c = colorbar;
caxis([min(PSDdB,[],’all’) max(PSDdB,[],’all’)])
set(get(c,’label’),’string’,’Power/frequency (dB/Hz)’,’Rotation’,90);
s(3) = nexttile;
imagesc(F./1000,T./60,PSDdiff)
title(‘Original plot data divided by output raster data’)
c = colorbar;
caxis([min(PSDdiff,[],’all’) max(PSDdiff,[],’all’)])
set(get(c,’label’),’string’,’original/output’,’Rotation’,90);
set(s(2:3),’YDir’,’normal’)
xlabel(s(2:3), s(1).XLabel.String)
ylabel(s(2:3), s(1).YLabel.String)
disp([‘min/max of original spectrogram plot: ‘,num2str(min(PSDdB_orig,[],’all’)),’, ‘,num2str(max(PSDdB_orig,[],’all’))])
disp([‘min/max of spectrogram output raster: ‘,num2str(min(PSDdB,[],’all’)),’, ‘,num2str(max(PSDdB,[],’all’))])
I do notice that the minimum PSD value for my data (-196 dB) is significantly lower than the minimum of the synthetic data. Is there a lower limit where spectrogram starts to censor spectra (say, around -156.5351 dB)? Or is something else going on here? Any help would be much appreciated!! Thanks! spectrogram, spectral analysis, signal processing MATLAB Answers — New Questions
Adding google analytics to modern sharepoint site using SPFX Extension
hi,
We have a requirement to add Google Analytics to Sharepoint Online modern site – not to Site Collection
I followed below tutorial, but when i build it, i get the following error on eval(` line of code.
https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/
eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`);
Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?
Thank you
hi,We have a requirement to add Google Analytics to Sharepoint Online modern site – not to Site CollectionI followed below tutorial, but when i build it, i get the following error on eval(` line of code.https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/ eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`); Warning-lint – src/extensions/googleanalytics/GoogleanalyticsApplicationCustomizer.ts(51,7): error no-eval: eval can be harmful. Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?Thank you Read More
M365 Summit Microsoft Cloud Engineering Bootcamp
M365 Summit Manchester 2024 – Microsoft Cloud Engineering Bootcamp Agenda is focused on building robust enterprise solutions providing zero to hero deep dive sessions on Microsoft 365, Azure, A.I., Cyber security, Power BI Data Science, Power Platform Low Code Development & Dynamics 365 Bootcamps. The Microsoft Conference will take place at University Academy 92, Brian Statham Way, Manchester M16 0PU
https://m365summit.powercommunity.com/
Track 1 – Microsoft 365 Enterprise
Track 2 – A.I. Bootcamp
Track 3 – Cyber Security
Track 4 – Azure
Track 5 – DevOps
Track 6 – Power Platform
Track 7 – PoweBI
Track 8 – Productivity & Project Management
M365 Summit Manchester 2024 – Microsoft Cloud Engineering Bootcamp Agenda is focused on building robust enterprise solutions providing zero to hero deep dive sessions on Microsoft 365, Azure, A.I., Cyber security, Power BI Data Science, Power Platform Low Code Development & Dynamics 365 Bootcamps. The Microsoft Conference will take place at University Academy 92, Brian Statham Way, Manchester M16 0PU
https://m365summit.powercommunity.com/
Track 1 – Microsoft 365 Enterprise
Track 2 – A.I. Bootcamp
Track 3 – Cyber Security
Track 4 – Azure
Track 5 – DevOps
Track 6 – Power Platform
Track 7 – PoweBI
Track 8 – Productivity & Project Management Read More
MDE logs backup suggestions
Hi All,
Given MDE stores logs for 30 days only, I am in search of ideas on where to store these logs beyond 30 days. We do not want to export the logs to Sentinel due to cost factor. Thinking of storing the logs in a Cosmos DB, however would like to know what other options do I have here.
Thank you !!
Hi All, Given MDE stores logs for 30 days only, I am in search of ideas on where to store these logs beyond 30 days. We do not want to export the logs to Sentinel due to cost factor. Thinking of storing the logs in a Cosmos DB, however would like to know what other options do I have here. Thank you !! Read More
Automatic sections breaks and hidden sections are messing with my page numbers
Hello! This is my first time posting looking for solutions, I hope I can explain my problem properly.
I was working on a document in Word when I realized all the page numbers were off as they kept restarting at 1 and I didn’t have any good reason why. After reading through a few forums here I figured out how to check for section breaks – which could reset my page count. This was the problem! And while I still can’t figure out how to delete section breaks (I have tried every version offered here, I am using a 2020 macbook air with microsoft word Version 16.88 (24081116) if that matters), I could just go through to each new section and manually change the page count formatting from “start at..” to “continue from previous”.
This did help but didn’t make sense as I didn’t create any section breaks. I think they’re being automatically created as some of my text is in 2 columns and some is not, so I think the program is just turning the columned bits into their own section. Annoying to do individually but not un-fixable, or so I thought.
I carried on for another hour or two and realized the numbers were all off again. I go to manually change all the page numbers and find that one page is on Section 5 while the next page is on Section 7 with no Section 6 to be found, disrupting the flow of my numbers once again. I’ve looked at it through draft, outline and regular view (with the print marks turned on) and there is no hint of sneaky Section 6. I’ve deleted text and moved things around and it’s still eluding me, hiding in the netherworld between those pages and taunting me with the restarted page numbers.
The screen shot below is of the dark void where Section 6 hides. This feels like a cruel prank.
I don’t want Microsoft word to break me and this has been too much time spent down a rabbit hole chasing Section 6 which should instead be spent working on my thesis. I’d like to put this out there and continue with my work in the hopes that some tech wizard can save me and my sanity. Could someone tell me how I could:
Find a way to make all page numbers ‘continue from the previous section’ automatically? I’m hoping there’s some obvious way to do this, a quick way to change them all at once rather than doing it individually and not worry about my ghost section. Find Section 6 and bring it to justiceDelete rogue sections on my computer
Hopefully this all made sense, it doesn’t to me. Thank you so much!
Hello! This is my first time posting looking for solutions, I hope I can explain my problem properly. I was working on a document in Word when I realized all the page numbers were off as they kept restarting at 1 and I didn’t have any good reason why. After reading through a few forums here I figured out how to check for section breaks – which could reset my page count. This was the problem! And while I still can’t figure out how to delete section breaks (I have tried every version offered here, I am using a 2020 macbook air with microsoft word Version 16.88 (24081116) if that matters), I could just go through to each new section and manually change the page count formatting from “start at..” to “continue from previous”. This did help but didn’t make sense as I didn’t create any section breaks. I think they’re being automatically created as some of my text is in 2 columns and some is not, so I think the program is just turning the columned bits into their own section. Annoying to do individually but not un-fixable, or so I thought. I carried on for another hour or two and realized the numbers were all off again. I go to manually change all the page numbers and find that one page is on Section 5 while the next page is on Section 7 with no Section 6 to be found, disrupting the flow of my numbers once again. I’ve looked at it through draft, outline and regular view (with the print marks turned on) and there is no hint of sneaky Section 6. I’ve deleted text and moved things around and it’s still eluding me, hiding in the netherworld between those pages and taunting me with the restarted page numbers. The screen shot below is of the dark void where Section 6 hides. This feels like a cruel prank. I don’t want Microsoft word to break me and this has been too much time spent down a rabbit hole chasing Section 6 which should instead be spent working on my thesis. I’d like to put this out there and continue with my work in the hopes that some tech wizard can save me and my sanity. Could someone tell me how I could:Find a way to make all page numbers ‘continue from the previous section’ automatically? I’m hoping there’s some obvious way to do this, a quick way to change them all at once rather than doing it individually and not worry about my ghost section. Find Section 6 and bring it to justiceDelete rogue sections on my computerHopefully this all made sense, it doesn’t to me. Thank you so much! Read More
Are there free trial versions of Defender for evaluation/training?
Hey everyone,
Just making a post to get some info regarding this. I am wanting to play around with defender potentially using a Azure Virtual machine to practise deployment and configuration of Defender on a server as well as playing around with credential guard. I’m also wanting to do this to learn how to ingest Defender logs into Splunk.
Does Microsoft offer free trial licenses for this purpose?
Thanks for any info!
Hey everyone, Just making a post to get some info regarding this. I am wanting to play around with defender potentially using a Azure Virtual machine to practise deployment and configuration of Defender on a server as well as playing around with credential guard. I’m also wanting to do this to learn how to ingest Defender logs into Splunk. Does Microsoft offer free trial licenses for this purpose? Thanks for any info! Read More
extracting overlapping portions of 2 similar tracks
hi and thanks in advance
I have cyclone tracks extracted from 2 different sources labeled as trackBom and trackRe (stored in sampleTracks.mat). I am trying to bias-correct some variables along these tracks. To do that, I need to extract the overlapping portions of the tracks. The issue is that these tracks do not exactly align in space or time. I have attached a figure showing the original tracks and the overlapping portions that I want to extract. What i want is to extract the overlapping (or almost overlapping) portions of the tracks as shown in the picture and store them as trackBomLap and trackReLap to impliment my bias correction metods.
your help is much appreciated.hi and thanks in advance
I have cyclone tracks extracted from 2 different sources labeled as trackBom and trackRe (stored in sampleTracks.mat). I am trying to bias-correct some variables along these tracks. To do that, I need to extract the overlapping portions of the tracks. The issue is that these tracks do not exactly align in space or time. I have attached a figure showing the original tracks and the overlapping portions that I want to extract. What i want is to extract the overlapping (or almost overlapping) portions of the tracks as shown in the picture and store them as trackBomLap and trackReLap to impliment my bias correction metods.
your help is much appreciated. hi and thanks in advance
I have cyclone tracks extracted from 2 different sources labeled as trackBom and trackRe (stored in sampleTracks.mat). I am trying to bias-correct some variables along these tracks. To do that, I need to extract the overlapping portions of the tracks. The issue is that these tracks do not exactly align in space or time. I have attached a figure showing the original tracks and the overlapping portions that I want to extract. What i want is to extract the overlapping (or almost overlapping) portions of the tracks as shown in the picture and store them as trackBomLap and trackReLap to impliment my bias correction metods.
your help is much appreciated. track matching MATLAB Answers — New Questions
Data is not storage when running loop
hello community
please help me to understand why data does not show when I run a loop:
I have 2 files: @Data01.mat and @Data05.mat I want to extrac data points when conditions are met’
if I run my script with Data1 all the parameters are there:
figure;plot (Epm_nEngallc0_4, IKCtl_au16_0allc, ‘.’);
but if I run my script with Data1&2 the output is different and I get less data points
I would expect to have all data poins from @Data01.mat plus @Data05.mat
please help me to see what am I doing wrong.
clear all; %
clc; %
fprintf(‘select folder containing data filesn’);
currentpath=pwd; %%
datapath=uigetdir(”,’Select Data Folder’); %%
if (datapath == 0)
fprintf(‘Data directory was not selected…script will be terminatednn’);
return
end
prompt = ‘Do you want to export data as .xlsx?’;
save_data_excel = questdlg(prompt,’Save’,’Yes’,’No’,’Yes’);
cd(datapath); %%
files=dir(‘@*.mat’); %%
num_files=length(files(:,1)); %%
for i=1:num_files
fprintf(‘Progress: %d/%dnn’,i, num_files)
load(files(i,1).name)
idx = [false; diff(xzsen__ls_0_rs_) < 0];
idx1 = [false; diff(xzsen__ls_1_rs_) < 0];
idx2 = [false; diff(xzsen__ls_2_rs_) < 0];
idx3 = [false; diff(xzsen__ls_0_rs_) < 0];
idx4 = [false; diff(xzsen__ls_1_rs_) < 0];
idx5 = [false; diff(xzsen__ls_2_rs_) < 0];
for j=1:length(time)
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
Epm_nEngallc1_3(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
Epm_nEngallc2_5(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
Epm_nEngallc0_4(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
IKCtl_au16_1allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j);
IKCtl_au16_3allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
IKCtl_au16_2allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j);
IKCtl_au16_5allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
IKCtl_au16_0allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j);
IKCtl_au16_4allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j);
end
end
endhello community
please help me to understand why data does not show when I run a loop:
I have 2 files: @Data01.mat and @Data05.mat I want to extrac data points when conditions are met’
if I run my script with Data1 all the parameters are there:
figure;plot (Epm_nEngallc0_4, IKCtl_au16_0allc, ‘.’);
but if I run my script with Data1&2 the output is different and I get less data points
I would expect to have all data poins from @Data01.mat plus @Data05.mat
please help me to see what am I doing wrong.
clear all; %
clc; %
fprintf(‘select folder containing data filesn’);
currentpath=pwd; %%
datapath=uigetdir(”,’Select Data Folder’); %%
if (datapath == 0)
fprintf(‘Data directory was not selected…script will be terminatednn’);
return
end
prompt = ‘Do you want to export data as .xlsx?’;
save_data_excel = questdlg(prompt,’Save’,’Yes’,’No’,’Yes’);
cd(datapath); %%
files=dir(‘@*.mat’); %%
num_files=length(files(:,1)); %%
for i=1:num_files
fprintf(‘Progress: %d/%dnn’,i, num_files)
load(files(i,1).name)
idx = [false; diff(xzsen__ls_0_rs_) < 0];
idx1 = [false; diff(xzsen__ls_1_rs_) < 0];
idx2 = [false; diff(xzsen__ls_2_rs_) < 0];
idx3 = [false; diff(xzsen__ls_0_rs_) < 0];
idx4 = [false; diff(xzsen__ls_1_rs_) < 0];
idx5 = [false; diff(xzsen__ls_2_rs_) < 0];
for j=1:length(time)
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
Epm_nEngallc1_3(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
Epm_nEngallc2_5(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
Epm_nEngallc0_4(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
IKCtl_au16_1allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j);
IKCtl_au16_3allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
IKCtl_au16_2allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j);
IKCtl_au16_5allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
IKCtl_au16_0allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j);
IKCtl_au16_4allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j);
end
end
end hello community
please help me to understand why data does not show when I run a loop:
I have 2 files: @Data01.mat and @Data05.mat I want to extrac data points when conditions are met’
if I run my script with Data1 all the parameters are there:
figure;plot (Epm_nEngallc0_4, IKCtl_au16_0allc, ‘.’);
but if I run my script with Data1&2 the output is different and I get less data points
I would expect to have all data poins from @Data01.mat plus @Data05.mat
please help me to see what am I doing wrong.
clear all; %
clc; %
fprintf(‘select folder containing data filesn’);
currentpath=pwd; %%
datapath=uigetdir(”,’Select Data Folder’); %%
if (datapath == 0)
fprintf(‘Data directory was not selected…script will be terminatednn’);
return
end
prompt = ‘Do you want to export data as .xlsx?’;
save_data_excel = questdlg(prompt,’Save’,’Yes’,’No’,’Yes’);
cd(datapath); %%
files=dir(‘@*.mat’); %%
num_files=length(files(:,1)); %%
for i=1:num_files
fprintf(‘Progress: %d/%dnn’,i, num_files)
load(files(i,1).name)
idx = [false; diff(xzsen__ls_0_rs_) < 0];
idx1 = [false; diff(xzsen__ls_1_rs_) < 0];
idx2 = [false; diff(xzsen__ls_2_rs_) < 0];
idx3 = [false; diff(xzsen__ls_0_rs_) < 0];
idx4 = [false; diff(xzsen__ls_1_rs_) < 0];
idx5 = [false; diff(xzsen__ls_2_rs_) < 0];
for j=1:length(time)
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
Epm_nEngallc1_3(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
Epm_nEngallc2_5(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
Epm_nEngallc0_4(j,1) = Epm_nEng(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j) > 0.165
IKCtl_au16_1allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_1_rs_(j);
IKCtl_au16_3allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_3_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j) > 0.165
IKCtl_au16_2allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_2_rs_(j);
IKCtl_au16_5allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_5_rs_(j);
end
if Epm_nEng(j) > 0 && IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j) > 0.165 && IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j) > 0.165
IKCtl_au16_0allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_0_rs_(j);
IKCtl_au16_4allc(j,1)= IKCtl_DiagRefLvlMinErr_au16__ls_4_rs_(j);
end
end
end loops, matlab MATLAB Answers — New Questions
Calculation of psnr value in RGB image. I have calculated psnr using this code. But the result obtained is a complex number. What should be the error??
if true
function PSNR = psnrgb(I,W)
[m,n,p] = size(I);
[h,w,q] = size(W);
if m ~= h || n ~= w || p~=q
error(‘Two images must have the same size.’)
end
for k=1:p
for i=1:m
for j=1:n
delta=sum(I(i,j,k)-W(i,j,k).^2);
end
end
end
delta = 1/(m*n*p) * delta ;
PSNR = 10 * log10( 255^2/delta );
end
endif true
function PSNR = psnrgb(I,W)
[m,n,p] = size(I);
[h,w,q] = size(W);
if m ~= h || n ~= w || p~=q
error(‘Two images must have the same size.’)
end
for k=1:p
for i=1:m
for j=1:n
delta=sum(I(i,j,k)-W(i,j,k).^2);
end
end
end
delta = 1/(m*n*p) * delta ;
PSNR = 10 * log10( 255^2/delta );
end
end if true
function PSNR = psnrgb(I,W)
[m,n,p] = size(I);
[h,w,q] = size(W);
if m ~= h || n ~= w || p~=q
error(‘Two images must have the same size.’)
end
for k=1:p
for i=1:m
for j=1:n
delta=sum(I(i,j,k)-W(i,j,k).^2);
end
end
end
delta = 1/(m*n*p) * delta ;
PSNR = 10 * log10( 255^2/delta );
end
end image processing, steganography MATLAB Answers — New Questions
Trouble Plotting Basic Function
I’m having difficulty getting a function to plot correctly in Matlab. The function is:
f(x) = x^3 – sin(x) – e^x
I’ve tried using the below but the graph is not how it should appear:
X = -4:0.01:10;
Y = X.^3 – (sin(X)) – (exp(X));
plot(X,Y)I’m having difficulty getting a function to plot correctly in Matlab. The function is:
f(x) = x^3 – sin(x) – e^x
I’ve tried using the below but the graph is not how it should appear:
X = -4:0.01:10;
Y = X.^3 – (sin(X)) – (exp(X));
plot(X,Y) I’m having difficulty getting a function to plot correctly in Matlab. The function is:
f(x) = x^3 – sin(x) – e^x
I’ve tried using the below but the graph is not how it should appear:
X = -4:0.01:10;
Y = X.^3 – (sin(X)) – (exp(X));
plot(X,Y) plot, function MATLAB Answers — New Questions
In_Memory_PE_File which failed the dynamic code trust verification
I am trying to deploy a LoB program for a customer that have a Windows Configuration, WDA Application Control policy setup in M365.
The program, High QA, has path and publisher allows in the policy, and it opens without issue.
The error is encountered when you open a file inside th application, nothing loads but the Event Viewer, Code Integrity/Operational catches the following error:
…InspectionManager.exe is trying to load In_Memory_PE_File which failed the dynamic code trust verification with error code 0xC0E9002.
The policy has the Dynamic Code Security option enabled.
I am hoping there is something that can be done other than turning that option off?
Thanks in advance.
I am trying to deploy a LoB program for a customer that have a Windows Configuration, WDA Application Control policy setup in M365. The program, High QA, has path and publisher allows in the policy, and it opens without issue.The error is encountered when you open a file inside th application, nothing loads but the Event Viewer, Code Integrity/Operational catches the following error: …InspectionManager.exe is trying to load In_Memory_PE_File which failed the dynamic code trust verification with error code 0xC0E9002. The policy has the Dynamic Code Security option enabled. I am hoping there is something that can be done other than turning that option off? Thanks in advance. Read More
Adding google analytics to modern sharepoint sites using SPFX Extension
hi,
We have a requirement to add Google Analytics to Sharepoint Online modern sites.
I followed below tutorial, but when i build it, i get the following error on eval(` line of code.
https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/
eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`);
Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?
Thank you
hi,We have a requirement to add Google Analytics to Sharepoint Online modern sites.I followed below tutorial, but when i build it, i get the following error on eval(` line of code.https://sharepoint.handsontek.net/2017/12/21/how-to-add-google-analytics-to-the-modern-sharepoint/ eval(`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘${trackingID}’);
`); Warning-lint – src/extensions/googleanalytics/GoogleanalyticsApplicationCustomizer.ts(51,7): error no-eval: eval can be harmful. Can any one recommend, how to either fix the above error, or some other way, to incorporate GA4 to Sharepoint site please?Thank you Read More
Chasing what is wrong with ‘dual-simplex-highs’ in linprog
I try to see why ‘dual-simplex-highs’ algorithm fails and ‘dual-simplex-legacy’ works OK on this specific LP problem of size 467.
The linear programming involves only linear equality constraints, and lower bounds x >= 0 on some components of x (but not all of them).
The Aeq size is 211 x 467 and the condion number is not high at all IMO (about 10). So I consider it is not a difficult problem numerically (?).
‘dual-simplex-legacy’ able to find the solution, however not the default algorithm ‘dual-simplex-highs’, the output does not help much what is wrong.
Can someone tell me where I could investigate further to the cause?
load(‘linprog_test.mat’)
size(Aeq)
cond(full(Aeq))
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-legacy’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt)
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-highs’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt)I try to see why ‘dual-simplex-highs’ algorithm fails and ‘dual-simplex-legacy’ works OK on this specific LP problem of size 467.
The linear programming involves only linear equality constraints, and lower bounds x >= 0 on some components of x (but not all of them).
The Aeq size is 211 x 467 and the condion number is not high at all IMO (about 10). So I consider it is not a difficult problem numerically (?).
‘dual-simplex-legacy’ able to find the solution, however not the default algorithm ‘dual-simplex-highs’, the output does not help much what is wrong.
Can someone tell me where I could investigate further to the cause?
load(‘linprog_test.mat’)
size(Aeq)
cond(full(Aeq))
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-legacy’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt)
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-highs’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt) I try to see why ‘dual-simplex-highs’ algorithm fails and ‘dual-simplex-legacy’ works OK on this specific LP problem of size 467.
The linear programming involves only linear equality constraints, and lower bounds x >= 0 on some components of x (but not all of them).
The Aeq size is 211 x 467 and the condion number is not high at all IMO (about 10). So I consider it is not a difficult problem numerically (?).
‘dual-simplex-legacy’ able to find the solution, however not the default algorithm ‘dual-simplex-highs’, the output does not help much what is wrong.
Can someone tell me where I could investigate further to the cause?
load(‘linprog_test.mat’)
size(Aeq)
cond(full(Aeq))
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-legacy’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt)
linprogopt = optimset(‘Algorithm’, ‘dual-simplex-highs’);
[lpsol, ~, exitflag, out] = linprog(c, [], [], Aeq, beq, LB, UB, linprogopt) linprog, dual-simplex-highs, failure MATLAB Answers — New Questions
Vectorizing a Simple(?) Operation
Hi all,
This might be a bit of a fruitless question but I just want to confirm there is no other method. I want to know if there is any way of vectorizing the following code:
array = [1,0,1,1,0,0,1];
for i = 2:length(array)-1
if array(i-1) ~= array(i+1)
% Generate a random bit (0 or 1)
random_bit = randi([0, 1]);
% Update the array in place
array(i) = mod(array(i) + random_bit, 2);
end
end
The array can be of any length as long as it is only fillled with 0s and 1s. The key part of the code is that I want to update the array by doing nearest neighbor checks and in such a way that the number of walls (array(i) ~= array(i+1) for i from 1 to size(array)) is constant. And it is this constrained logic of my code that leads me to believe I cannot do away with using for-loops.
The reason I wish to vectorize the code is because I will be doing monte-carlo sampling where I have a large number of these arrays and wish to update them all at the same time using the above update rule, so in the ideal scenario I wouldn’t have to use a nested for-loop to cycle through each sample.Hi all,
This might be a bit of a fruitless question but I just want to confirm there is no other method. I want to know if there is any way of vectorizing the following code:
array = [1,0,1,1,0,0,1];
for i = 2:length(array)-1
if array(i-1) ~= array(i+1)
% Generate a random bit (0 or 1)
random_bit = randi([0, 1]);
% Update the array in place
array(i) = mod(array(i) + random_bit, 2);
end
end
The array can be of any length as long as it is only fillled with 0s and 1s. The key part of the code is that I want to update the array by doing nearest neighbor checks and in such a way that the number of walls (array(i) ~= array(i+1) for i from 1 to size(array)) is constant. And it is this constrained logic of my code that leads me to believe I cannot do away with using for-loops.
The reason I wish to vectorize the code is because I will be doing monte-carlo sampling where I have a large number of these arrays and wish to update them all at the same time using the above update rule, so in the ideal scenario I wouldn’t have to use a nested for-loop to cycle through each sample. Hi all,
This might be a bit of a fruitless question but I just want to confirm there is no other method. I want to know if there is any way of vectorizing the following code:
array = [1,0,1,1,0,0,1];
for i = 2:length(array)-1
if array(i-1) ~= array(i+1)
% Generate a random bit (0 or 1)
random_bit = randi([0, 1]);
% Update the array in place
array(i) = mod(array(i) + random_bit, 2);
end
end
The array can be of any length as long as it is only fillled with 0s and 1s. The key part of the code is that I want to update the array by doing nearest neighbor checks and in such a way that the number of walls (array(i) ~= array(i+1) for i from 1 to size(array)) is constant. And it is this constrained logic of my code that leads me to believe I cannot do away with using for-loops.
The reason I wish to vectorize the code is because I will be doing monte-carlo sampling where I have a large number of these arrays and wish to update them all at the same time using the above update rule, so in the ideal scenario I wouldn’t have to use a nested for-loop to cycle through each sample. vectorization MATLAB Answers — New Questions
Why is 0.3 – 0.2 – 0.1 not equal to zero?
Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false?Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false? Why does
0.3 – 0.2 – 0.1 == 0
or
v = 0:0.1:1;
any(v == 0.3)
(or similar numbers) reply false? faqlist, floating point, limited precision, faq_fp MATLAB Answers — New Questions
I have the problem of Error Dialog.
I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24.I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24. I’m trying to open my MATLAB file but it’s doesn’t open. keep on writting this error which I don’t understand because I lasp open my file on the 23/08/24. error dialog MATLAB Answers — New Questions