Category: Matlab
Category Archives: Matlab
Im experiencing misalignment of the crests in my normalized vertical velocity profiles when plotting multiple turbulence models; any suggestions on how to fix this?
Basically I had a running code for radial velocity contours which was fixed an all the crests aligned. Now i have changed the input files and associated names in the codes but the crests are not aligning, any and all help will be apreciatedBasically I had a running code for radial velocity contours which was fixed an all the crests aligned. Now i have changed the input files and associated names in the codes but the crests are not aligning, any and all help will be apreciated Basically I had a running code for radial velocity contours which was fixed an all the crests aligned. Now i have changed the input files and associated names in the codes but the crests are not aligning, any and all help will be apreciated plotting MATLAB Answers — New Questions
MATLAB runtime installer doesn’t launch on Macbook (with M3 chip)
I’m trying to install and configure MATLAB Runtime by following this article. I downloaded the corresponding installer for my macbook (arm64) and MATLAB version (MATLAB R2024a), and moved the installer in my app folder:
However, even if I double-click the app, it doesn’t display a dialog box. I allowed MATLAB to have a full disk access, but it didn’t fix the problem. Does anyone have similar experience?I’m trying to install and configure MATLAB Runtime by following this article. I downloaded the corresponding installer for my macbook (arm64) and MATLAB version (MATLAB R2024a), and moved the installer in my app folder:
However, even if I double-click the app, it doesn’t display a dialog box. I allowed MATLAB to have a full disk access, but it didn’t fix the problem. Does anyone have similar experience? I’m trying to install and configure MATLAB Runtime by following this article. I downloaded the corresponding installer for my macbook (arm64) and MATLAB version (MATLAB R2024a), and moved the installer in my app folder:
However, even if I double-click the app, it doesn’t display a dialog box. I allowed MATLAB to have a full disk access, but it didn’t fix the problem. Does anyone have similar experience? matlab runtime, mac MATLAB Answers — New Questions
How can I iterate through an array using a for loop?
I want to iterate through an array of file locations using a for loop.
My current code is something like this:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
%Find excel files in path
%Pull data
% Write into a file
Now this code works great, but now I need to do the same thing to multiple paths while maintaining efficiency. To do this, I created an array of the paths I need to iterate through. How do I use a for loop to iterate through these paths? Here is what I have so far, but my code breaks when it tries to read the path because the text is not scalar when trying to use ‘dir’. Here is what I currently have:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
P2 = C:UsersmeDocuments\My data
%Array of paths
Array = {‘P1, P2’}
for i = 1:length(Array)
%Find excel files in path
%Pull data
% Write into a fileI want to iterate through an array of file locations using a for loop.
My current code is something like this:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
%Find excel files in path
%Pull data
% Write into a file
Now this code works great, but now I need to do the same thing to multiple paths while maintaining efficiency. To do this, I created an array of the paths I need to iterate through. How do I use a for loop to iterate through these paths? Here is what I have so far, but my code breaks when it tries to read the path because the text is not scalar when trying to use ‘dir’. Here is what I currently have:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
P2 = C:UsersmeDocuments\My data
%Array of paths
Array = {‘P1, P2’}
for i = 1:length(Array)
%Find excel files in path
%Pull data
% Write into a file I want to iterate through an array of file locations using a for loop.
My current code is something like this:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
%Find excel files in path
%Pull data
% Write into a file
Now this code works great, but now I need to do the same thing to multiple paths while maintaining efficiency. To do this, I created an array of the paths I need to iterate through. How do I use a for loop to iterate through these paths? Here is what I have so far, but my code breaks when it tries to read the path because the text is not scalar when trying to use ‘dir’. Here is what I currently have:
% Paths where the files are located
P1 = C:UsersmeDocuments\My Info
P2 = C:UsersmeDocuments\My data
%Array of paths
Array = {‘P1, P2’}
for i = 1:length(Array)
%Find excel files in path
%Pull data
% Write into a file matlab, for loop, array MATLAB Answers — New Questions
Using experimental data on geotrajectory function and checking trajectory dynamics with lookuPose function (SATCOM toolbox)
Hello everyone,
Im using SATCOM toolbox to evaluate a SATCOM link.
I have experimental flight profile data with a samplerate of 100Hz, that im using in the geotrajectory function
trajectory = geoTrajectory(Waypoints=[lat lon alt],TimeOfArrival=time,Velocities=[vnedx vnedy vnedz],ReferenceFrame="NED",Orientation=Euler);
then im using the lookupPose function to extract dynamical information
[position,orientation,velocity,acceleration,angularVelocity] = lookupPose(trajectory,time);
Finally, Im comparing the experimental data with the information provided by lookupPose.
Position, orientation and velocity matched the experimental data that was provided in the geotrajectory function.
I derived experimental acceleration using a forward difference numerical derivative of the experimental velocity data. When I compared this experimental acceleration data to the acceleration provided by the lookupPose, the results did not match exactly for velocity in x and y, but they were comparable. This is expected since the lookupPose might be using a different derivative method (see Figure below). However the velocity in z did not match at all.
The results shown above are derived using a sample rate of 1Hz ( I downsampled the experimental data). The problem arises when I increase the sample rate for example to 10 Hz. As seen in the images below the acceleration provide by the lookupPose function goes bersek.
My questions are:
Does the lookupPose function has a minimum sample rate limit (1Hz).
What is the numerical derivative used by the lookupPose function to calculate acceleration from velocity?
Is there a way to change the numerical derivative used by lookupPose to calculate acceleration?
Why does the Z component of acceleration does not match for a sample rate of 1Hz (even worse for 0.1 Hz).
As a reference these are the comparitions between experimental data of velocity ( given to geotrajetory ) and what the lookuppose outputs, (this comparisson is for 10Hz). The results are exactly the same.
Any help or guidance you could provide would be greatly appreciated. Thank you in advance for your assistance!.Hello everyone,
Im using SATCOM toolbox to evaluate a SATCOM link.
I have experimental flight profile data with a samplerate of 100Hz, that im using in the geotrajectory function
trajectory = geoTrajectory(Waypoints=[lat lon alt],TimeOfArrival=time,Velocities=[vnedx vnedy vnedz],ReferenceFrame="NED",Orientation=Euler);
then im using the lookupPose function to extract dynamical information
[position,orientation,velocity,acceleration,angularVelocity] = lookupPose(trajectory,time);
Finally, Im comparing the experimental data with the information provided by lookupPose.
Position, orientation and velocity matched the experimental data that was provided in the geotrajectory function.
I derived experimental acceleration using a forward difference numerical derivative of the experimental velocity data. When I compared this experimental acceleration data to the acceleration provided by the lookupPose, the results did not match exactly for velocity in x and y, but they were comparable. This is expected since the lookupPose might be using a different derivative method (see Figure below). However the velocity in z did not match at all.
The results shown above are derived using a sample rate of 1Hz ( I downsampled the experimental data). The problem arises when I increase the sample rate for example to 10 Hz. As seen in the images below the acceleration provide by the lookupPose function goes bersek.
My questions are:
Does the lookupPose function has a minimum sample rate limit (1Hz).
What is the numerical derivative used by the lookupPose function to calculate acceleration from velocity?
Is there a way to change the numerical derivative used by lookupPose to calculate acceleration?
Why does the Z component of acceleration does not match for a sample rate of 1Hz (even worse for 0.1 Hz).
As a reference these are the comparitions between experimental data of velocity ( given to geotrajetory ) and what the lookuppose outputs, (this comparisson is for 10Hz). The results are exactly the same.
Any help or guidance you could provide would be greatly appreciated. Thank you in advance for your assistance!. Hello everyone,
Im using SATCOM toolbox to evaluate a SATCOM link.
I have experimental flight profile data with a samplerate of 100Hz, that im using in the geotrajectory function
trajectory = geoTrajectory(Waypoints=[lat lon alt],TimeOfArrival=time,Velocities=[vnedx vnedy vnedz],ReferenceFrame="NED",Orientation=Euler);
then im using the lookupPose function to extract dynamical information
[position,orientation,velocity,acceleration,angularVelocity] = lookupPose(trajectory,time);
Finally, Im comparing the experimental data with the information provided by lookupPose.
Position, orientation and velocity matched the experimental data that was provided in the geotrajectory function.
I derived experimental acceleration using a forward difference numerical derivative of the experimental velocity data. When I compared this experimental acceleration data to the acceleration provided by the lookupPose, the results did not match exactly for velocity in x and y, but they were comparable. This is expected since the lookupPose might be using a different derivative method (see Figure below). However the velocity in z did not match at all.
The results shown above are derived using a sample rate of 1Hz ( I downsampled the experimental data). The problem arises when I increase the sample rate for example to 10 Hz. As seen in the images below the acceleration provide by the lookupPose function goes bersek.
My questions are:
Does the lookupPose function has a minimum sample rate limit (1Hz).
What is the numerical derivative used by the lookupPose function to calculate acceleration from velocity?
Is there a way to change the numerical derivative used by lookupPose to calculate acceleration?
Why does the Z component of acceleration does not match for a sample rate of 1Hz (even worse for 0.1 Hz).
As a reference these are the comparitions between experimental data of velocity ( given to geotrajetory ) and what the lookuppose outputs, (this comparisson is for 10Hz). The results are exactly the same.
Any help or guidance you could provide would be greatly appreciated. Thank you in advance for your assistance!. satellite communication toolbox, lookuppose function, acceleration MATLAB Answers — New Questions
¿How can I transform an already working code to a GUI?
I have a code that works fine and gives me the expected outputs. I don´t know how to transform that code into an app that asks me for the inputs and returns the plot of such result.I have a code that works fine and gives me the expected outputs. I don´t know how to transform that code into an app that asks me for the inputs and returns the plot of such result. I have a code that works fine and gives me the expected outputs. I don´t know how to transform that code into an app that asks me for the inputs and returns the plot of such result. gui, graphical interface, guide, appdesigner MATLAB Answers — New Questions
Matlab Runtime eval command permission denied
Hi,
I’m currently trying to get a compiled simulink model running inside a docker container. For this, I’m using the matlab runtime r2022b image from the docker hub. To futher investigate some errors, I started a virtual machine with ubuntu 20 and installed matlab runtime. When I try to run my application with the compiled bash script, I get: "Permission denied"
I installed matlab runtime on the user desktop and also in the standard folder, but it did not work.Hi,
I’m currently trying to get a compiled simulink model running inside a docker container. For this, I’m using the matlab runtime r2022b image from the docker hub. To futher investigate some errors, I started a virtual machine with ubuntu 20 and installed matlab runtime. When I try to run my application with the compiled bash script, I get: "Permission denied"
I installed matlab runtime on the user desktop and also in the standard folder, but it did not work. Hi,
I’m currently trying to get a compiled simulink model running inside a docker container. For this, I’m using the matlab runtime r2022b image from the docker hub. To futher investigate some errors, I started a virtual machine with ubuntu 20 and installed matlab runtime. When I try to run my application with the compiled bash script, I get: "Permission denied"
I installed matlab runtime on the user desktop and also in the standard folder, but it did not work. matlab runtime, linux, installation MATLAB Answers — New Questions
how to extract range of dates from timetable?
hi all,
The attached screenshot shows some data I need to extract based on time from the timetable.
For example, all measurements were collected on July 8, 2021, then all measurements were collected on July 9, 2021, and so on.
your help is appreciatedhi all,
The attached screenshot shows some data I need to extract based on time from the timetable.
For example, all measurements were collected on July 8, 2021, then all measurements were collected on July 9, 2021, and so on.
your help is appreciated hi all,
The attached screenshot shows some data I need to extract based on time from the timetable.
For example, all measurements were collected on July 8, 2021, then all measurements were collected on July 9, 2021, and so on.
your help is appreciated timetable MATLAB Answers — New Questions
How to solve the the parameter ‘SampleTime’ must be a real double scalar (period) or a real double vector of length 2 (period, offset).
the parameter ‘SampleTime’ must be a real double scalar (period) or a real double vector of length 2 (period, offset); where period, offset must be finite and non-negative and offset must be less than period.the parameter ‘SampleTime’ must be a real double scalar (period) or a real double vector of length 2 (period, offset); where period, offset must be finite and non-negative and offset must be less than period. the parameter ‘SampleTime’ must be a real double scalar (period) or a real double vector of length 2 (period, offset); where period, offset must be finite and non-negative and offset must be less than period. muthukumar ganesan MATLAB Answers — New Questions
Rename files in a folder
Hello. I have 21841 TIFF images in a folder with names in the format Camera10001, Camera10002,….Camera121841. I want to rename these files as:
Camera10001 to Camera0001, …. Camera121841 to Camera21841.
% Specify the input and output directories
input_directory = ‘D:ImagesTestCamera_1’;
output_directory = ‘D:ImagesTestCamera_1’;
% Ensure the output directory exists
if ~exist(output_directory, ‘dir’)
mkdir(output_directory);
endHello. I have 21841 TIFF images in a folder with names in the format Camera10001, Camera10002,….Camera121841. I want to rename these files as:
Camera10001 to Camera0001, …. Camera121841 to Camera21841.
% Specify the input and output directories
input_directory = ‘D:ImagesTestCamera_1’;
output_directory = ‘D:ImagesTestCamera_1’;
% Ensure the output directory exists
if ~exist(output_directory, ‘dir’)
mkdir(output_directory);
end Hello. I have 21841 TIFF images in a folder with names in the format Camera10001, Camera10002,….Camera121841. I want to rename these files as:
Camera10001 to Camera0001, …. Camera121841 to Camera21841.
% Specify the input and output directories
input_directory = ‘D:ImagesTestCamera_1’;
output_directory = ‘D:ImagesTestCamera_1’;
% Ensure the output directory exists
if ~exist(output_directory, ‘dir’)
mkdir(output_directory);
end rename, matlab MATLAB Answers — New Questions
Problem with value property of uidropdown
Hi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
MichaelHi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
Michael Hi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
Michael uidropdown, value, items, itemsdata MATLAB Answers — New Questions
slhostlibcantransmit.dll INITIALIZE Error when I try to connect to my ECU through XCP on CAN (using Vehicle Network Toolbox blocks)
I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out?I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out? I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out? xcponcan, vehiclenetworktoolbox, vnt, slhostlibcantransmit.dll MATLAB Answers — New Questions
Index exceeds the number of array elements
Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me?Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me? Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me? index exceeds, number of array MATLAB Answers — New Questions
draw polygon continuously with mouse
לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit.לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit. לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit. drawpolygon, mouse position, cell contour, contour MATLAB Answers — New Questions
Store a script as a function
I made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? ThanksI made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? Thanks I made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? Thanks save, function MATLAB Answers — New Questions
How to remove the error “Can not resolve Simulink signal object for output port” in matlab 2009b
Hello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank youHello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank you Hello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank you matlab, simulink, signal MATLAB Answers — New Questions
Why i am getting this kind of warning in my code outer loop index i is inside the nested function
Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next.Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next. Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next. matlab code MATLAB Answers — New Questions
Unable to delete derived entry in sldd
When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error.When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error. When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error. data dictionary, matlab, simulink MATLAB Answers — New Questions
License manager error -8. I want to change my license from old to new computer.
The licence has been transferred from old laptop to new. But I get this error.The licence has been transferred from old laptop to new. But I get this error. The licence has been transferred from old laptop to new. But I get this error. licence error, when trying to change computer MATLAB Answers — New Questions
Collect information of a file with the same kind of text pattern
Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently?Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently? Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently? text patterns MATLAB Answers — New Questions
How to determine the minimum point of a plot?
Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please.Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please. Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please. transferred MATLAB Answers — New Questions