Author: PuTI
Why isn’t this breaking the loop?
I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script.I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script. I have tried to use an ouptut argument to make a variable and use that variable in my main script, however when it is returning the value I want, it still isnt breaking the while loop?
Code for the function:
function continueChoice = cont()
continueChoice = listdlg("SelectionMode", "single", "ListString", ["Continue", "Exit"], "PromptString", "Would you like another statistic?")
end
Code in the main script:
data = readtable(‘alltimeteams.xlsx’,’VariableNamingRule’,’preserve’);
x = 0
while le(x,210)
x = x+1
choice=listdlg(‘SelectionMode’,’single’, ‘ListString’,data.Franchise,’PromptString’,’Please choose a franchise’); % all possible franchises
if isempty(choice)
fprintf("Please choose a franchise next time n")
break; % Exit the loop if no franchise is chosen
end
% the following is the problematic part
Wpercentchoice = listdlg("SelectionMode","single","PromptString","Would you like the win%?","ListString",["Yes","No"]);
if Wpercentchoice == 1
WinPercentcalc(data,choice); % calculates the overall win percentage (seperate function)
cont()
end
if isempty(continueChoice)
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
elseif continueChoice == 2
fprintf("Thank you!") % exit the loop if another statistic is not wanted
break;
end
This is what shows in the command window after selecting "exit" in the listdlg
continueChoice =
2
ans =
2
continueChoice is 2, so shouldnt it work? It just carries on with the rest of my code instead.
Please lmk if any more info is needed.
P.S the reason I’ve made a function which is so short is because one of the criteria for the project im doing is that it has to have a function which has an ouptut argument and this is the only thing I could make one for , I understand it’d be a lot easier just doing it in the main script. function, output, if statement MATLAB Answers — New Questions
effects of ifft2(x, ‘symmetric’) while x is not conjugate symmetric
Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance.Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance. Hi all,
I understand that ‘symmetric’ in ifft2 assumes data is conjugate symmetric and will output real values, but I want to know how exactly is this done. Specifically:
with ‘symmetric’, will only half of the data be used or still the whole matrix is used, but just output real values?
if x is not conjugate symmetric but I still pass in ‘symmetric’, what will happen?
Thanks in advance. fft MATLAB Answers — New Questions
How to find rates of return to baseline after peaks, in temperature data over long timecourse?
Hello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data pointsHello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data points Hello all, new MatLab user here, find the tutorials and documentation very useful so far! I am trying to evaluate the performance of a freezer in my lab. I wish to know the rate at which it cools back down to its setpoint after a spike in temperature. I want to be able to determine these rates for events over two years
I’ve been able to import the data into matlab as a table with the datetime and temperature, and then use the "find local extrema" task to identify the peaks. But I am now stuck on how I can find the rates of change after these peaks in an automated fashion. I also converted the data into timetables and tried doing this in the Signal Analyzer app. Would anyone be able to point me in the right direction?
I’ve included a plot to provide an idea of the data I’m working with. This plot has ~250,000 data points curve fitting, signal processing, help MATLAB Answers — New Questions
Does MATLAB have functions to generate, manipulate and visualize HEALPix (Hierarchical Equal Area isoLatitude Pixelization) data?
I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data?I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data? I would like to use MATLAB to work with and visualize HEALPix data (described in the HEALPix landing page).
Does MATLAB have any functions that can handle such data? healpix, equal, area, map, grid, pixel MATLAB Answers — New Questions
[Simscape] Create a new two-phase fluid as a combination of two existing fluid types
Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing?Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing? Hi everyone,
I’m trying to run a test with R-513a, which doesn’t currently exist on the 2P fluid properties block, however, the two fluids which it is a mixture of R-1234yf and R-134a do. Is there a way to leverage the twoPhaseFluidTables function to add this particular refrigerant to simscape for testing? simscape, fluids, refrigeration, simulink MATLAB Answers — New Questions
Is There a Way to Create a Sequence of Polar Plots in a Tiled Layout Using arrayfun with an Anonymous Function?
Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function?Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function? Sample data
s.th = pi/4:pi/4:2*pi;
s.r = [19 6 12 18 16 11 15 15];
s(2) = s(1); s(2).th = s(2).th*1.3;
If I want to make two plots in a tiled layout with Axes I can do this
figure
t = tiledlayout(1,2);
arrayfun(@(s) scatter(nexttile,s.th,s.r),s)
However, if I want to make polar scatter plots
figure
t = tiledlayout(1,2);
try
arrayfun(@(s) polarscatter(nexttile,s.th,s.r),s)
catch ME
ME.message
end
Right. nextile does not return a PolarAxes object.
But there doesn’t seem to be a way to force nexttile to create a PolarAxes nor can I find a function like a hypothetical nextpolar to use as the first argument to polarscatter.
Instead, as best I can tell a loop is required
figure
t = tiledlayout(1,2);
for ii = 1:2
h1 = nexttile;
polarscatter(s(ii).th,s(ii).r)
end
What’s interesting here is that nexttile creates an Axes and then deep in the bowels of polarscatter a PolarAxes is created based on some properties of that Axes, and then Axes is deleted
h1
Is there a way to create a sequence of polar plots in a tiled layout using arrayfun with an anonymous function? polar plot, arrayfun, tiled layout MATLAB Answers — New Questions
Incompatible array sizes error in hppcTest
Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“`Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“` Hello team,
I am using the Simscape battery toolbox to estimate ECM Parameters from HPPC test data following the similar example provided.
When I load my hppc data, and run hppcTest, I get the error Arrays have incompatible sizes for this operation.
The data has many pulses. However, when I choose only data for 1 pulse, it works fine.
Here is my code snippet –
“`
% Load the CSV file
data = readtable(‘240419_1C_Disharge_HPPC_25.csv’);
% Create simple table with renamed columns
hppcData = table(data.Ch7_Time_Second_, data.Ch7_Voltage_V_, data.Ch7_Current_A_, …
‘VariableNames’, {‘Time’, ‘Voltage’, ‘Current’});
% Display to verify
disp(‘Table created:’);
disp(head(hppcData));
disp(‘Size of table:’);
disp(size(hppcData));
% Create hppcTest object
hppcExp25degC = hppcTest(hppcData, …
‘TimeVariable’, ‘Time’, …
‘VoltageVariable’, ‘Voltage’, …
‘CurrentVariable’, ‘Current’, …
‘Capacity’, 50, …
‘InitialSOC’, 1.0);
“` simscape, hppc, ecm MATLAB Answers — New Questions
Prescribed time disturbance observer does not estimate in prescribed settling time.
Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.*Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.* Hi, I hope you are feeling well. I have designed a prescribed time disturbance observer based on the idea that was used to design a prescribed time controller. First, I have apllied the controller to a first order and then to a third order system.
*The problem I have is that the disturbance observer does not work in a prescribed time, I change the settling time, but it still works in a fixed settling time that is around 1.5 seconds. I have attached the simulink model here. I really appreciate your help if you can tell me how I can solve the problem.* control, disturbance observer, prescribed time MATLAB Answers — New Questions
HDF5 Library error
Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name);Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name); Hi,
I recently moved to matlab 2022a and without touching the code an error arrised. Indeed when trying to create a paraview file (h5), I get the following error. Is it a known issue of the new version ?
Error using hdf5lib2
Unable to open the file because of HDF5 Library error. Reason:Unknown
Error in H5F.open (line 130)
file_id = H5ML.hdf5lib2(‘H5Fopen’, filename, flags, fapl, is_remote);
Error in h5write (line 108)
file_id = H5F.open(Filename,flags,fapl);
Error in xdmf3writer>h5creation (line 85)
h5write(sprintf(‘%s.h5′,filename),’/Geometry’,Grid.geometry’);
Error in xdmf3writer (line 13)
h5creation(filepath,Grid);
Error in save_xdmf (line 33)
xdmf3writer(sprintf(‘%s-%d’,filename,id_model),Grids);
Error in paraview_save (line 49)
save_xdmf(model,result,file_name); h5 file, paraview export, hdf5lib2, h5f.open MATLAB Answers — New Questions
First value of an array does not display with a decimal
I am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
endI am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
end I am trying to print an array which display the values of x y and z on every change of x and z, but the first value os always formated a different way if z is an integer. Here is the awnser I get:
And here is my code:
zp=input(‘Įveskite pradinę z vertę: ‘);
zg=input(‘Įveskite galutinę z vertę: ‘);
hz=input(‘Įveskite z vertės pokytį: ‘);
xp=4;
hx=0.3;
x=xp;
disp(‘ x y z’);
for z=zp:hz:zg
if z>=x
y=sin(x).*cos(x);
else
y=log10(xp).*log(z);
end
disp([x y z]);
x=x+hx;
end display, format, decimal, array MATLAB Answers — New Questions
Change value of stream mass flow in HYSYS using matlab
I want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please helpI want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please help I want to set the value of stream ‘PFD136’ to flow_136. Seems I have a syntax error. Please help hysys, hysysinterface, setvalue MATLAB Answers — New Questions
License Manager Error -114
License checkout failed
License Manager Error -114License checkout failed
License Manager Error -114 License checkout failed
License Manager Error -114 simulink, license MATLAB Answers — New Questions
Help, how to make a buck chopper simulation using SCR only ?
i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ?i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ? i want to know how to make a buck chopper simulation in MATLAB using only SCR without mosfet/IGBT is it possible ? buck, chopper MATLAB Answers — New Questions
How do I contact the authors of the blog “Generative AI + Robotics = Awesome!”
The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors.The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors. The blog Generative AI + Robotics = Awesome! says "you can reach out to us directly to request trial code access" yet there is no details of whom to contact or how. I feel I may be missing something obvious. Can anybody help me to get in contact with the Authors. robotics vla blog. MATLAB Answers — New Questions
Simulink Hanging when I try to save a simple model
Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this?Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this? Version: MATLAB_R2025b
Laptop: Macbook Pro M3 Max
I just started learning to use MATLAB and Simulink. I am on a Macbook pro M3 Max (36GB of RAM, 14 CPU cores). MATLAB is the first program I have had on this laptop to be so slow and unresponsive.
I have found workarounds for many of the problems I faced, but when I try to save a very basic Simulink model (see photo), both MATLAB and Simulink become unresponsive (see photo) and I have to force quit and restart just to be able to do anything. Can I get some help with this? simulink, save, model MATLAB Answers — New Questions
How can I view the Speedgoat target screen and system log on my host computer?
Can I view the display connected to my Speedgoat target on my host computer to monitor the Simulink Real-Time (SLRT) simulation and take screenshots?Can I view the display connected to my Speedgoat target on my host computer to monitor the Simulink Real-Time (SLRT) simulation and take screenshots? Can I view the display connected to my Speedgoat target on my host computer to monitor the Simulink Real-Time (SLRT) simulation and take screenshots? slrt, targetscreen, statusmonitor, systemlog, console, log MATLAB Answers — New Questions
The single function is not behaving as expected
I’m trying to use single to save disk space because my files are very large. I know it could affect the precision if my numbers have many places after the decimal point. However, it is altering my integers as well.
>> single(340580097)
ans =
340580096.00
Is this a bug?I’m trying to use single to save disk space because my files are very large. I know it could affect the precision if my numbers have many places after the decimal point. However, it is altering my integers as well.
>> single(340580097)
ans =
340580096.00
Is this a bug? I’m trying to use single to save disk space because my files are very large. I know it could affect the precision if my numbers have many places after the decimal point. However, it is altering my integers as well.
>> single(340580097)
ans =
340580096.00
Is this a bug? single MATLAB Answers — New Questions
I am unable to make the new vesion of spectrumAnalyzer show distortion measurements.
I have a Matlab script that has worked fine in R2021b and earlier which I still use today. It simply reads my audio on a Macbook Pro running MacOS 12 and presents a spectrum on the analyzer. Moving that script to the new R2025b and modifying the script to call the new spectrum analyzer seems to work to present the spectrum but when I select "Measurements" and "Distortion" the distortion data appears but does not seem to find the main tone and in-turn the harmonics. I am stuck using the old version of Matlab since that works. I think I may be missing a configuration command on the new analyzer that wasn’t required on the old one. The tone below is on CH1 and CH2 identically. CH2 appears in front of CH1.I have a Matlab script that has worked fine in R2021b and earlier which I still use today. It simply reads my audio on a Macbook Pro running MacOS 12 and presents a spectrum on the analyzer. Moving that script to the new R2025b and modifying the script to call the new spectrum analyzer seems to work to present the spectrum but when I select "Measurements" and "Distortion" the distortion data appears but does not seem to find the main tone and in-turn the harmonics. I am stuck using the old version of Matlab since that works. I think I may be missing a configuration command on the new analyzer that wasn’t required on the old one. The tone below is on CH1 and CH2 identically. CH2 appears in front of CH1. I have a Matlab script that has worked fine in R2021b and earlier which I still use today. It simply reads my audio on a Macbook Pro running MacOS 12 and presents a spectrum on the analyzer. Moving that script to the new R2025b and modifying the script to call the new spectrum analyzer seems to work to present the spectrum but when I select "Measurements" and "Distortion" the distortion data appears but does not seem to find the main tone and in-turn the harmonics. I am stuck using the old version of Matlab since that works. I think I may be missing a configuration command on the new analyzer that wasn’t required on the old one. The tone below is on CH1 and CH2 identically. CH2 appears in front of CH1. spectrumanalyzer MATLAB Answers — New Questions
Generate Graph Nodes and add buttondown callbacks for interactivity
I’m trying to create a graph that brings up a dialogue box when one of the nodes is clicked. I use
NodeTable = table(‘Size’,[0 4],’VariableTypes’,{‘double’,’string’,’double’,’double’}, …
‘VariableNames’,{‘Code’,’Name’,’Latitude’,’Longitude’});
EdgeTable = table(‘Size’,[0 2],’VariableTypes’,{‘cell’, ‘double’}, …
‘VariableNames’,{‘EndNodes’,’Distance’});
nodetemp = inputdlg(["Node Name", "Latitude", "Longitude"], "Node Details");
%check input present
if isempty(nodetemp)== 0
%check node not present in table
if any(matches(app.NodeTable.Name,nodetemp(1),IgnoreCase=true))==false
%format table and add code in column 1
nodeinp = addvars(cell2table(transpose(nodetemp),’VariableNames’,{‘Name’,’Latitude’,’Longitude’}), app.index, ‘before’, 1,’NewVariableNames’,{‘Code’});
%update graph with node data
app.NodeTable=[app.NodeTable; nodeinp];
app.G=addnode(app.G,nodeinp);
app.map = plot(app.UIAxes,app.G,’NodeLabel’,app.G.Nodes.Name,’EdgeLabel’,app.G.Edges.Distance);%plot graph
%set node coordinates
app.map.XData = str2double(app.NodeTable.Longitude);
app.map.YData = str2double(app.NodeTable.Latitude);
app.index = app.index + 1; %increment node counter
end
end
to create the graph, add nodes and plot it. I then am attempting to use
nodes=findobj(app.map,’Marker’,’o’);
nodesLength = length(nodes);
for count=1:nodesLength
nodes(count).ButtonDownFcn=@(src,event)nodeButtonDown(app,count);
end
to get a hold of the node graphical objects and assign callbacks as advised here but the plot doesn’t seem to generate the nodes as children/separate objects like it says in all the documentation. The nodes variable just becomes a copy of the graphplot object. You’ll notice I’m using the app designer.I’m trying to create a graph that brings up a dialogue box when one of the nodes is clicked. I use
NodeTable = table(‘Size’,[0 4],’VariableTypes’,{‘double’,’string’,’double’,’double’}, …
‘VariableNames’,{‘Code’,’Name’,’Latitude’,’Longitude’});
EdgeTable = table(‘Size’,[0 2],’VariableTypes’,{‘cell’, ‘double’}, …
‘VariableNames’,{‘EndNodes’,’Distance’});
nodetemp = inputdlg(["Node Name", "Latitude", "Longitude"], "Node Details");
%check input present
if isempty(nodetemp)== 0
%check node not present in table
if any(matches(app.NodeTable.Name,nodetemp(1),IgnoreCase=true))==false
%format table and add code in column 1
nodeinp = addvars(cell2table(transpose(nodetemp),’VariableNames’,{‘Name’,’Latitude’,’Longitude’}), app.index, ‘before’, 1,’NewVariableNames’,{‘Code’});
%update graph with node data
app.NodeTable=[app.NodeTable; nodeinp];
app.G=addnode(app.G,nodeinp);
app.map = plot(app.UIAxes,app.G,’NodeLabel’,app.G.Nodes.Name,’EdgeLabel’,app.G.Edges.Distance);%plot graph
%set node coordinates
app.map.XData = str2double(app.NodeTable.Longitude);
app.map.YData = str2double(app.NodeTable.Latitude);
app.index = app.index + 1; %increment node counter
end
end
to create the graph, add nodes and plot it. I then am attempting to use
nodes=findobj(app.map,’Marker’,’o’);
nodesLength = length(nodes);
for count=1:nodesLength
nodes(count).ButtonDownFcn=@(src,event)nodeButtonDown(app,count);
end
to get a hold of the node graphical objects and assign callbacks as advised here but the plot doesn’t seem to generate the nodes as children/separate objects like it says in all the documentation. The nodes variable just becomes a copy of the graphplot object. You’ll notice I’m using the app designer. I’m trying to create a graph that brings up a dialogue box when one of the nodes is clicked. I use
NodeTable = table(‘Size’,[0 4],’VariableTypes’,{‘double’,’string’,’double’,’double’}, …
‘VariableNames’,{‘Code’,’Name’,’Latitude’,’Longitude’});
EdgeTable = table(‘Size’,[0 2],’VariableTypes’,{‘cell’, ‘double’}, …
‘VariableNames’,{‘EndNodes’,’Distance’});
nodetemp = inputdlg(["Node Name", "Latitude", "Longitude"], "Node Details");
%check input present
if isempty(nodetemp)== 0
%check node not present in table
if any(matches(app.NodeTable.Name,nodetemp(1),IgnoreCase=true))==false
%format table and add code in column 1
nodeinp = addvars(cell2table(transpose(nodetemp),’VariableNames’,{‘Name’,’Latitude’,’Longitude’}), app.index, ‘before’, 1,’NewVariableNames’,{‘Code’});
%update graph with node data
app.NodeTable=[app.NodeTable; nodeinp];
app.G=addnode(app.G,nodeinp);
app.map = plot(app.UIAxes,app.G,’NodeLabel’,app.G.Nodes.Name,’EdgeLabel’,app.G.Edges.Distance);%plot graph
%set node coordinates
app.map.XData = str2double(app.NodeTable.Longitude);
app.map.YData = str2double(app.NodeTable.Latitude);
app.index = app.index + 1; %increment node counter
end
end
to create the graph, add nodes and plot it. I then am attempting to use
nodes=findobj(app.map,’Marker’,’o’);
nodesLength = length(nodes);
for count=1:nodesLength
nodes(count).ButtonDownFcn=@(src,event)nodeButtonDown(app,count);
end
to get a hold of the node graphical objects and assign callbacks as advised here but the plot doesn’t seem to generate the nodes as children/separate objects like it says in all the documentation. The nodes variable just becomes a copy of the graphplot object. You’ll notice I’m using the app designer. axes, appdesigner, app designer, callback, graph, graphics, plot, plotting, gui, objects, find, nodes, children, interactivity, programmatic, class, assign MATLAB Answers — New Questions
Add Tooltip to each UI Tree Checkbox in App Designer
In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you.In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you. In App Desinger I want to add tooltips to each ui tree checkbox, so here each checkbox shall tell the user more of what is done or checked with the check exactly. Example: For "Block Colors" a tooltip might show something like "Checks if each Simulink Block has its dedicated color as defined by the company guidelines". Is there an option, as I can only find to add a tooltip to the parent CheckBoxTree but not each individual checkbox? Thank you. appdesigner, matlab gui, checkbox MATLAB Answers — New Questions









