Author: PuTI
Robust Control: dksyn example
Hi everybody,
currently I try to get familiar with the robust control toolbox. I tried to understand the dksyn command example:
if true
%Uncertain plant Gpert
G = tf(1,[1 -1]);
Wu = 0.25*tf([1/2 1],[1/32 1]);
InputUnc = ultidyn(‘InputUnc’,[1 1]);
Gpert = G*(1+InputUnc*Wu);
%Performance Weight
Wp = tf([1/4 0.6],[1 0.006]);
%Plant P/Pi
P = [Wp; 1 ]*[1 Gpert];
P2=[Wp,Wp*Gpert;
1,Gpert];
[K,clp,bnd] = dksyn(P,1,1);
[K2,clp2,bnd2] = dksyn(P2,1,1);
end
I don’t understand, why the dksyn command is able to calculate a controller for P, but not for P2?! P and P2 are equal, are’nt they?
Help is really appreciated.
Thank you very much!
best regards
MartinHi everybody,
currently I try to get familiar with the robust control toolbox. I tried to understand the dksyn command example:
if true
%Uncertain plant Gpert
G = tf(1,[1 -1]);
Wu = 0.25*tf([1/2 1],[1/32 1]);
InputUnc = ultidyn(‘InputUnc’,[1 1]);
Gpert = G*(1+InputUnc*Wu);
%Performance Weight
Wp = tf([1/4 0.6],[1 0.006]);
%Plant P/Pi
P = [Wp; 1 ]*[1 Gpert];
P2=[Wp,Wp*Gpert;
1,Gpert];
[K,clp,bnd] = dksyn(P,1,1);
[K2,clp2,bnd2] = dksyn(P2,1,1);
end
I don’t understand, why the dksyn command is able to calculate a controller for P, but not for P2?! P and P2 are equal, are’nt they?
Help is really appreciated.
Thank you very much!
best regards
Martin Hi everybody,
currently I try to get familiar with the robust control toolbox. I tried to understand the dksyn command example:
if true
%Uncertain plant Gpert
G = tf(1,[1 -1]);
Wu = 0.25*tf([1/2 1],[1/32 1]);
InputUnc = ultidyn(‘InputUnc’,[1 1]);
Gpert = G*(1+InputUnc*Wu);
%Performance Weight
Wp = tf([1/4 0.6],[1 0.006]);
%Plant P/Pi
P = [Wp; 1 ]*[1 Gpert];
P2=[Wp,Wp*Gpert;
1,Gpert];
[K,clp,bnd] = dksyn(P,1,1);
[K2,clp2,bnd2] = dksyn(P2,1,1);
end
I don’t understand, why the dksyn command is able to calculate a controller for P, but not for P2?! P and P2 are equal, are’nt they?
Help is really appreciated.
Thank you very much!
best regards
Martin robust control, dksyn, mu synthesis MATLAB Answers — New Questions
Apply DC Dynamic load block in a three phase grid connected rectifier circuit
In a MATLAB example "Three phase Grid connected rectifier control", I try to achieve similar waveforms from the example but with a modification. The modification is that the resistive load is replaced with Dynamic load block. The p port of the dynamic load block is connected to a matlab script. The script creates a timeseries power (in Watts) that changes in magnitudes over time in seconds. In the Dynamic load block description, it mentions that when the voltage from the DC supply drops below the Minimum supply voltage, the load behavior changes and the block acts as a resistive load.
Problem: My DC output voltages are incorrect, it has negative values and the waveform looks messed up. I am unsure where the problem is. What are possible troubleshooting steps I should try?
Thank you.In a MATLAB example "Three phase Grid connected rectifier control", I try to achieve similar waveforms from the example but with a modification. The modification is that the resistive load is replaced with Dynamic load block. The p port of the dynamic load block is connected to a matlab script. The script creates a timeseries power (in Watts) that changes in magnitudes over time in seconds. In the Dynamic load block description, it mentions that when the voltage from the DC supply drops below the Minimum supply voltage, the load behavior changes and the block acts as a resistive load.
Problem: My DC output voltages are incorrect, it has negative values and the waveform looks messed up. I am unsure where the problem is. What are possible troubleshooting steps I should try?
Thank you. In a MATLAB example "Three phase Grid connected rectifier control", I try to achieve similar waveforms from the example but with a modification. The modification is that the resistive load is replaced with Dynamic load block. The p port of the dynamic load block is connected to a matlab script. The script creates a timeseries power (in Watts) that changes in magnitudes over time in seconds. In the Dynamic load block description, it mentions that when the voltage from the DC supply drops below the Minimum supply voltage, the load behavior changes and the block acts as a resistive load.
Problem: My DC output voltages are incorrect, it has negative values and the waveform looks messed up. I am unsure where the problem is. What are possible troubleshooting steps I should try?
Thank you. dynamic load MATLAB Answers — New Questions
HDL Coder Enable-Based Constraints for Libero SOC
Are Enable-Based Constraints supported for Libero SoC v2022.1 in MATLAB/Simulink 2024a?
If not, Is there a newer version of MATLAB/Simulink that supports this feature or is it a planned feature?Are Enable-Based Constraints supported for Libero SoC v2022.1 in MATLAB/Simulink 2024a?
If not, Is there a newer version of MATLAB/Simulink that supports this feature or is it a planned feature? Are Enable-Based Constraints supported for Libero SoC v2022.1 in MATLAB/Simulink 2024a?
If not, Is there a newer version of MATLAB/Simulink that supports this feature or is it a planned feature? hdl coder, constraints, enable-based constraints, libero soc MATLAB Answers — New Questions
Home License Purchase – India
Hi Team,
Is the home license region-restricted? I heard that purchasing a home license for MathWorks products might not be available from India. I am planning to purchase a Home Licesne.
Best Regards
Ajaykumar MSTHi Team,
Is the home license region-restricted? I heard that purchasing a home license for MathWorks products might not be available from India. I am planning to purchase a Home Licesne.
Best Regards
Ajaykumar MST Hi Team,
Is the home license region-restricted? I heard that purchasing a home license for MathWorks products might not be available from India. I am planning to purchase a Home Licesne.
Best Regards
Ajaykumar MST license MATLAB Answers — New Questions
undefined function ’eml_lib_assert’
Hi everyone.
I am trying to run a signal processing code provided by others, which is to plot the curve of digital filter. But it gives me the following error
"
Undefined function ’eml_lib_assert’ for input arguments of type ‘char’.
Error in freqz (line 15)
eml_lib_assert(nargin>=1,’signal:freqz:notEnoughInputs’,’Not enough input arguments.’);
"
The original code is as follows
"
num=[0.0528 0.797 0.1295 0.1295 0.797 0.0528];
den=[1 -1.8107 2.4947 -1.8801 0.9537 -0.2336];
[z,p,k]=tf2zp(num,den)
figure(1);
zplane(z,p)
m=256;
w=[1:pi/m:pi];
%h=freqz(num,den,w);
[H w]=freqz(num,den);
magH=abs(H);
figure(2);
plot(w,magH);
xlabel(‘omega/’); ylabel(‘|H(e^j^omega)|’); grid;
“
The person who provided this code mentioned to set path in MATLAB, but I have no clue how to properly set the correct path. The matlab version I am currently using is R2013b with the Signal Processing Toolbox version 6.20.
Any insights or ideas will be greatly appreciated. Thanks.Hi everyone.
I am trying to run a signal processing code provided by others, which is to plot the curve of digital filter. But it gives me the following error
"
Undefined function ’eml_lib_assert’ for input arguments of type ‘char’.
Error in freqz (line 15)
eml_lib_assert(nargin>=1,’signal:freqz:notEnoughInputs’,’Not enough input arguments.’);
"
The original code is as follows
"
num=[0.0528 0.797 0.1295 0.1295 0.797 0.0528];
den=[1 -1.8107 2.4947 -1.8801 0.9537 -0.2336];
[z,p,k]=tf2zp(num,den)
figure(1);
zplane(z,p)
m=256;
w=[1:pi/m:pi];
%h=freqz(num,den,w);
[H w]=freqz(num,den);
magH=abs(H);
figure(2);
plot(w,magH);
xlabel(‘omega/’); ylabel(‘|H(e^j^omega)|’); grid;
“
The person who provided this code mentioned to set path in MATLAB, but I have no clue how to properly set the correct path. The matlab version I am currently using is R2013b with the Signal Processing Toolbox version 6.20.
Any insights or ideas will be greatly appreciated. Thanks. Hi everyone.
I am trying to run a signal processing code provided by others, which is to plot the curve of digital filter. But it gives me the following error
"
Undefined function ’eml_lib_assert’ for input arguments of type ‘char’.
Error in freqz (line 15)
eml_lib_assert(nargin>=1,’signal:freqz:notEnoughInputs’,’Not enough input arguments.’);
"
The original code is as follows
"
num=[0.0528 0.797 0.1295 0.1295 0.797 0.0528];
den=[1 -1.8107 2.4947 -1.8801 0.9537 -0.2336];
[z,p,k]=tf2zp(num,den)
figure(1);
zplane(z,p)
m=256;
w=[1:pi/m:pi];
%h=freqz(num,den,w);
[H w]=freqz(num,den);
magH=abs(H);
figure(2);
plot(w,magH);
xlabel(‘omega/’); ylabel(‘|H(e^j^omega)|’); grid;
“
The person who provided this code mentioned to set path in MATLAB, but I have no clue how to properly set the correct path. The matlab version I am currently using is R2013b with the Signal Processing Toolbox version 6.20.
Any insights or ideas will be greatly appreciated. Thanks. eml_lib_assert; set path; resample; dsp MATLAB Answers — New Questions
Help exporting a geotiff with a transparent background
I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R);I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R); I am working on a project where I want to export two geotiffs, the first is basically a georeferenced screenshot of data in a geoaxes with the satellite base map. I have this one working fine. The second one that I want to export is just the data, I have three datasets im trying to export, lat/long points, depth data (im currently plotting this with geoscatter) and contour lines. No matter what I try all im exporting is a black square and no data. Below is my code at just exporting the data with a transparent background.
I thought no background would be easier but I guess not, im having a tough time with it. Also, just an FYI, this is a small part of a very large project im working on so all of the variable names are brought in through other functions.
res = 0.00005;
lat_v = min(lat):res:max(lat);
long_v = min(long):res:max(long);
[long_grid,lat_grid] = meshgrid(long_v,lat_v);
depth_grid = griddata(long,lat,depth,long_grid,lat_grid,’natural’);
% C = contourc(lonv,latv,depth_grid,5);
R = georefcells([min(lat_v) max(lat_v)], [min(long_v) max(long_v)], size(depth_grid));
R.ColumnsStartFrom = ‘north’;
geotiffwrite(output_file, depth_grid, R); geotiff MATLAB Answers — New Questions
What do I need to know about upgrading from LTI 1.1 to LTI 1.3 in regards to MATLAB Grader?
What do I need to know about upgrading from LTI 1.1 to LTI 1.3 in regards to MATLAB Grader?What do I need to know about upgrading from LTI 1.1 to LTI 1.3 in regards to MATLAB Grader? What do I need to know about upgrading from LTI 1.1 to LTI 1.3 in regards to MATLAB Grader? MATLAB Answers — New Questions
Error using FTP mget function – File not found on server
Hello everyone!
I’ve tried to use the mget function to get a file from a FTP server. It results in an error message that indicates that the file doesn’t exist, but the file does exist. In fact, if I use the function delete with the same file name, it works properly, see the image below:
Furthermore, if I use mget(ftpobj,"*.txt"), it works and gets all the txt files, but if I use mget(ftpobj,"filename.txt") it does not work. I’ve also tried the mput function and it works well.
Has anyone experience this issue? Does anyone have a solution?
I’ve tried to see where the error is produced. Using the debugger in mget function, I’ve found that it calls the dir function in line 39:
[dirStruct, folderOrFile] = dir(obj, str);
This line outputs an empty dirStruct and folderOrFile = -1, which I guess it means a not found file.
But the problem is that if I open the dir function, I see that the second input argument is not a file name, but a folder name:
function varargout = dir(obj, folderName, options)
In fact, dir(obj) lists correctly the content.
Could it be the cause of the problem?
I appreciate any help to solve this problem.Hello everyone!
I’ve tried to use the mget function to get a file from a FTP server. It results in an error message that indicates that the file doesn’t exist, but the file does exist. In fact, if I use the function delete with the same file name, it works properly, see the image below:
Furthermore, if I use mget(ftpobj,"*.txt"), it works and gets all the txt files, but if I use mget(ftpobj,"filename.txt") it does not work. I’ve also tried the mput function and it works well.
Has anyone experience this issue? Does anyone have a solution?
I’ve tried to see where the error is produced. Using the debugger in mget function, I’ve found that it calls the dir function in line 39:
[dirStruct, folderOrFile] = dir(obj, str);
This line outputs an empty dirStruct and folderOrFile = -1, which I guess it means a not found file.
But the problem is that if I open the dir function, I see that the second input argument is not a file name, but a folder name:
function varargout = dir(obj, folderName, options)
In fact, dir(obj) lists correctly the content.
Could it be the cause of the problem?
I appreciate any help to solve this problem. Hello everyone!
I’ve tried to use the mget function to get a file from a FTP server. It results in an error message that indicates that the file doesn’t exist, but the file does exist. In fact, if I use the function delete with the same file name, it works properly, see the image below:
Furthermore, if I use mget(ftpobj,"*.txt"), it works and gets all the txt files, but if I use mget(ftpobj,"filename.txt") it does not work. I’ve also tried the mput function and it works well.
Has anyone experience this issue? Does anyone have a solution?
I’ve tried to see where the error is produced. Using the debugger in mget function, I’ve found that it calls the dir function in line 39:
[dirStruct, folderOrFile] = dir(obj, str);
This line outputs an empty dirStruct and folderOrFile = -1, which I guess it means a not found file.
But the problem is that if I open the dir function, I see that the second input argument is not a file name, but a folder name:
function varargout = dir(obj, folderName, options)
In fact, dir(obj) lists correctly the content.
Could it be the cause of the problem?
I appreciate any help to solve this problem. ftp, file MATLAB Answers — New Questions
How to get xy coordinates from a binary image matrix
How do I get the xy coordinates of all the 1’s in a binary matrix?How do I get the xy coordinates of all the 1’s in a binary matrix? How do I get the xy coordinates of all the 1’s in a binary matrix? image processing, binary, plotting MATLAB Answers — New Questions
How can I increase a count in the while iterator block?
I am trying to run a whilte iterator block for the convergence of a variable, but this variable is not decreasing at all.
The goal is to reach at Display3 a value higher than 7.94 (Psep) and Display1 to show a value lesser than 31.
Could you help with this matter?
Thanks in advance.I am trying to run a whilte iterator block for the convergence of a variable, but this variable is not decreasing at all.
The goal is to reach at Display3 a value higher than 7.94 (Psep) and Display1 to show a value lesser than 31.
Could you help with this matter?
Thanks in advance. I am trying to run a whilte iterator block for the convergence of a variable, but this variable is not decreasing at all.
The goal is to reach at Display3 a value higher than 7.94 (Psep) and Display1 to show a value lesser than 31.
Could you help with this matter?
Thanks in advance. use of a while iterator block, convergence, simulink MATLAB Answers — New Questions
How to find and utilize a “built-in method % static method or namespace function”
I have a piece of code that uses the MEX file tifflib.mexw64. Up through R2024a, this file could be found at $matlabroottoolboxmatlabmatlab_imagestiffprivatetifflib.mexw64.
However, beginning in R2024b, this file no longer ships with MATLAB, which causes my code to fail.
I think I have identified the source of the issue by examining the built-in class Tiff.m, which also utilizes tifflib.mexw64. In the 2024a version, this mex file is accessed using the command tifflib(<args>). But in the 2025a version, the call is to matlab.internal.imagesci.tifflib(<args>). I tried to determine where the function resides by typing
which("matlab.internal.imagesci.tifflib")
on the command line in R2025a. The output is
"tifflib is a built-in method % static method or namespace function"
I don’t understand this output. Does it mean that tifflib.mex no longer exists as a stand-alone file and is now bundled into the matlab code itself, somehow?
My main goal is to continue to use tifflib functions without modifying my code. I could, of course, change all of my tifflib calls to point to matlab.internal.imagesci.tifflib(<args>), but I suspect that would break backwards compatibility. The easiest solution might be to copy the tifflib that ships with R2025a (if I can locate it) to a /private folder where my code can access it. But I’m open to other approaches as well. Thanks for any alternative suggestions on how to deal with this.I have a piece of code that uses the MEX file tifflib.mexw64. Up through R2024a, this file could be found at $matlabroottoolboxmatlabmatlab_imagestiffprivatetifflib.mexw64.
However, beginning in R2024b, this file no longer ships with MATLAB, which causes my code to fail.
I think I have identified the source of the issue by examining the built-in class Tiff.m, which also utilizes tifflib.mexw64. In the 2024a version, this mex file is accessed using the command tifflib(<args>). But in the 2025a version, the call is to matlab.internal.imagesci.tifflib(<args>). I tried to determine where the function resides by typing
which("matlab.internal.imagesci.tifflib")
on the command line in R2025a. The output is
"tifflib is a built-in method % static method or namespace function"
I don’t understand this output. Does it mean that tifflib.mex no longer exists as a stand-alone file and is now bundled into the matlab code itself, somehow?
My main goal is to continue to use tifflib functions without modifying my code. I could, of course, change all of my tifflib calls to point to matlab.internal.imagesci.tifflib(<args>), but I suspect that would break backwards compatibility. The easiest solution might be to copy the tifflib that ships with R2025a (if I can locate it) to a /private folder where my code can access it. But I’m open to other approaches as well. Thanks for any alternative suggestions on how to deal with this. I have a piece of code that uses the MEX file tifflib.mexw64. Up through R2024a, this file could be found at $matlabroottoolboxmatlabmatlab_imagestiffprivatetifflib.mexw64.
However, beginning in R2024b, this file no longer ships with MATLAB, which causes my code to fail.
I think I have identified the source of the issue by examining the built-in class Tiff.m, which also utilizes tifflib.mexw64. In the 2024a version, this mex file is accessed using the command tifflib(<args>). But in the 2025a version, the call is to matlab.internal.imagesci.tifflib(<args>). I tried to determine where the function resides by typing
which("matlab.internal.imagesci.tifflib")
on the command line in R2025a. The output is
"tifflib is a built-in method % static method or namespace function"
I don’t understand this output. Does it mean that tifflib.mex no longer exists as a stand-alone file and is now bundled into the matlab code itself, somehow?
My main goal is to continue to use tifflib functions without modifying my code. I could, of course, change all of my tifflib calls to point to matlab.internal.imagesci.tifflib(<args>), but I suspect that would break backwards compatibility. The easiest solution might be to copy the tifflib that ships with R2025a (if I can locate it) to a /private folder where my code can access it. But I’m open to other approaches as well. Thanks for any alternative suggestions on how to deal with this. built-in functions, tiff, libtiff MATLAB Answers — New Questions
rename files using matlab
Hello all,
I have a folder on my desktop that has 10 text files as following:
A.txt
Abgd.txt
B.txt
Bbgd.txt
C.txt
Cbgd.txt
S.txt
Sbgd.txt
std.txt
stdbgd.txt
I want to write a code that the changes the names of the first 8 files. I want to rename these files and add an underline (i.e. ‘_’) after the first letterof each file. So my output should look like this:
A_.txt
A_bgd.txt
B_.txt
B_bgd.txt
C_.txt
C_bgd.txt
S_.txt
S_bgd.txt
Here is what I have done so far:
clear all; clc;
d = ‘C:UserskrrazDesktopDay13*.txt’;
oldnames = dir(d);
oldnames = {oldnames(~[oldnames.isdir]).name};
L = length(oldnames);
oldnames = oldnames(1:L-2);
points = oldnames(1:2:end);
points = cellfun(@(x) x(1:1), points, ‘UniformOutput’, false);
strr = ‘_.txt’; strr = string(strr);
for n = 1:numel(points)
formatSpec = ‘%1$s%2$s’;
points{n} = sprintf(formatSpec,points{n},strr);
end
bgds = oldnames(2:2:end);
bgds = cellfun(@(x) x(1:1), bgds, ‘UniformOutput’, false);
strr = ‘_bgd.txt’; strr = string(strr);
for n = 1:numel(bgds)
formatSpec = ‘%1$s%2$s’;
bgds{n} = sprintf(formatSpec,bgds{n},strr);
end
newnames = [points bgds];
newnames = sort(newnames);
for j=1:numel(oldnames)
movefile(d,newnames{j},’f’);
end
But when I run my code, It generates a new folder on my desktop and doesn’t change the names of the files. What am I doing wrong?
Any insight will be appreciated.Hello all,
I have a folder on my desktop that has 10 text files as following:
A.txt
Abgd.txt
B.txt
Bbgd.txt
C.txt
Cbgd.txt
S.txt
Sbgd.txt
std.txt
stdbgd.txt
I want to write a code that the changes the names of the first 8 files. I want to rename these files and add an underline (i.e. ‘_’) after the first letterof each file. So my output should look like this:
A_.txt
A_bgd.txt
B_.txt
B_bgd.txt
C_.txt
C_bgd.txt
S_.txt
S_bgd.txt
Here is what I have done so far:
clear all; clc;
d = ‘C:UserskrrazDesktopDay13*.txt’;
oldnames = dir(d);
oldnames = {oldnames(~[oldnames.isdir]).name};
L = length(oldnames);
oldnames = oldnames(1:L-2);
points = oldnames(1:2:end);
points = cellfun(@(x) x(1:1), points, ‘UniformOutput’, false);
strr = ‘_.txt’; strr = string(strr);
for n = 1:numel(points)
formatSpec = ‘%1$s%2$s’;
points{n} = sprintf(formatSpec,points{n},strr);
end
bgds = oldnames(2:2:end);
bgds = cellfun(@(x) x(1:1), bgds, ‘UniformOutput’, false);
strr = ‘_bgd.txt’; strr = string(strr);
for n = 1:numel(bgds)
formatSpec = ‘%1$s%2$s’;
bgds{n} = sprintf(formatSpec,bgds{n},strr);
end
newnames = [points bgds];
newnames = sort(newnames);
for j=1:numel(oldnames)
movefile(d,newnames{j},’f’);
end
But when I run my code, It generates a new folder on my desktop and doesn’t change the names of the files. What am I doing wrong?
Any insight will be appreciated. Hello all,
I have a folder on my desktop that has 10 text files as following:
A.txt
Abgd.txt
B.txt
Bbgd.txt
C.txt
Cbgd.txt
S.txt
Sbgd.txt
std.txt
stdbgd.txt
I want to write a code that the changes the names of the first 8 files. I want to rename these files and add an underline (i.e. ‘_’) after the first letterof each file. So my output should look like this:
A_.txt
A_bgd.txt
B_.txt
B_bgd.txt
C_.txt
C_bgd.txt
S_.txt
S_bgd.txt
Here is what I have done so far:
clear all; clc;
d = ‘C:UserskrrazDesktopDay13*.txt’;
oldnames = dir(d);
oldnames = {oldnames(~[oldnames.isdir]).name};
L = length(oldnames);
oldnames = oldnames(1:L-2);
points = oldnames(1:2:end);
points = cellfun(@(x) x(1:1), points, ‘UniformOutput’, false);
strr = ‘_.txt’; strr = string(strr);
for n = 1:numel(points)
formatSpec = ‘%1$s%2$s’;
points{n} = sprintf(formatSpec,points{n},strr);
end
bgds = oldnames(2:2:end);
bgds = cellfun(@(x) x(1:1), bgds, ‘UniformOutput’, false);
strr = ‘_bgd.txt’; strr = string(strr);
for n = 1:numel(bgds)
formatSpec = ‘%1$s%2$s’;
bgds{n} = sprintf(formatSpec,bgds{n},strr);
end
newnames = [points bgds];
newnames = sort(newnames);
for j=1:numel(oldnames)
movefile(d,newnames{j},’f’);
end
But when I run my code, It generates a new folder on my desktop and doesn’t change the names of the files. What am I doing wrong?
Any insight will be appreciated. file rename MATLAB Answers — New Questions
installation issues – license
tried to use my downloaded license and get this error
MathWorks Licensing Error 21
Unable to find a license for this release of MATLAB.
Activate your license to get a new license file.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/21
Details for Support
Feature: MATLAB
License: /Users/proca/Library/Application Support/MathWorks/MATLAB/R2025b_licenses/license_proca-mac2.roam.internal_970284_R2025b.lic:/Applications/MATLAB_R2025b.app/licenses/license.dat:/Applications/MATLAB_R2025b.app/licenses/*.lic
Error Code: -21.2tried to use my downloaded license and get this error
MathWorks Licensing Error 21
Unable to find a license for this release of MATLAB.
Activate your license to get a new license file.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/21
Details for Support
Feature: MATLAB
License: /Users/proca/Library/Application Support/MathWorks/MATLAB/R2025b_licenses/license_proca-mac2.roam.internal_970284_R2025b.lic:/Applications/MATLAB_R2025b.app/licenses/license.dat:/Applications/MATLAB_R2025b.app/licenses/*.lic
Error Code: -21.2 tried to use my downloaded license and get this error
MathWorks Licensing Error 21
Unable to find a license for this release of MATLAB.
Activate your license to get a new license file.
For help with this issue, see this support article:
https://www.mathworks.com/support/lme/21
Details for Support
Feature: MATLAB
License: /Users/proca/Library/Application Support/MathWorks/MATLAB/R2025b_licenses/license_proca-mac2.roam.internal_970284_R2025b.lic:/Applications/MATLAB_R2025b.app/licenses/license.dat:/Applications/MATLAB_R2025b.app/licenses/*.lic
Error Code: -21.2 license MATLAB Answers — New Questions
Wait for user to delete points in a plot and then continue with rest of code
I am trying to write a piece of code that plots points, lets a user delete certain points (right now I am doing it through brushing and clicking "Remove Brushed"), and then updates the source data to later be used for further execution (using linkdata). However, functions like uiwait and waitfor stall the whole execution and do not allow the user to use "Remove Brushed." Here, removing extraneous points is crucial for the transformation function in step 3.
It seems like "Removed Brushed" only works after code execution is totally complete. I could simply have users run two scripts/functions, or ask them to run steps 2 and 3 as different sections, but I want this to be as easy as possible for users.
Is there something I am missing? Are there other (visual) ways for users to delete points and update the data (or save as another variable)? Any help would be greatly appreciated.
% STEP 1: Import (example) data
exported_centers = [5,10; 5,7];
image_centers = [6,10; 6,7; 10,4];
% STEP 2: Clean up unpaired image_centers not associated with a exported_center
fig = figure; hold on
ax = gca;
ax.XLim(1) = 0; ax.XLim(2) = 15;
ax.YLim(1) = 0; ax.YLim(2) = 15;
% reference image in blue, exported particles red
scatter(image_centers(:,1),image_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’b’)
scatter(exported_centers(:,1),exported_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’r’)
message = sprintf(‘Drag left click around blue points that do not look to have a red dot associated with it. nThen, right click on the gray point and select Remove Brushed’);
msgbox(message)
linkdata on
b = brush;
b.Enable = ‘on’;
b.Color = [0.5 0.5 0.5]; % gray
% waitfor(msgbox(message)) nope
% waitfor(fig) nope
% uiwait(fig) nope
% uiwait(msgbox(message)) nope
% while ~waitforbuttonpress
% end nope
% input(‘Press Enter to continue…’) nope
% pause; nope
% return; yes, but defeats the purpose of continuing onto step 3
% STEP 3: Transform! – breaks if users not allowed to delete extraneous points
tform = fitgeotrans(exported_centers,image_centers,’affine’);
[tX,tY] = transformPointsForward(tform,exported_centers(:,1),exported_centers(:,2));
newPos = horzcat(tX,tY); % newPos is updated particle positionsI am trying to write a piece of code that plots points, lets a user delete certain points (right now I am doing it through brushing and clicking "Remove Brushed"), and then updates the source data to later be used for further execution (using linkdata). However, functions like uiwait and waitfor stall the whole execution and do not allow the user to use "Remove Brushed." Here, removing extraneous points is crucial for the transformation function in step 3.
It seems like "Removed Brushed" only works after code execution is totally complete. I could simply have users run two scripts/functions, or ask them to run steps 2 and 3 as different sections, but I want this to be as easy as possible for users.
Is there something I am missing? Are there other (visual) ways for users to delete points and update the data (or save as another variable)? Any help would be greatly appreciated.
% STEP 1: Import (example) data
exported_centers = [5,10; 5,7];
image_centers = [6,10; 6,7; 10,4];
% STEP 2: Clean up unpaired image_centers not associated with a exported_center
fig = figure; hold on
ax = gca;
ax.XLim(1) = 0; ax.XLim(2) = 15;
ax.YLim(1) = 0; ax.YLim(2) = 15;
% reference image in blue, exported particles red
scatter(image_centers(:,1),image_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’b’)
scatter(exported_centers(:,1),exported_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’r’)
message = sprintf(‘Drag left click around blue points that do not look to have a red dot associated with it. nThen, right click on the gray point and select Remove Brushed’);
msgbox(message)
linkdata on
b = brush;
b.Enable = ‘on’;
b.Color = [0.5 0.5 0.5]; % gray
% waitfor(msgbox(message)) nope
% waitfor(fig) nope
% uiwait(fig) nope
% uiwait(msgbox(message)) nope
% while ~waitforbuttonpress
% end nope
% input(‘Press Enter to continue…’) nope
% pause; nope
% return; yes, but defeats the purpose of continuing onto step 3
% STEP 3: Transform! – breaks if users not allowed to delete extraneous points
tform = fitgeotrans(exported_centers,image_centers,’affine’);
[tX,tY] = transformPointsForward(tform,exported_centers(:,1),exported_centers(:,2));
newPos = horzcat(tX,tY); % newPos is updated particle positions I am trying to write a piece of code that plots points, lets a user delete certain points (right now I am doing it through brushing and clicking "Remove Brushed"), and then updates the source data to later be used for further execution (using linkdata). However, functions like uiwait and waitfor stall the whole execution and do not allow the user to use "Remove Brushed." Here, removing extraneous points is crucial for the transformation function in step 3.
It seems like "Removed Brushed" only works after code execution is totally complete. I could simply have users run two scripts/functions, or ask them to run steps 2 and 3 as different sections, but I want this to be as easy as possible for users.
Is there something I am missing? Are there other (visual) ways for users to delete points and update the data (or save as another variable)? Any help would be greatly appreciated.
% STEP 1: Import (example) data
exported_centers = [5,10; 5,7];
image_centers = [6,10; 6,7; 10,4];
% STEP 2: Clean up unpaired image_centers not associated with a exported_center
fig = figure; hold on
ax = gca;
ax.XLim(1) = 0; ax.XLim(2) = 15;
ax.YLim(1) = 0; ax.YLim(2) = 15;
% reference image in blue, exported particles red
scatter(image_centers(:,1),image_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’b’)
scatter(exported_centers(:,1),exported_centers(:,2),40,’filled’,’o’,’MarkerFaceColor’,’r’)
message = sprintf(‘Drag left click around blue points that do not look to have a red dot associated with it. nThen, right click on the gray point and select Remove Brushed’);
msgbox(message)
linkdata on
b = brush;
b.Enable = ‘on’;
b.Color = [0.5 0.5 0.5]; % gray
% waitfor(msgbox(message)) nope
% waitfor(fig) nope
% uiwait(fig) nope
% uiwait(msgbox(message)) nope
% while ~waitforbuttonpress
% end nope
% input(‘Press Enter to continue…’) nope
% pause; nope
% return; yes, but defeats the purpose of continuing onto step 3
% STEP 3: Transform! – breaks if users not allowed to delete extraneous points
tform = fitgeotrans(exported_centers,image_centers,’affine’);
[tX,tY] = transformPointsForward(tform,exported_centers(:,1),exported_centers(:,2));
newPos = horzcat(tX,tY); % newPos is updated particle positions image processing, image, graph MATLAB Answers — New Questions
How to change drone mass and corresponding thrust configuration in UAV Package Delivery example?
Hi!
I am using the UAV Package Delivery example model with the high-fidelity plant model (shortcut 8).
In the data dictionary uavPackageDeliveryDataDict.sldd, I see the parameter Vehicle.Airframe.mass (default value = 0.063 kg) inside the Vehicle struct. With the default mass, the UAV can take off and hover properly. However, when I increase the mass to a higher value (e.g., 0.15 kg), the UAV can no longer take off.
From this behavior, I assume that in addition to changing the mass parameter, the thrust generation (motor model, thrust coefficient, maximum thrust, controller gains / trim thrust, rotor blade properties in the Vehicle struct, saturation limits, etc.) must also be updated accordingly.
Could you please advise:
Which parameters in this example control the maximum thrust / thrust-to-weight capability of the vehicle?
What is the recommended way to scale or retune the propulsion model and/or controller when changing the vehicle mass?
Are there specific blocks or parameters in the high-fidelity plant model (e.g., motor, propeller, or actuator models) that should be modified for this purpose?
Thank you very much for your support!Hi!
I am using the UAV Package Delivery example model with the high-fidelity plant model (shortcut 8).
In the data dictionary uavPackageDeliveryDataDict.sldd, I see the parameter Vehicle.Airframe.mass (default value = 0.063 kg) inside the Vehicle struct. With the default mass, the UAV can take off and hover properly. However, when I increase the mass to a higher value (e.g., 0.15 kg), the UAV can no longer take off.
From this behavior, I assume that in addition to changing the mass parameter, the thrust generation (motor model, thrust coefficient, maximum thrust, controller gains / trim thrust, rotor blade properties in the Vehicle struct, saturation limits, etc.) must also be updated accordingly.
Could you please advise:
Which parameters in this example control the maximum thrust / thrust-to-weight capability of the vehicle?
What is the recommended way to scale or retune the propulsion model and/or controller when changing the vehicle mass?
Are there specific blocks or parameters in the high-fidelity plant model (e.g., motor, propeller, or actuator models) that should be modified for this purpose?
Thank you very much for your support! Hi!
I am using the UAV Package Delivery example model with the high-fidelity plant model (shortcut 8).
In the data dictionary uavPackageDeliveryDataDict.sldd, I see the parameter Vehicle.Airframe.mass (default value = 0.063 kg) inside the Vehicle struct. With the default mass, the UAV can take off and hover properly. However, when I increase the mass to a higher value (e.g., 0.15 kg), the UAV can no longer take off.
From this behavior, I assume that in addition to changing the mass parameter, the thrust generation (motor model, thrust coefficient, maximum thrust, controller gains / trim thrust, rotor blade properties in the Vehicle struct, saturation limits, etc.) must also be updated accordingly.
Could you please advise:
Which parameters in this example control the maximum thrust / thrust-to-weight capability of the vehicle?
What is the recommended way to scale or retune the propulsion model and/or controller when changing the vehicle mass?
Are there specific blocks or parameters in the high-fidelity plant model (e.g., motor, propeller, or actuator models) that should be modified for this purpose?
Thank you very much for your support! uav, drone, simulink, simulation, visualization MATLAB Answers — New Questions
How can I simulate multiple UAVs (e.g., 2 vehicles) in the UAV Package Delivery example model, and what parts of the model need to be duplicated vs shared?
https://www.mathworks.com/help/uav/ug/uav-package-delivery.html
Hi!
I’m using the UAV Package Delivery example model (shortcut 8: photorealistic environment with high-fidelity plant model) and I want to simulate multiple UAVs in the same Simulink simulation (start with 2 UAVs).
My current assumption is that I need to duplicate some subsystems per UAV (plant, controller, sensors, etc.), but this model is large and complicated, so I’m not sure:
Which blocks/subsystems must be duplicated per UAV (plant + controller + estimator + guidance + sensors?)
Which blocks should be shared across all UAVs (scenario/world, environment, visualization, mission planner, etc.)
How the data flow should be organized so each UAV stays independent (namespaces, buses, variants, model references, data dictionaries, etc.)
How to correctly handle multiple instances of the Simulation 3D UAV Vehicle block / visualization, including transforms and coordinate frames, without conflicts
In addition, I eventually want each UAV to have its own mission plan coming from QGroundControl (QGC) (live mission feed). I found this related topic and plan to try it later, after I can run multiple UAVs first:
https://www.mathworks.com/matlabcentral/answers/1744715-how-to-get-multiple-mission-plan-from-q-ground-control-for-uav-package-delivery-example
Extra context:
I’m feeding a live predefined mission from QGC into the model.
I modified the Simulation 3D Scene Configuration block to use Cesium ion visualization instead of the default Unreal environment.
I’m currently working with the high-fidelity plant setup.
I’m using MATLAB R2025b
If possible, I’d appreciate guidance like “duplicate these subsystems, keep these shared,” and any best practices (Model Reference, For Each Subsystem, variant subsystems, buses, etc.).
Thanks a lot. I appreciate any help.https://www.mathworks.com/help/uav/ug/uav-package-delivery.html
Hi!
I’m using the UAV Package Delivery example model (shortcut 8: photorealistic environment with high-fidelity plant model) and I want to simulate multiple UAVs in the same Simulink simulation (start with 2 UAVs).
My current assumption is that I need to duplicate some subsystems per UAV (plant, controller, sensors, etc.), but this model is large and complicated, so I’m not sure:
Which blocks/subsystems must be duplicated per UAV (plant + controller + estimator + guidance + sensors?)
Which blocks should be shared across all UAVs (scenario/world, environment, visualization, mission planner, etc.)
How the data flow should be organized so each UAV stays independent (namespaces, buses, variants, model references, data dictionaries, etc.)
How to correctly handle multiple instances of the Simulation 3D UAV Vehicle block / visualization, including transforms and coordinate frames, without conflicts
In addition, I eventually want each UAV to have its own mission plan coming from QGroundControl (QGC) (live mission feed). I found this related topic and plan to try it later, after I can run multiple UAVs first:
https://www.mathworks.com/matlabcentral/answers/1744715-how-to-get-multiple-mission-plan-from-q-ground-control-for-uav-package-delivery-example
Extra context:
I’m feeding a live predefined mission from QGC into the model.
I modified the Simulation 3D Scene Configuration block to use Cesium ion visualization instead of the default Unreal environment.
I’m currently working with the high-fidelity plant setup.
I’m using MATLAB R2025b
If possible, I’d appreciate guidance like “duplicate these subsystems, keep these shared,” and any best practices (Model Reference, For Each Subsystem, variant subsystems, buses, etc.).
Thanks a lot. I appreciate any help. https://www.mathworks.com/help/uav/ug/uav-package-delivery.html
Hi!
I’m using the UAV Package Delivery example model (shortcut 8: photorealistic environment with high-fidelity plant model) and I want to simulate multiple UAVs in the same Simulink simulation (start with 2 UAVs).
My current assumption is that I need to duplicate some subsystems per UAV (plant, controller, sensors, etc.), but this model is large and complicated, so I’m not sure:
Which blocks/subsystems must be duplicated per UAV (plant + controller + estimator + guidance + sensors?)
Which blocks should be shared across all UAVs (scenario/world, environment, visualization, mission planner, etc.)
How the data flow should be organized so each UAV stays independent (namespaces, buses, variants, model references, data dictionaries, etc.)
How to correctly handle multiple instances of the Simulation 3D UAV Vehicle block / visualization, including transforms and coordinate frames, without conflicts
In addition, I eventually want each UAV to have its own mission plan coming from QGroundControl (QGC) (live mission feed). I found this related topic and plan to try it later, after I can run multiple UAVs first:
https://www.mathworks.com/matlabcentral/answers/1744715-how-to-get-multiple-mission-plan-from-q-ground-control-for-uav-package-delivery-example
Extra context:
I’m feeding a live predefined mission from QGC into the model.
I modified the Simulation 3D Scene Configuration block to use Cesium ion visualization instead of the default Unreal environment.
I’m currently working with the high-fidelity plant setup.
I’m using MATLAB R2025b
If possible, I’d appreciate guidance like “duplicate these subsystems, keep these shared,” and any best practices (Model Reference, For Each Subsystem, variant subsystems, buses, etc.).
Thanks a lot. I appreciate any help. uav, drone, simulink, simulation, visualization MATLAB Answers — New Questions
It seems that data is not recorded
Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak?Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak? Hello, since this morning (around 8h00 am, Paris time), data sent by my iots is not recorded. I have not changed any settings on my iots and my internet connection is OK. On the page with my channels, it seems that the channels are updated because I see that the "updated" times are evolving. Is there a problem today with Thingspeak? thingspeak, service down MATLAB Answers — New Questions
Does MATLAB run on (just announced) MacBook Neo
I do realize that Apple only just announced MacBook Neo, with an A-series chip. Given that MATLAB supports all M-series chips on current MacBooks, I’d like to know if MATLAB supports this new architecture?I do realize that Apple only just announced MacBook Neo, with an A-series chip. Given that MATLAB supports all M-series chips on current MacBooks, I’d like to know if MATLAB supports this new architecture? I do realize that Apple only just announced MacBook Neo, with an A-series chip. Given that MATLAB supports all M-series chips on current MacBooks, I’d like to know if MATLAB supports this new architecture? a-series chip MATLAB Answers — New Questions
Speed command spikes during host-controlled ramp on F28069M dual-motor dyno model
I’m using the mcb_pmsm_foc_qep_dyno_f28069m example with a TI F28069M LaunchPad and two DRV8305 booster packs in the motor-dyno configuration.
When I run the model with a constant RPM command from the host, both motors behave normally and the reference speed is stable.
However, when I switch to a ramp input from the host model (over the SCI TX/RX link), the target’s Speed_Ref_PU signal occasionally spikes to extreme values, causing the control loop to overflow and the motor to jerk or stall.
I’ve verified that:
The host model sends a continuous ramp through SCI without discontinuities.
The issue persists whether I send only “speed” or include the full SCI data vector (motor select, debug flags, enable bits).
The model works fine with single-step commands or static RPM inputs.
This makes me suspect that the serial communication framing or data synchronization in the receive path is being corrupted when streaming continuous values, possibly because the dyno model’s receive subsystem expects discrete “change-only” packets instead of continuous float updates.
Questions:
Is the dyno example’s SCI receive block designed for discrete or continuous data streaming?
What is the recommended way to send a smooth ramp command from the host without causing overflow?
Would it be more stable to generate the speed profile directly on the target model instead of streaming it over SCI?
Are there any updates or simplified single-motor examples for the F28069M that demonstrate host-controlled ramp inputs safely?
Any advice or updated example links would be greatly appreciated.I’m using the mcb_pmsm_foc_qep_dyno_f28069m example with a TI F28069M LaunchPad and two DRV8305 booster packs in the motor-dyno configuration.
When I run the model with a constant RPM command from the host, both motors behave normally and the reference speed is stable.
However, when I switch to a ramp input from the host model (over the SCI TX/RX link), the target’s Speed_Ref_PU signal occasionally spikes to extreme values, causing the control loop to overflow and the motor to jerk or stall.
I’ve verified that:
The host model sends a continuous ramp through SCI without discontinuities.
The issue persists whether I send only “speed” or include the full SCI data vector (motor select, debug flags, enable bits).
The model works fine with single-step commands or static RPM inputs.
This makes me suspect that the serial communication framing or data synchronization in the receive path is being corrupted when streaming continuous values, possibly because the dyno model’s receive subsystem expects discrete “change-only” packets instead of continuous float updates.
Questions:
Is the dyno example’s SCI receive block designed for discrete or continuous data streaming?
What is the recommended way to send a smooth ramp command from the host without causing overflow?
Would it be more stable to generate the speed profile directly on the target model instead of streaming it over SCI?
Are there any updates or simplified single-motor examples for the F28069M that demonstrate host-controlled ramp inputs safely?
Any advice or updated example links would be greatly appreciated. I’m using the mcb_pmsm_foc_qep_dyno_f28069m example with a TI F28069M LaunchPad and two DRV8305 booster packs in the motor-dyno configuration.
When I run the model with a constant RPM command from the host, both motors behave normally and the reference speed is stable.
However, when I switch to a ramp input from the host model (over the SCI TX/RX link), the target’s Speed_Ref_PU signal occasionally spikes to extreme values, causing the control loop to overflow and the motor to jerk or stall.
I’ve verified that:
The host model sends a continuous ramp through SCI without discontinuities.
The issue persists whether I send only “speed” or include the full SCI data vector (motor select, debug flags, enable bits).
The model works fine with single-step commands or static RPM inputs.
This makes me suspect that the serial communication framing or data synchronization in the receive path is being corrupted when streaming continuous values, possibly because the dyno model’s receive subsystem expects discrete “change-only” packets instead of continuous float updates.
Questions:
Is the dyno example’s SCI receive block designed for discrete or continuous data streaming?
What is the recommended way to send a smooth ramp command from the host without causing overflow?
Would it be more stable to generate the speed profile directly on the target model instead of streaming it over SCI?
Are there any updates or simplified single-motor examples for the F28069M that demonstrate host-controlled ramp inputs safely?
Any advice or updated example links would be greatly appreciated. c2000, sci, overflow, pmsm MATLAB Answers — New Questions
How to make Crossed Dipole antenna with Cylindrical Dipoles
Hello, I am attempting to model an antenna array of crossed dipoles and realized that the dipole object returns a strip dipole element instead of a cylindrical dipole. The crossed dipole object does not seem able to accept the cylindrical dipole as an element input and would like to know how to make a crossed dipole element such that all contributions in all directions are accounted for. Thanks!Hello, I am attempting to model an antenna array of crossed dipoles and realized that the dipole object returns a strip dipole element instead of a cylindrical dipole. The crossed dipole object does not seem able to accept the cylindrical dipole as an element input and would like to know how to make a crossed dipole element such that all contributions in all directions are accounted for. Thanks! Hello, I am attempting to model an antenna array of crossed dipoles and realized that the dipole object returns a strip dipole element instead of a cylindrical dipole. The crossed dipole object does not seem able to accept the cylindrical dipole as an element input and would like to know how to make a crossed dipole element such that all contributions in all directions are accounted for. Thanks! antenna, dipole, crossed dipole, cylindrical dipole MATLAB Answers — New Questions









