Tag Archives: matlab
addpath and genpath duplicating the first part of chosen path
I’m trying to set up my file access for a script, but MATLAB’s addpath and genpath functions keep duplicating the first part of the file path. This, obviously, throws an error, but I can’t for the life of me understand why it does this. Has anyone else experienced a similar problem?
fullfile(pth{2}, fpth{1})
ans =
"Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions"
addpath(fullfile(pth{2}, fpth{1}))
Warning: Name is nonexistent or not a directory: /Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions
> In path (line 109)
In addpath (line 96)I’m trying to set up my file access for a script, but MATLAB’s addpath and genpath functions keep duplicating the first part of the file path. This, obviously, throws an error, but I can’t for the life of me understand why it does this. Has anyone else experienced a similar problem?
fullfile(pth{2}, fpth{1})
ans =
"Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions"
addpath(fullfile(pth{2}, fpth{1}))
Warning: Name is nonexistent or not a directory: /Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions
> In path (line 109)
In addpath (line 96) I’m trying to set up my file access for a script, but MATLAB’s addpath and genpath functions keep duplicating the first part of the file path. This, obviously, throws an error, but I can’t for the life of me understand why it does this. Has anyone else experienced a similar problem?
fullfile(pth{2}, fpth{1})
ans =
"Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions"
addpath(fullfile(pth{2}, fpth{1}))
Warning: Name is nonexistent or not a directory: /Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Users/David/Library/CloudStorage/GoogleDrive-dblair@gsu.edu/My Drive/Calhoun/Functions
> In path (line 109)
In addpath (line 96) file path MATLAB Answers — New Questions
Issue with Blockproc when using PadPartialBlocks
I have an image that I want to break up into regions and calculate the Standard deviation of (using STD2). I only want the result to contain calculations for COMPLETE blocks. Walter has kindly suggested to use "PadMethod"as NaN, then the resulting data would have NaNs in the partial columns / rows that I can then process out.
However, using PadPartialBlocks doesn’t seem to be working as it should
bss = [500,500];
fh = @(bs) std2(bs.data);
J = blockproc(IM2, bss, fh,’UseParallel’,true,’PadPartialBlocks’,true,’PadMethod’,NaN);
The last column (=col 21) which is the "partial" column doesn’t have values I was expecting. Surely they should all be NaN? Its as though the NaN isn’t actally been replaced in the last partial column – what am I doing wrong?I have an image that I want to break up into regions and calculate the Standard deviation of (using STD2). I only want the result to contain calculations for COMPLETE blocks. Walter has kindly suggested to use "PadMethod"as NaN, then the resulting data would have NaNs in the partial columns / rows that I can then process out.
However, using PadPartialBlocks doesn’t seem to be working as it should
bss = [500,500];
fh = @(bs) std2(bs.data);
J = blockproc(IM2, bss, fh,’UseParallel’,true,’PadPartialBlocks’,true,’PadMethod’,NaN);
The last column (=col 21) which is the "partial" column doesn’t have values I was expecting. Surely they should all be NaN? Its as though the NaN isn’t actally been replaced in the last partial column – what am I doing wrong? I have an image that I want to break up into regions and calculate the Standard deviation of (using STD2). I only want the result to contain calculations for COMPLETE blocks. Walter has kindly suggested to use "PadMethod"as NaN, then the resulting data would have NaNs in the partial columns / rows that I can then process out.
However, using PadPartialBlocks doesn’t seem to be working as it should
bss = [500,500];
fh = @(bs) std2(bs.data);
J = blockproc(IM2, bss, fh,’UseParallel’,true,’PadPartialBlocks’,true,’PadMethod’,NaN);
The last column (=col 21) which is the "partial" column doesn’t have values I was expecting. Surely they should all be NaN? Its as though the NaN isn’t actally been replaced in the last partial column – what am I doing wrong? blockproc, padpartialblocks, nan MATLAB Answers — New Questions
The generated EMPC is not giving the same results as MPC
We have modelled a Quadcopter linear state space plant , we were able to tune the MPC for a specific operating point and got our desired results , now we continnued to generate a Explicit MPC using our MPC model , but the EMPC is not giving the same results , its behaving too much different . what could be the reasonWe have modelled a Quadcopter linear state space plant , we were able to tune the MPC for a specific operating point and got our desired results , now we continnued to generate a Explicit MPC using our MPC model , but the EMPC is not giving the same results , its behaving too much different . what could be the reason We have modelled a Quadcopter linear state space plant , we were able to tune the MPC for a specific operating point and got our desired results , now we continnued to generate a Explicit MPC using our MPC model , but the EMPC is not giving the same results , its behaving too much different . what could be the reason mpc, empc, control, uav MATLAB Answers — New Questions
What are redundant servers, how do I generate a license file for one, and how do I set it up?
I would like to know what redundant servers are, and how to generate and install a redundant server license file for MATLAB and associated products.I would like to know what redundant servers are, and how to generate and install a redundant server license file for MATLAB and associated products. I would like to know what redundant servers are, and how to generate and install a redundant server license file for MATLAB and associated products. MATLAB Answers — New Questions
Issue with PopulationSize in Genetic Algorithm toolbox
There is a project I wanted to use the genetic algorithm tools on and attempted to rig a basic script to test it out. However, I could not run the code because it kept giving me the following error.
Error using gaoptimset>checkfield (line 436)
Invalid value for OPTIONS parameter PopulationSize: must be a positive numeric (not a character vector).
I didn’t understand where I had specified PopulationSize as a character vector, so I used optimoptions to change PopulationSize to 50 manually. However it kept throwing me the same error.
When stepped through the program, I entered ga() and found that the default value for PopulationSize is the character vector ’50 when numberOfVariables <= 5, else 200′ which obviously isn’t a numeric value. In any case, this value is supposed to be overridden when optimoptions is used to specify a value other than the default, but it didn’t.
Am I doing something wrong or is the genetic algorithm solver broken? Code is as follows.
Further details is that I am doing this on my laptop with a copy of MATLAB R2024b downloaded on it. I have the Global Optimization toolbox installed.
% Testing Genetic Algorithm
clc, clear, close all
rng default % For reproducibility
numberOfVariables = 2;
lb = [-3,-3];
ub = [3,3];
a = 0.1;
b = 0.05; % define constant values
FitnessFunction = @(x) test_fitness(x,a,b);
options = optimoptions("ga",PopulationSize=50);
[x,fval] = ga(FitnessFunction,2,[],[],[],[],lb,ub,[],options);There is a project I wanted to use the genetic algorithm tools on and attempted to rig a basic script to test it out. However, I could not run the code because it kept giving me the following error.
Error using gaoptimset>checkfield (line 436)
Invalid value for OPTIONS parameter PopulationSize: must be a positive numeric (not a character vector).
I didn’t understand where I had specified PopulationSize as a character vector, so I used optimoptions to change PopulationSize to 50 manually. However it kept throwing me the same error.
When stepped through the program, I entered ga() and found that the default value for PopulationSize is the character vector ’50 when numberOfVariables <= 5, else 200′ which obviously isn’t a numeric value. In any case, this value is supposed to be overridden when optimoptions is used to specify a value other than the default, but it didn’t.
Am I doing something wrong or is the genetic algorithm solver broken? Code is as follows.
Further details is that I am doing this on my laptop with a copy of MATLAB R2024b downloaded on it. I have the Global Optimization toolbox installed.
% Testing Genetic Algorithm
clc, clear, close all
rng default % For reproducibility
numberOfVariables = 2;
lb = [-3,-3];
ub = [3,3];
a = 0.1;
b = 0.05; % define constant values
FitnessFunction = @(x) test_fitness(x,a,b);
options = optimoptions("ga",PopulationSize=50);
[x,fval] = ga(FitnessFunction,2,[],[],[],[],lb,ub,[],options); There is a project I wanted to use the genetic algorithm tools on and attempted to rig a basic script to test it out. However, I could not run the code because it kept giving me the following error.
Error using gaoptimset>checkfield (line 436)
Invalid value for OPTIONS parameter PopulationSize: must be a positive numeric (not a character vector).
I didn’t understand where I had specified PopulationSize as a character vector, so I used optimoptions to change PopulationSize to 50 manually. However it kept throwing me the same error.
When stepped through the program, I entered ga() and found that the default value for PopulationSize is the character vector ’50 when numberOfVariables <= 5, else 200′ which obviously isn’t a numeric value. In any case, this value is supposed to be overridden when optimoptions is used to specify a value other than the default, but it didn’t.
Am I doing something wrong or is the genetic algorithm solver broken? Code is as follows.
Further details is that I am doing this on my laptop with a copy of MATLAB R2024b downloaded on it. I have the Global Optimization toolbox installed.
% Testing Genetic Algorithm
clc, clear, close all
rng default % For reproducibility
numberOfVariables = 2;
lb = [-3,-3];
ub = [3,3];
a = 0.1;
b = 0.05; % define constant values
FitnessFunction = @(x) test_fitness(x,a,b);
options = optimoptions("ga",PopulationSize=50);
[x,fval] = ga(FitnessFunction,2,[],[],[],[],lb,ub,[],options); genetic algorithm, global optimization toolbox, matlab MATLAB Answers — New Questions
Technical Issue: R2025b Internal Error (std::exception) when Dropbox Folder is added to Search Path
Dear MathWorks Support Team,
I am reporting a cross-platform internal error in MATLAB R2025b involving the interaction between the Search Path and Dropbox. This issue has been consistently reproduced on both Windows 11 and macOS (Sequoia).
The error occurs whenever a Dropbox-synced folder is added to the MATLAB Search Path. After running any script from that path, MATLAB throws a std::exception: "Unexpected mxArray type returned from feval. Expected class std::basic_string… but found string." originating from internal.matlab.datatoolsservices.WSBUtil.getWorkspaceDisplay.
I have already performed the following troubleshooting steps to isolate the issue:
Clean Reinstallation: Performed a complete uninstall and deleted all MathWorks-related metadata folders, including %AppData%MathWorks, %LocalAppData%MathWorks, and the MATLAB folder in Documents.
Configuration Reset: Reset the userpath and cleared all pathdef.m files to ensure no legacy settings from previous versions (like R2024b) were interfering.
Cross-Platform Testing: Confirmed the exact same behavior on a newly purchased MacBook and a Windows PC.
Path Isolation: Confirmed that the error only occurs when the Dropbox folder is added to the "Set Path" list. It does not occur if the directory is accessed only via the cd command.
GUI Minimization: Even after closing the Workspace and Current Folder browsers and disabling datatips, the internal WSBUtil error still triggers upon script completion.
It appears the R2025b engine incorrectly handles path metadata from cloud-synced file systems, passing a string object where internal C++ UI functions expect a char array. Given that my research workflow across multiple machines relies entirely on Dropbox, this bug is a significant hindrance.
I look forward to your technical analysis and a potential patch for this engine bug.
Best regards,Dear MathWorks Support Team,
I am reporting a cross-platform internal error in MATLAB R2025b involving the interaction between the Search Path and Dropbox. This issue has been consistently reproduced on both Windows 11 and macOS (Sequoia).
The error occurs whenever a Dropbox-synced folder is added to the MATLAB Search Path. After running any script from that path, MATLAB throws a std::exception: "Unexpected mxArray type returned from feval. Expected class std::basic_string… but found string." originating from internal.matlab.datatoolsservices.WSBUtil.getWorkspaceDisplay.
I have already performed the following troubleshooting steps to isolate the issue:
Clean Reinstallation: Performed a complete uninstall and deleted all MathWorks-related metadata folders, including %AppData%MathWorks, %LocalAppData%MathWorks, and the MATLAB folder in Documents.
Configuration Reset: Reset the userpath and cleared all pathdef.m files to ensure no legacy settings from previous versions (like R2024b) were interfering.
Cross-Platform Testing: Confirmed the exact same behavior on a newly purchased MacBook and a Windows PC.
Path Isolation: Confirmed that the error only occurs when the Dropbox folder is added to the "Set Path" list. It does not occur if the directory is accessed only via the cd command.
GUI Minimization: Even after closing the Workspace and Current Folder browsers and disabling datatips, the internal WSBUtil error still triggers upon script completion.
It appears the R2025b engine incorrectly handles path metadata from cloud-synced file systems, passing a string object where internal C++ UI functions expect a char array. Given that my research workflow across multiple machines relies entirely on Dropbox, this bug is a significant hindrance.
I look forward to your technical analysis and a potential patch for this engine bug.
Best regards, Dear MathWorks Support Team,
I am reporting a cross-platform internal error in MATLAB R2025b involving the interaction between the Search Path and Dropbox. This issue has been consistently reproduced on both Windows 11 and macOS (Sequoia).
The error occurs whenever a Dropbox-synced folder is added to the MATLAB Search Path. After running any script from that path, MATLAB throws a std::exception: "Unexpected mxArray type returned from feval. Expected class std::basic_string… but found string." originating from internal.matlab.datatoolsservices.WSBUtil.getWorkspaceDisplay.
I have already performed the following troubleshooting steps to isolate the issue:
Clean Reinstallation: Performed a complete uninstall and deleted all MathWorks-related metadata folders, including %AppData%MathWorks, %LocalAppData%MathWorks, and the MATLAB folder in Documents.
Configuration Reset: Reset the userpath and cleared all pathdef.m files to ensure no legacy settings from previous versions (like R2024b) were interfering.
Cross-Platform Testing: Confirmed the exact same behavior on a newly purchased MacBook and a Windows PC.
Path Isolation: Confirmed that the error only occurs when the Dropbox folder is added to the "Set Path" list. It does not occur if the directory is accessed only via the cd command.
GUI Minimization: Even after closing the Workspace and Current Folder browsers and disabling datatips, the internal WSBUtil error still triggers upon script completion.
It appears the R2025b engine incorrectly handles path metadata from cloud-synced file systems, passing a string object where internal C++ UI functions expect a char array. Given that my research workflow across multiple machines relies entirely on Dropbox, this bug is a significant hindrance.
I look forward to your technical analysis and a potential patch for this engine bug.
Best regards, r2025b internal engine bug, std::exception, unexpe, dropbox integration, search path conflict, cloud-s MATLAB Answers — New Questions
Toolbox installation going wrong – linux
I am using the newest release 2025a on a linux computer. I want to install the Statistics and Machine Learning Toolbox which is included in my license. In general the installation process is simple – i open the add-on explorer, find the toolbox and click install. Then a window pops up, that the toolbox will be installed, matlab will be closed and restarted once complete. Matlab closes but never restarts, if i start it again the toolbox is missing.
What can I do ?I am using the newest release 2025a on a linux computer. I want to install the Statistics and Machine Learning Toolbox which is included in my license. In general the installation process is simple – i open the add-on explorer, find the toolbox and click install. Then a window pops up, that the toolbox will be installed, matlab will be closed and restarted once complete. Matlab closes but never restarts, if i start it again the toolbox is missing.
What can I do ? I am using the newest release 2025a on a linux computer. I want to install the Statistics and Machine Learning Toolbox which is included in my license. In general the installation process is simple – i open the add-on explorer, find the toolbox and click install. Then a window pops up, that the toolbox will be installed, matlab will be closed and restarted once complete. Matlab closes but never restarts, if i start it again the toolbox is missing.
What can I do ? toolbox installation, linux, restart MATLAB Answers — New Questions
How to get Figure Container’s Properties?
How can I get and set the properties of a Figure Container introduced in MATLAB 2025?
For example, I want to change the window state of a Figure Container (not the figure window state) to “Maximized” from a script.How can I get and set the properties of a Figure Container introduced in MATLAB 2025?
For example, I want to change the window state of a Figure Container (not the figure window state) to “Maximized” from a script. How can I get and set the properties of a Figure Container introduced in MATLAB 2025?
For example, I want to change the window state of a Figure Container (not the figure window state) to “Maximized” from a script. figure container, properties MATLAB Answers — New Questions
Can not run Matlab, uninstall, or reinstall on windows. Error in description.
Post Content Post Content procedure entry point error MATLAB Answers — New Questions
Is it possible to procedurally remove things from an engineering drawing?
I have been working on a post processing software for a few months for a robotics system my company makes. It does a lot of different things and is now being rolled out to our customers for use, which is exciting for me. My company makes a few different types of robots, one of them is very different than the others. To give a bit of context before getting to my question:
One of our robots does hull cleaning and inspection autonomously. When the vehicle is attached to a hull, the coordinate system is now relative to the ship, meaning the heading of the vehicle is relative to the Bow where 0 degrees is pointing towards the bow, 180 is pointed stern. "Latitude" is relative to the bottom where 0 degrees is at the keel and 90 degrees is at the waterline. "Longitude" is the distance from the centerline of the ship, where 180 is at the bow, and -180 is at the stern. Its a weird system but it doesnt matter where we are in the world, it only matters where we are on the ship.
Im trying to improve my app to work with this other robotics system, for all of our other robots we use a regular coordinate system with regular lat and long. When the user plots the data it does so over a satellite basemap, it looks great. When a user of our hull cleaning robot plots the data we typically do it over a 2D "folded out" image of the ship. Right now we have to do this by hand and its time consuming. The customer, who ever is hiring us to clean their ship, will provide us with an engineering drawing of the vessel, but there is a lot of stuff in the document we dont want to be included in the final product. Usually our operators use MS Paint or Adobe Illustrator to remove all the extra stuff, and they are left with a profile of the port, starboard, and top down veiw of the vessel, then we put it in QGIS and plot the points on top. Following this we take a screenshot and edit everything for a final product. Its time consuming and exhausting.
So heres my question. How can I get matlab to remove all the extra stuff for me? The two images I attached is what the engineering drawings typically look like vs what we use for our final product. I have the imaging processing toolbox and im trying to find a way to remove the extra stuff. the problem is its always a little different, sometimes the ships are much bigger than others. Any help or advice would be very much appreciated!I have been working on a post processing software for a few months for a robotics system my company makes. It does a lot of different things and is now being rolled out to our customers for use, which is exciting for me. My company makes a few different types of robots, one of them is very different than the others. To give a bit of context before getting to my question:
One of our robots does hull cleaning and inspection autonomously. When the vehicle is attached to a hull, the coordinate system is now relative to the ship, meaning the heading of the vehicle is relative to the Bow where 0 degrees is pointing towards the bow, 180 is pointed stern. "Latitude" is relative to the bottom where 0 degrees is at the keel and 90 degrees is at the waterline. "Longitude" is the distance from the centerline of the ship, where 180 is at the bow, and -180 is at the stern. Its a weird system but it doesnt matter where we are in the world, it only matters where we are on the ship.
Im trying to improve my app to work with this other robotics system, for all of our other robots we use a regular coordinate system with regular lat and long. When the user plots the data it does so over a satellite basemap, it looks great. When a user of our hull cleaning robot plots the data we typically do it over a 2D "folded out" image of the ship. Right now we have to do this by hand and its time consuming. The customer, who ever is hiring us to clean their ship, will provide us with an engineering drawing of the vessel, but there is a lot of stuff in the document we dont want to be included in the final product. Usually our operators use MS Paint or Adobe Illustrator to remove all the extra stuff, and they are left with a profile of the port, starboard, and top down veiw of the vessel, then we put it in QGIS and plot the points on top. Following this we take a screenshot and edit everything for a final product. Its time consuming and exhausting.
So heres my question. How can I get matlab to remove all the extra stuff for me? The two images I attached is what the engineering drawings typically look like vs what we use for our final product. I have the imaging processing toolbox and im trying to find a way to remove the extra stuff. the problem is its always a little different, sometimes the ships are much bigger than others. Any help or advice would be very much appreciated! I have been working on a post processing software for a few months for a robotics system my company makes. It does a lot of different things and is now being rolled out to our customers for use, which is exciting for me. My company makes a few different types of robots, one of them is very different than the others. To give a bit of context before getting to my question:
One of our robots does hull cleaning and inspection autonomously. When the vehicle is attached to a hull, the coordinate system is now relative to the ship, meaning the heading of the vehicle is relative to the Bow where 0 degrees is pointing towards the bow, 180 is pointed stern. "Latitude" is relative to the bottom where 0 degrees is at the keel and 90 degrees is at the waterline. "Longitude" is the distance from the centerline of the ship, where 180 is at the bow, and -180 is at the stern. Its a weird system but it doesnt matter where we are in the world, it only matters where we are on the ship.
Im trying to improve my app to work with this other robotics system, for all of our other robots we use a regular coordinate system with regular lat and long. When the user plots the data it does so over a satellite basemap, it looks great. When a user of our hull cleaning robot plots the data we typically do it over a 2D "folded out" image of the ship. Right now we have to do this by hand and its time consuming. The customer, who ever is hiring us to clean their ship, will provide us with an engineering drawing of the vessel, but there is a lot of stuff in the document we dont want to be included in the final product. Usually our operators use MS Paint or Adobe Illustrator to remove all the extra stuff, and they are left with a profile of the port, starboard, and top down veiw of the vessel, then we put it in QGIS and plot the points on top. Following this we take a screenshot and edit everything for a final product. Its time consuming and exhausting.
So heres my question. How can I get matlab to remove all the extra stuff for me? The two images I attached is what the engineering drawings typically look like vs what we use for our final product. I have the imaging processing toolbox and im trying to find a way to remove the extra stuff. the problem is its always a little different, sometimes the ships are much bigger than others. Any help or advice would be very much appreciated! image processing MATLAB Answers — New Questions
why audioDeviceWriter doesn’t list my output device?
Hello MATLAB comunity,
I’m trying to send audio over a USB Audio Class 2.0 (UAC2) implementation that enables the EV‑SC594‑EZKIT from ADI. The USB UAC2 device supports 16 inputs / 16 outputs at 16‑bit. MATLAB’s audioDeviceReader lists the device and I can capture the audio properly:
>> deviceReader = audioDeviceReader(Driver="DirectSound"); InDevices=getAudioDevices(deviceReader)
InDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Capture Driver’} {‘Microphone Array on Monitor (2- Intel® Smart Sound Techno…’} {‘Microphone (EV-SC594 (16x16x16bit))’}
However the audioDeviceWritter does not show the device:
>> deviceWritter = audioDeviceWriter(Driver="DirectSound"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Driver’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
In Windows, the playback device is listed correctly, and I can run the Test on Sound Playback window confirming each of the 16 streams in the EV‑SC594‑EZKIT and also using audioDeviceReader in simulink.
The output device is listed as ‘WASAPI’
>> deviceWritter = audioDeviceWriter(Driver="WASAPI"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘SC594 (EV-SC594 (16x16x16bit))’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
But I am having next error:
Error:Error in ‘AudioAnalyzerSL/Audio Device
Writer’: PortAudio Error: Invalid sample rate
Is there any way I can use to send audio to that USB Audio Class 2.0 port?
Thanks,
GilbertoHello MATLAB comunity,
I’m trying to send audio over a USB Audio Class 2.0 (UAC2) implementation that enables the EV‑SC594‑EZKIT from ADI. The USB UAC2 device supports 16 inputs / 16 outputs at 16‑bit. MATLAB’s audioDeviceReader lists the device and I can capture the audio properly:
>> deviceReader = audioDeviceReader(Driver="DirectSound"); InDevices=getAudioDevices(deviceReader)
InDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Capture Driver’} {‘Microphone Array on Monitor (2- Intel® Smart Sound Techno…’} {‘Microphone (EV-SC594 (16x16x16bit))’}
However the audioDeviceWritter does not show the device:
>> deviceWritter = audioDeviceWriter(Driver="DirectSound"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Driver’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
In Windows, the playback device is listed correctly, and I can run the Test on Sound Playback window confirming each of the 16 streams in the EV‑SC594‑EZKIT and also using audioDeviceReader in simulink.
The output device is listed as ‘WASAPI’
>> deviceWritter = audioDeviceWriter(Driver="WASAPI"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘SC594 (EV-SC594 (16x16x16bit))’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
But I am having next error:
Error:Error in ‘AudioAnalyzerSL/Audio Device
Writer’: PortAudio Error: Invalid sample rate
Is there any way I can use to send audio to that USB Audio Class 2.0 port?
Thanks,
Gilberto Hello MATLAB comunity,
I’m trying to send audio over a USB Audio Class 2.0 (UAC2) implementation that enables the EV‑SC594‑EZKIT from ADI. The USB UAC2 device supports 16 inputs / 16 outputs at 16‑bit. MATLAB’s audioDeviceReader lists the device and I can capture the audio properly:
>> deviceReader = audioDeviceReader(Driver="DirectSound"); InDevices=getAudioDevices(deviceReader)
InDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Capture Driver’} {‘Microphone Array on Monitor (2- Intel® Smart Sound Techno…’} {‘Microphone (EV-SC594 (16x16x16bit))’}
However the audioDeviceWritter does not show the device:
>> deviceWritter = audioDeviceWriter(Driver="DirectSound"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘Primary Sound Driver’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
In Windows, the playback device is listed correctly, and I can run the Test on Sound Playback window confirming each of the 16 streams in the EV‑SC594‑EZKIT and also using audioDeviceReader in simulink.
The output device is listed as ‘WASAPI’
>> deviceWritter = audioDeviceWriter(Driver="WASAPI"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{‘Default’} {‘SC594 (EV-SC594 (16x16x16bit))’} {‘Altavoces Laptop (2- Realtek(R) Audio)’} {‘Altavoces (office)’}
But I am having next error:
Error:Error in ‘AudioAnalyzerSL/Audio Device
Writer’: PortAudio Error: Invalid sample rate
Is there any way I can use to send audio to that USB Audio Class 2.0 port?
Thanks,
Gilberto audiodevicewriter MATLAB Answers — New Questions
How to keep formatting when cutting and pasting to office
One thing that I would like to do is cut and paste a table to an email. When I do this however, particularly if a paste more than one table into the same email, the formatting doesn’t work. Particularly, the tables will be indented, but the second table will be indented from where the first table is indented, not from the start of the line.
I could paste as text only, but it would be nice to keep the formatting.
I could write to an excel sheet and then paste from there, but i don’t know how to keep the formatting doing that.
I asked copilot, but it doesn’t know how to help format a document.One thing that I would like to do is cut and paste a table to an email. When I do this however, particularly if a paste more than one table into the same email, the formatting doesn’t work. Particularly, the tables will be indented, but the second table will be indented from where the first table is indented, not from the start of the line.
I could paste as text only, but it would be nice to keep the formatting.
I could write to an excel sheet and then paste from there, but i don’t know how to keep the formatting doing that.
I asked copilot, but it doesn’t know how to help format a document. One thing that I would like to do is cut and paste a table to an email. When I do this however, particularly if a paste more than one table into the same email, the formatting doesn’t work. Particularly, the tables will be indented, but the second table will be indented from where the first table is indented, not from the start of the line.
I could paste as text only, but it would be nice to keep the formatting.
I could write to an excel sheet and then paste from there, but i don’t know how to keep the formatting doing that.
I asked copilot, but it doesn’t know how to help format a document. cut and paste, outlook, office, format, indent MATLAB Answers — New Questions
How to apply Mann Kendall and sen slope?
Hey everyone,
I need to apply Mann Kendall and sen slope in matlab, I dwnloaded the functions however, the sen slope that I got doesn’t make sense!
any help woud be highly appreciated!
RiyadhHey everyone,
I need to apply Mann Kendall and sen slope in matlab, I dwnloaded the functions however, the sen slope that I got doesn’t make sense!
any help woud be highly appreciated!
Riyadh Hey everyone,
I need to apply Mann Kendall and sen slope in matlab, I dwnloaded the functions however, the sen slope that I got doesn’t make sense!
any help woud be highly appreciated!
Riyadh mann kendall, sen slope MATLAB Answers — New Questions
Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer?
Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer?Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer? Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer? MATLAB Answers — New Questions
Why do I receive a connection error when launching MATLAB with Login Named User enabled?
Why do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection ErrorWhy do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection Error Why do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection Error login, named, user, lnu, licensing, servers MATLAB Answers — New Questions
Timetables not fully supported by plot tools?
Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases.Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases. Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases. time series, data import MATLAB Answers — New Questions
General Blockproc questions that aren’t in the documentation
I have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
JasonI have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
Jason I have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
Jason blockproc MATLAB Answers — New Questions
How can I set an expiration or override date for my license file?
How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself?How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? MATLAB Answers — New Questions
How do I license my Docker container using a Campus-Wide or Startup Individual license?
How do I license my Docker container using a Campus-Wide or Startup Individual license?How do I license my Docker container using a Campus-Wide or Startup Individual license? How do I license my Docker container using a Campus-Wide or Startup Individual license? MATLAB Answers — New Questions
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
endIn MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end line number, prompt message ctrl+c MATLAB Answers — New Questions









