Category: News
Formatting Feet and Inches in one cell
Hi all,
I am working with a spreadsheet of archived baseball team rosters (each year’s roster is contained as one sheet in the larger workbook). These were previously on paper, but are now being digitized.
The problem we are running into is with player heights (i.e. feet and inches). As you can see in the example screenshot below, heights have been typed in feet-inches format; for example the first player has a height of 5 feet, 11 inches.
However, Excel is formatting these as dates rather than heights (i.e. the first player is showing May 11 rather than simply 5-11). Although the values read correctly in this spreadsheet, it presents an issue when we ingest this data into our website, which is expecting heights in #-# format with feet and inches. Instead, for the first player the website is receiving 5/11/2023 and so on. Because of this the website disregards the height column for most players. The exception is anyone whose height doesn’t conflict with a date, for example 6 feet even (6-0).
If I change the column category to either General or Text, the values change to a random string of numbers.
Given that we have about 40 seasons worth of player rosters in this workbook, is there an efficient process that we could take this data and put it into a format suitable for importing (such as a simple 5-11, 6-3, etc)?
Thanks in advance for any insight, and happy to share additional context/details if needed.
Hi all, I am working with a spreadsheet of archived baseball team rosters (each year’s roster is contained as one sheet in the larger workbook). These were previously on paper, but are now being digitized. The problem we are running into is with player heights (i.e. feet and inches). As you can see in the example screenshot below, heights have been typed in feet-inches format; for example the first player has a height of 5 feet, 11 inches. However, Excel is formatting these as dates rather than heights (i.e. the first player is showing May 11 rather than simply 5-11). Although the values read correctly in this spreadsheet, it presents an issue when we ingest this data into our website, which is expecting heights in #-# format with feet and inches. Instead, for the first player the website is receiving 5/11/2023 and so on. Because of this the website disregards the height column for most players. The exception is anyone whose height doesn’t conflict with a date, for example 6 feet even (6-0). If I change the column category to either General or Text, the values change to a random string of numbers. Given that we have about 40 seasons worth of player rosters in this workbook, is there an efficient process that we could take this data and put it into a format suitable for importing (such as a simple 5-11, 6-3, etc)? Thanks in advance for any insight, and happy to share additional context/details if needed. Read More
Get singular sagittal slice from nifti file saved as axial slices
Hello, with the following code i’m able to retrieve a single axial slice from this nifti file of a lung CT scan. I would like to know how to be able to save a slice from another view, such as sagittal or coronal in a separate image format such at png or jpg for image processing.
L1 = load_nii(‘lung_029.nii’);
NumSlices = size(L1.img,3)
S = L1.img(:,:,125);
figure
imshow(S)
I’m using the image processing toolbox and tools for nifti and analyze image add ons.Hello, with the following code i’m able to retrieve a single axial slice from this nifti file of a lung CT scan. I would like to know how to be able to save a slice from another view, such as sagittal or coronal in a separate image format such at png or jpg for image processing.
L1 = load_nii(‘lung_029.nii’);
NumSlices = size(L1.img,3)
S = L1.img(:,:,125);
figure
imshow(S)
I’m using the image processing toolbox and tools for nifti and analyze image add ons. Hello, with the following code i’m able to retrieve a single axial slice from this nifti file of a lung CT scan. I would like to know how to be able to save a slice from another view, such as sagittal or coronal in a separate image format such at png or jpg for image processing.
L1 = load_nii(‘lung_029.nii’);
NumSlices = size(L1.img,3)
S = L1.img(:,:,125);
figure
imshow(S)
I’m using the image processing toolbox and tools for nifti and analyze image add ons. nifti, image processing, medical images MATLAB Answers — New Questions
Code not displaying figure
I was told to implement this code form a texbok, but it isn’t displaying figure like in textbook. Last lines separated by enter has display figure part
I prefer to keep it together as one code. I am very new to matlab.
close all
%image parameters
W = 400;
H = 400;
% object parameters
rho = 200;
A = 0.4;
B = 0.2;
alpha = pi /10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
function [P] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo)
gamma = atan2(yo, xo);
d = sqrt( xo * xo + yo * yo);
thetanew = theta – alpha;
snew = s – d * cos(gamma – theta);
% use translated/rotated values
s = snew;
theta = thetanew;
% find a^2 (theta)
ct = cos(theta);
st = sin(theta);
a2 = A*A*ct*ct + B*B*st*st;
atheta = sqrt(a2);
% return value if outside ellipse
P = 0;
if( abs(s) <= atheta )
% inside ellipse
P = 2 * rho * A * B / a2 * sqrt(a2 – s * s);
end
end %added
function [projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo)
thetamin = 0;
thetamax = pi;
% each row is a projection at a certain angle
projmat = zeros(ntheta, ns);
smin = -srange;
smax = srange;
dtheta = pi/(ntheta – 1);
ds = (smax – smin)/(ns – 1);
svals = smin:ds:smax;
thetavals = thetamin:dtheta:thetamax;
pn = 1;
for theta = thetavals
% calculate all points on the projection line
P = zeros(ns, 1);
ip = 1;
for s = svals
% simple ellipse
[p] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo);
P(ip) = p;
ip = ip + 1;
end
% save projection as one row of matrix
projmat(pn, 🙂 = P’;
pn = pn + 1;
end
end %added
function [b] = bpsolve(W, H, projmat, svals, thetavals)
ntheta = length(thetavals);
ns = length(svals);
srange = svals(ns);
b = zeros(H, W);
for iy = 1:H
for ix = 1:W
x = 2 * (ix – 1)/(W – 1) – 1;
y = 1 – 2 * (iy – 1)/(H – 1);
% projmat is the P values, each row is P(s) for a given theta
bsum = 0;
for itheta = 1:ntheta
theta = thetavals(itheta);
s =x*cos(theta) + y*sin(theta);
is = (s + srange)/(srange*2)*(ns – 1) + 1;
is = round(is);
if(is < 1)
is = 1;
end
if(is > ns)
is = ns;
end
Ptheta = projmat(itheta, is);
bsum = bsum + Ptheta;
end
b(iy, ix) = bsum;
end
end
% image parameters
W = 400;
H = 400;
% object parameters
% rho = 200;
A = 0.4;
B = 0.2;
alpha = pi/10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
% generate projections
[projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo); % solve using backprojection
[b] = bpsolve(W, H, projmat, svals, thetavals);
% scale for image display
b = b/max(max(b)); b = b*255;
bi = uint8(b);
figure(1);
clf
image(bi);
colormap(gray(256));
box(‘on’);
axis(‘off’);
shg;
saveas(gcf,’CompileData.png’);
end %addedI was told to implement this code form a texbok, but it isn’t displaying figure like in textbook. Last lines separated by enter has display figure part
I prefer to keep it together as one code. I am very new to matlab.
close all
%image parameters
W = 400;
H = 400;
% object parameters
rho = 200;
A = 0.4;
B = 0.2;
alpha = pi /10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
function [P] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo)
gamma = atan2(yo, xo);
d = sqrt( xo * xo + yo * yo);
thetanew = theta – alpha;
snew = s – d * cos(gamma – theta);
% use translated/rotated values
s = snew;
theta = thetanew;
% find a^2 (theta)
ct = cos(theta);
st = sin(theta);
a2 = A*A*ct*ct + B*B*st*st;
atheta = sqrt(a2);
% return value if outside ellipse
P = 0;
if( abs(s) <= atheta )
% inside ellipse
P = 2 * rho * A * B / a2 * sqrt(a2 – s * s);
end
end %added
function [projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo)
thetamin = 0;
thetamax = pi;
% each row is a projection at a certain angle
projmat = zeros(ntheta, ns);
smin = -srange;
smax = srange;
dtheta = pi/(ntheta – 1);
ds = (smax – smin)/(ns – 1);
svals = smin:ds:smax;
thetavals = thetamin:dtheta:thetamax;
pn = 1;
for theta = thetavals
% calculate all points on the projection line
P = zeros(ns, 1);
ip = 1;
for s = svals
% simple ellipse
[p] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo);
P(ip) = p;
ip = ip + 1;
end
% save projection as one row of matrix
projmat(pn, 🙂 = P’;
pn = pn + 1;
end
end %added
function [b] = bpsolve(W, H, projmat, svals, thetavals)
ntheta = length(thetavals);
ns = length(svals);
srange = svals(ns);
b = zeros(H, W);
for iy = 1:H
for ix = 1:W
x = 2 * (ix – 1)/(W – 1) – 1;
y = 1 – 2 * (iy – 1)/(H – 1);
% projmat is the P values, each row is P(s) for a given theta
bsum = 0;
for itheta = 1:ntheta
theta = thetavals(itheta);
s =x*cos(theta) + y*sin(theta);
is = (s + srange)/(srange*2)*(ns – 1) + 1;
is = round(is);
if(is < 1)
is = 1;
end
if(is > ns)
is = ns;
end
Ptheta = projmat(itheta, is);
bsum = bsum + Ptheta;
end
b(iy, ix) = bsum;
end
end
% image parameters
W = 400;
H = 400;
% object parameters
% rho = 200;
A = 0.4;
B = 0.2;
alpha = pi/10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
% generate projections
[projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo); % solve using backprojection
[b] = bpsolve(W, H, projmat, svals, thetavals);
% scale for image display
b = b/max(max(b)); b = b*255;
bi = uint8(b);
figure(1);
clf
image(bi);
colormap(gray(256));
box(‘on’);
axis(‘off’);
shg;
saveas(gcf,’CompileData.png’);
end %added I was told to implement this code form a texbok, but it isn’t displaying figure like in textbook. Last lines separated by enter has display figure part
I prefer to keep it together as one code. I am very new to matlab.
close all
%image parameters
W = 400;
H = 400;
% object parameters
rho = 200;
A = 0.4;
B = 0.2;
alpha = pi /10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
function [P] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo)
gamma = atan2(yo, xo);
d = sqrt( xo * xo + yo * yo);
thetanew = theta – alpha;
snew = s – d * cos(gamma – theta);
% use translated/rotated values
s = snew;
theta = thetanew;
% find a^2 (theta)
ct = cos(theta);
st = sin(theta);
a2 = A*A*ct*ct + B*B*st*st;
atheta = sqrt(a2);
% return value if outside ellipse
P = 0;
if( abs(s) <= atheta )
% inside ellipse
P = 2 * rho * A * B / a2 * sqrt(a2 – s * s);
end
end %added
function [projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo)
thetamin = 0;
thetamax = pi;
% each row is a projection at a certain angle
projmat = zeros(ntheta, ns);
smin = -srange;
smax = srange;
dtheta = pi/(ntheta – 1);
ds = (smax – smin)/(ns – 1);
svals = smin:ds:smax;
thetavals = thetamin:dtheta:thetamax;
pn = 1;
for theta = thetavals
% calculate all points on the projection line
P = zeros(ns, 1);
ip = 1;
for s = svals
% simple ellipse
[p] = ellipseproj(A, B, rho, theta, s, alpha, xo, yo);
P(ip) = p;
ip = ip + 1;
end
% save projection as one row of matrix
projmat(pn, 🙂 = P’;
pn = pn + 1;
end
end %added
function [b] = bpsolve(W, H, projmat, svals, thetavals)
ntheta = length(thetavals);
ns = length(svals);
srange = svals(ns);
b = zeros(H, W);
for iy = 1:H
for ix = 1:W
x = 2 * (ix – 1)/(W – 1) – 1;
y = 1 – 2 * (iy – 1)/(H – 1);
% projmat is the P values, each row is P(s) for a given theta
bsum = 0;
for itheta = 1:ntheta
theta = thetavals(itheta);
s =x*cos(theta) + y*sin(theta);
is = (s + srange)/(srange*2)*(ns – 1) + 1;
is = round(is);
if(is < 1)
is = 1;
end
if(is > ns)
is = ns;
end
Ptheta = projmat(itheta, is);
bsum = bsum + Ptheta;
end
b(iy, ix) = bsum;
end
end
% image parameters
W = 400;
H = 400;
% object parameters
% rho = 200;
A = 0.4;
B = 0.2;
alpha = pi/10;
xo = 0.3;
yo = 0.5;
% backprojection parameters
ntheta = 100;
srange = 2;
ns = 100;
% generate projections
[projmat, svals, thetavals] = …
ellipseprojmat(A, B, ntheta, ns, srange, rho, alpha, xo, yo); % solve using backprojection
[b] = bpsolve(W, H, projmat, svals, thetavals);
% scale for image display
b = b/max(max(b)); b = b*255;
bi = uint8(b);
figure(1);
clf
image(bi);
colormap(gray(256));
box(‘on’);
axis(‘off’);
shg;
saveas(gcf,’CompileData.png’);
end %added figure MATLAB Answers — New Questions
Excel PivotTable Field Selection
Every time I select a field for a pivot table, the PivotTable Fields dialogue box collapses back to its original state. I’d like to select multiple fields without having to drill to the specific field folder each time. Is there a setting that controls this? The data source is an attached database.
Every time I select a field for a pivot table, the PivotTable Fields dialogue box collapses back to its original state. I’d like to select multiple fields without having to drill to the specific field folder each time. Is there a setting that controls this? The data source is an attached database. Read More
Power Automate for Paginated Reports
I am using a Power Automate to export a paginated report from Power BI and save the file to a SharePoint folder.
The flow runs perfectly, but when the file is created in the SharePoint folder, all of the headers are changed. The paginated file name is pre-pended to the header name. Because this file needs to have specific headers for import into another system, this is breaking the process.
What do I need to do to get the file with the headers as they appear in Power BI?
Actions:
I am using a Power Automate to export a paginated report from Power BI and save the file to a SharePoint folder. The flow runs perfectly, but when the file is created in the SharePoint folder, all of the headers are changed. The paginated file name is pre-pended to the header name. Because this file needs to have specific headers for import into another system, this is breaking the process. What do I need to do to get the file with the headers as they appear in Power BI? Actions: Read More
Using intune to create application desktop shortcuts
I’m trying to use intune to push an application shortcut to the public desktop. I created an lnk file and saved it to a shared network drive. I then wrote a powershell script to copy that file to a folder on the c drive of the pc and then form that folder to the public desktop. Here is the script
——————————————————————————————————————
#Create directory to hold icon file and copy file there
New-Item -Path “c:” -Name “scut” -ItemType “directory” -Force
Copy-Item “S:ShortcutsPS1 FilesFortinet IconFortiClientVPN.lnk” -Destination “c:scutFortiClientVPN.lnk”
$TargetFile = “c:scutFortiClientVPN.lnk”
$ShortcutFile = “$env:PublicDesktopFortiClientVPN.lnk”
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)
$Shortcut.TargetPath = $TargetFile
$Shortcut.Save()
————————————————————————————————————
I wrapped the script with intunewinapp utility and created a win32 app with the file. I use this as my install command. (forti2.ps1 is my original powershell file)
————————————————————————————————————–
powershell.exe -ExecutionPolicy Bypass -file forti2.ps1
—————————————————————————————————————
My detection rule is just a custom rule that looks for the file on the desktop. When the app runs I get
“The application was not detected after installation completed successfully (0x87D1041C)” error. Any ideas what I’m missing?
I’m trying to use intune to push an application shortcut to the public desktop. I created an lnk file and saved it to a shared network drive. I then wrote a powershell script to copy that file to a folder on the c drive of the pc and then form that folder to the public desktop. Here is the script ——————————————————————————————————————#Create directory to hold icon file and copy file thereNew-Item -Path “c:” -Name “scut” -ItemType “directory” -ForceCopy-Item “S:ShortcutsPS1 FilesFortinet IconFortiClientVPN.lnk” -Destination “c:scutFortiClientVPN.lnk”$TargetFile = “c:scutFortiClientVPN.lnk”$ShortcutFile = “$env:PublicDesktopFortiClientVPN.lnk”$WScriptShell = New-Object -ComObject WScript.Shell$Shortcut = $WScriptShell.CreateShortcut($ShortcutFile)$Shortcut.TargetPath = $TargetFile$Shortcut.Save() ————————————————————————————————————I wrapped the script with intunewinapp utility and created a win32 app with the file. I use this as my install command. (forti2.ps1 is my original powershell file)————————————————————————————————————–powershell.exe -ExecutionPolicy Bypass -file forti2.ps1 ————————————————————————————————————— My detection rule is just a custom rule that looks for the file on the desktop. When the app runs I get “The application was not detected after installation completed successfully (0x87D1041C)” error. Any ideas what I’m missing? Read More
NEW Level Up CSP | M365 & Copilot Sales and Technical Bootcamps!
Level Up your skills by joining us in the upcoming Microsoft 365 and Copilot bootcamps!
We are excited to announce our new FY25 Level Up CSP Bootcamps, that are built to help CSP partners grow sales and technical capabilities and accelerate new customer acquisition, upsell and cross sell. Join us for the upcoming Microsoft 365 and Copilot bootcamps to get ready to acquire, upsell and expand with M365 Premium SKUs, Copilot and Copilot Studio. Learn more by registering today!
Level Up CSP Sales Bootcamp
1-day sales Bootcamp: Get ready to go to market and sell Microsoft 365 and Copilot
Americas/EMEA region: August 28 | 8:00 AM – 12:00 PM, Pacific Time
APAC region: September 4 | 5:00 PM – 9:00 PM, Pacific Time
Who should attend: Sellers and sales managers
Level Up CSP Pre- and Post-Sales Technical Bootcamp
2-days technical bootcamp: Secure customers with Premium SKUs, deploy Copilot and extend with Copilot Studio
Americas/EMEA region: September 11 & 12 | 7:00 AM – 11:00 AM, Pacific Time
APAC region: September 18 & 19 | 5:00 PM – 9:00 PM, Pacific Time
Who should attend: Pre and post sales, IT admins and technical staff
Register at http://aka.ms/LevelUpCSPBootcamp
NEW! We will be offering voiceover and subtitles for ten languages to support our global CSP partners.
Level Up your skills by joining us in the upcoming Microsoft 365 and Copilot bootcamps!
We are excited to announce our new FY25 Level Up CSP Bootcamps, that are built to help CSP partners grow sales and technical capabilities and accelerate new customer acquisition, upsell and cross sell. Join us for the upcoming Microsoft 365 and Copilot bootcamps to get ready to acquire, upsell and expand with M365 Premium SKUs, Copilot and Copilot Studio. Learn more by registering today!
Level Up CSP Sales Bootcamp 1-day sales Bootcamp: Get ready to go to market and sell Microsoft 365 and Copilot
Americas/EMEA region: August 28 | 8:00 AM – 12:00 PM, Pacific Time
APAC region: September 4 | 5:00 PM – 9:00 PM, Pacific Time
Who should attend: Sellers and sales managers
Level Up CSP Pre- and Post-Sales Technical Bootcamp 2-days technical bootcamp: Secure customers with Premium SKUs, deploy Copilot and extend with Copilot Studio
Americas/EMEA region: September 11 & 12 | 7:00 AM – 11:00 AM, Pacific Time APAC region: September 18 & 19 | 5:00 PM – 9:00 PM, Pacific Time
Who should attend: Pre and post sales, IT admins and technical staff Register at http://aka.ms/LevelUpCSPBootcampNEW! We will be offering voiceover and subtitles for ten languages to support our global CSP partners. Read More
Extract the information of inside and outside of a contourf
Hello everyone,
I have a single line of code, quite simple, thanks to which I get (visually) exactly what I need:
h=figure; [pippo1, pippo2]=contourf(AZ,EL,FF, [0, 0]);
where the input arguments have size 301×301. The plot I get is like this:
As you can see, the outside of the contour is not only the big cyan area, but also some small areas in the white (not filled) polygon. I need the coordinates of the outside polygon (the whole cyan region) but I couldn’t extract them from either "h" or "pippo2". Please note, I DON’T NEED the coordinates of the single contours, because if I extract XDATA and YDATA they lose the information about "the inside" and the "outside". I need to extract, in some way, a single contour that represents the whole cyan area, and another one that represents the complementary (white) one.
Thanks a lot!Hello everyone,
I have a single line of code, quite simple, thanks to which I get (visually) exactly what I need:
h=figure; [pippo1, pippo2]=contourf(AZ,EL,FF, [0, 0]);
where the input arguments have size 301×301. The plot I get is like this:
As you can see, the outside of the contour is not only the big cyan area, but also some small areas in the white (not filled) polygon. I need the coordinates of the outside polygon (the whole cyan region) but I couldn’t extract them from either "h" or "pippo2". Please note, I DON’T NEED the coordinates of the single contours, because if I extract XDATA and YDATA they lose the information about "the inside" and the "outside". I need to extract, in some way, a single contour that represents the whole cyan area, and another one that represents the complementary (white) one.
Thanks a lot! Hello everyone,
I have a single line of code, quite simple, thanks to which I get (visually) exactly what I need:
h=figure; [pippo1, pippo2]=contourf(AZ,EL,FF, [0, 0]);
where the input arguments have size 301×301. The plot I get is like this:
As you can see, the outside of the contour is not only the big cyan area, but also some small areas in the white (not filled) polygon. I need the coordinates of the outside polygon (the whole cyan region) but I couldn’t extract them from either "h" or "pippo2". Please note, I DON’T NEED the coordinates of the single contours, because if I extract XDATA and YDATA they lose the information about "the inside" and the "outside". I need to extract, in some way, a single contour that represents the whole cyan area, and another one that represents the complementary (white) one.
Thanks a lot! outside and inside of contourf MATLAB Answers — New Questions
Code Generation from script file
I need information about tool box where I can generate code for SOC Estimations using MATLAB ODE solvers in (.m) Script file.I need information about tool box where I can generate code for SOC Estimations using MATLAB ODE solvers in (.m) Script file. I need information about tool box where I can generate code for SOC Estimations using MATLAB ODE solvers in (.m) Script file. bms MATLAB Answers — New Questions
用cec2022测试函数的mexw64文件运行时报出如下错误“Error: Cannot open M_1_D2.txt for reading Error: Cannot open shift_data_1.txt for reading Error: Cannot open M_2_D2.txt for reading ”
SearchAgents_no = 30;
Max_iter = 100;
for j = 1:12
[lb,ub,dim,fobj] = Get_Functions_cec2022(j,2);
[Best_Pos_PSA,Best_Score_PSA,Convergence_curve_PSA] = PSA(SearchAgents_no,Max_iter,lb,ub,dim,fobj);
endSearchAgents_no = 30;
Max_iter = 100;
for j = 1:12
[lb,ub,dim,fobj] = Get_Functions_cec2022(j,2);
[Best_Pos_PSA,Best_Score_PSA,Convergence_curve_PSA] = PSA(SearchAgents_no,Max_iter,lb,ub,dim,fobj);
end SearchAgents_no = 30;
Max_iter = 100;
for j = 1:12
[lb,ub,dim,fobj] = Get_Functions_cec2022(j,2);
[Best_Pos_PSA,Best_Score_PSA,Convergence_curve_PSA] = PSA(SearchAgents_no,Max_iter,lb,ub,dim,fobj);
end cec2022 MATLAB Answers — New Questions
How to restore example to default
I opened a Simulink example file and made modifications before thinking of making a working copy. Now I can’t get back to the original. How can I download it again from Mathworks?I opened a Simulink example file and made modifications before thinking of making a working copy. Now I can’t get back to the original. How can I download it again from Mathworks? I opened a Simulink example file and made modifications before thinking of making a working copy. Now I can’t get back to the original. How can I download it again from Mathworks? examples MATLAB Answers — New Questions
can you add probability to a for loop?
I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around?I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around? I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around? for loop, probabilities MATLAB Answers — New Questions
Thunderbird and Microsoft Exchange server 2019 phantom folder
I am using microsoft exchange 2019 mail server.
I use Thunderbird mailbox client
And during folder transfer, deletion or renaming, phantom folders are created.
I use the imap protocol.
If I install this mailbox on another computer, the phantom folders are loaded.
There are no such problems with Outlook. Can anyone tell me what to do about this?
I am using microsoft exchange 2019 mail server.I use Thunderbird mailbox clientAnd during folder transfer, deletion or renaming, phantom folders are created.I use the imap protocol.If I install this mailbox on another computer, the phantom folders are loaded.There are no such problems with Outlook. Can anyone tell me what to do about this? Read More
How can I package the MATLAB Runtime Installer with my standalone application from a specific directory?
I am using the Application Compiler to build standalone desktop applications from my MATLAB code with MATLAB Compiler. I am using the "Runtime included in package" option to package the MATLAB Runtime with my application installer.
I am using "compiler.runtime.download" to download the ZIP-file for the MATLAB Runtime installer. However, the file is downloaded to a temporary directory. For example, the MATLAB Runtime for R2024a on Windows is downloaded to:
C:Users<username>AppDataLocalTemp<username>MCRInstaller24.1MATLAB_Runtime_R2024a_Update_4_win64.zip
After a few days, the temporary directory is cleared by my operating system, and I need to redownload it in order to package the Runtime with my application installer. How can I configure MATLAB to store the Runtime installer in a non-temporary directory to package with my standalone applications?I am using the Application Compiler to build standalone desktop applications from my MATLAB code with MATLAB Compiler. I am using the "Runtime included in package" option to package the MATLAB Runtime with my application installer.
I am using "compiler.runtime.download" to download the ZIP-file for the MATLAB Runtime installer. However, the file is downloaded to a temporary directory. For example, the MATLAB Runtime for R2024a on Windows is downloaded to:
C:Users<username>AppDataLocalTemp<username>MCRInstaller24.1MATLAB_Runtime_R2024a_Update_4_win64.zip
After a few days, the temporary directory is cleared by my operating system, and I need to redownload it in order to package the Runtime with my application installer. How can I configure MATLAB to store the Runtime installer in a non-temporary directory to package with my standalone applications? I am using the Application Compiler to build standalone desktop applications from my MATLAB code with MATLAB Compiler. I am using the "Runtime included in package" option to package the MATLAB Runtime with my application installer.
I am using "compiler.runtime.download" to download the ZIP-file for the MATLAB Runtime installer. However, the file is downloaded to a temporary directory. For example, the MATLAB Runtime for R2024a on Windows is downloaded to:
C:Users<username>AppDataLocalTemp<username>MCRInstaller24.1MATLAB_Runtime_R2024a_Update_4_win64.zip
After a few days, the temporary directory is cleared by my operating system, and I need to redownload it in order to package the Runtime with my application installer. How can I configure MATLAB to store the Runtime installer in a non-temporary directory to package with my standalone applications? applicationcompiler, matlabruntimeinstaller MATLAB Answers — New Questions
Contourf: fill inside instead of outside
Hi, how can I fill the area within the circle? At the moment Matlab fills the area outside. I would like the outside to be white and the inside to be filled. Thanks.
relamdt=-4:0.1:4;
imlamdt=-4:0.1:4;
[x,y]=meshgrid(relamdt,imlamdt);
axis square;
lamdt=x+i*y;
sig = (1 + lamdt);
v = [1,1];
contourf(x,y,abs(sig),v)Hi, how can I fill the area within the circle? At the moment Matlab fills the area outside. I would like the outside to be white and the inside to be filled. Thanks.
relamdt=-4:0.1:4;
imlamdt=-4:0.1:4;
[x,y]=meshgrid(relamdt,imlamdt);
axis square;
lamdt=x+i*y;
sig = (1 + lamdt);
v = [1,1];
contourf(x,y,abs(sig),v) Hi, how can I fill the area within the circle? At the moment Matlab fills the area outside. I would like the outside to be white and the inside to be filled. Thanks.
relamdt=-4:0.1:4;
imlamdt=-4:0.1:4;
[x,y]=meshgrid(relamdt,imlamdt);
axis square;
lamdt=x+i*y;
sig = (1 + lamdt);
v = [1,1];
contourf(x,y,abs(sig),v) contour, fill MATLAB Answers — New Questions
Simulink outputs variables but they are not being sent to the workspace.
While using my PC at home I am using ‘to workspace’ blocks in my diagram with save format array. When I run the simulation i get the following the the command window:
ans =
Simulink.SimulationOutput:
Vin: [2002×1 double]
Vout: [2002×1 double]
t: [2002×1 double]
tout: [2002×1 double]
SimulationMetadata: [1×1 Simulink.SimulationMetadata]
ErrorMessage: [0x0 char]
Undefined function or variable ‘t’.
Error in P1_2 (line 79)
plot(t,Vin,t,Vout)
It seems to me that simulink is outputting the variables but they are not appearing in the workspace and therefore it thinks they are undefined. I tried running the simulation on a computer at my university and it worked. I tried reinstalling Matlab on my home PC and it still doesnt work. Version 2019.While using my PC at home I am using ‘to workspace’ blocks in my diagram with save format array. When I run the simulation i get the following the the command window:
ans =
Simulink.SimulationOutput:
Vin: [2002×1 double]
Vout: [2002×1 double]
t: [2002×1 double]
tout: [2002×1 double]
SimulationMetadata: [1×1 Simulink.SimulationMetadata]
ErrorMessage: [0x0 char]
Undefined function or variable ‘t’.
Error in P1_2 (line 79)
plot(t,Vin,t,Vout)
It seems to me that simulink is outputting the variables but they are not appearing in the workspace and therefore it thinks they are undefined. I tried running the simulation on a computer at my university and it worked. I tried reinstalling Matlab on my home PC and it still doesnt work. Version 2019. While using my PC at home I am using ‘to workspace’ blocks in my diagram with save format array. When I run the simulation i get the following the the command window:
ans =
Simulink.SimulationOutput:
Vin: [2002×1 double]
Vout: [2002×1 double]
t: [2002×1 double]
tout: [2002×1 double]
SimulationMetadata: [1×1 Simulink.SimulationMetadata]
ErrorMessage: [0x0 char]
Undefined function or variable ‘t’.
Error in P1_2 (line 79)
plot(t,Vin,t,Vout)
It seems to me that simulink is outputting the variables but they are not appearing in the workspace and therefore it thinks they are undefined. I tried running the simulation on a computer at my university and it worked. I tried reinstalling Matlab on my home PC and it still doesnt work. Version 2019. workspace, simulink MATLAB Answers — New Questions
how to write a code on matlab for a function that runs until she gets a regional answer
hi everyone!
i have a code i need to write-
i need to write a function that gets from the user amount of money he has and ask him how much money he wants to bet on.
the function needs to check that the value is regional and make sense and afterwards, if the value is good it will stop running, is isnt it will keep running until the user will insert regional value.
so far i wrote this- and its working but i dont know how to make the function keep running till the value is good
could use your help it will be helpful
thanx
function betamount = bet(money)
betamount= input(‘on what amount do you want to bet on?: ‘);
if ~isnumeric(betamount)|| betamount<=0 || betamount>money
disp(‘the betamount is invaild, try again’);
end
endhi everyone!
i have a code i need to write-
i need to write a function that gets from the user amount of money he has and ask him how much money he wants to bet on.
the function needs to check that the value is regional and make sense and afterwards, if the value is good it will stop running, is isnt it will keep running until the user will insert regional value.
so far i wrote this- and its working but i dont know how to make the function keep running till the value is good
could use your help it will be helpful
thanx
function betamount = bet(money)
betamount= input(‘on what amount do you want to bet on?: ‘);
if ~isnumeric(betamount)|| betamount<=0 || betamount>money
disp(‘the betamount is invaild, try again’);
end
end hi everyone!
i have a code i need to write-
i need to write a function that gets from the user amount of money he has and ask him how much money he wants to bet on.
the function needs to check that the value is regional and make sense and afterwards, if the value is good it will stop running, is isnt it will keep running until the user will insert regional value.
so far i wrote this- and its working but i dont know how to make the function keep running till the value is good
could use your help it will be helpful
thanx
function betamount = bet(money)
betamount= input(‘on what amount do you want to bet on?: ‘);
if ~isnumeric(betamount)|| betamount<=0 || betamount>money
disp(‘the betamount is invaild, try again’);
end
end function, functions, loop, if statement, while loop MATLAB Answers — New Questions
JS Link field on Views and CEWP option suddenly disappeared from SharePoint site
Hello
Please i need your help on this issue.
Yesterday we noticed that the JSLink option is not visible anymore when we edit view web parts
We also saw that we are not able to add CEWP anymore on pages…
Hello Please i need your help on this issue. Yesterday we noticed that the JSLink option is not visible anymore when we edit view web partsWe also saw that we are not able to add CEWP anymore on pages… Read More
Scrollable Tables
I can take a table of data, create a new table with a scroll bar and bring it each line using offset from the original table.
The issue is if I turn on the table total column at the bottom and use count, count only returns the rows that can be seen in the scrollable window which is 20. But there are 100 rows of data in it, I need to figure out how to get count to return 100.
Any ideas?
I can take a table of data, create a new table with a scroll bar and bring it each line using offset from the original table. The issue is if I turn on the table total column at the bottom and use count, count only returns the rows that can be seen in the scrollable window which is 20. But there are 100 rows of data in it, I need to figure out how to get count to return 100. Any ideas? Read More
Excel: Keep cell formatting in a drop down list data validation??
Is it possible to keep cell formatting (bold & colored font) in a drop down box from a data validation list?
Is it possible to keep cell formatting (bold & colored font) in a drop down box from a data validation list? Read More