Category: Matlab
Category Archives: Matlab
Update bus selector by matlab script
Hi, is there a possibility to let a Bus Selector and Bus Creator update by a Matlab Script after I change the element name within a bus object?Hi, is there a possibility to let a Bus Selector and Bus Creator update by a Matlab Script after I change the element name within a bus object? Hi, is there a possibility to let a Bus Selector and Bus Creator update by a Matlab Script after I change the element name within a bus object? bus creator, bus selector, update MATLAB Answers — New Questions
plotting 2d graphs with decimals
I want to plot graph but gives me this error. this is the code i used
time_X_core224_6= readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","A3:A4401")
time_X_core224_7= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","G3:G4401")
time_X_core224_9= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","M3:M4401")
time_X_core224_28= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","S3:S4401")
time_X_core224_38= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","Y3:Y4401")
time_X_core156421= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AE3:AE4401")
Core224_6_KY = readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ4:BE4")
Core224_7_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ9:BE9")
Core224_9_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ14:BE14")
Core224_28_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ19:BE19")
Core224_38_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ24:BE24")
Core224_156421_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ29:BE29")
KY_Fig = plot(time_X_core224_6,Core224_6_KY)
Any solutions?I want to plot graph but gives me this error. this is the code i used
time_X_core224_6= readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","A3:A4401")
time_X_core224_7= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","G3:G4401")
time_X_core224_9= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","M3:M4401")
time_X_core224_28= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","S3:S4401")
time_X_core224_38= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","Y3:Y4401")
time_X_core156421= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AE3:AE4401")
Core224_6_KY = readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ4:BE4")
Core224_7_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ9:BE9")
Core224_9_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ14:BE14")
Core224_28_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ19:BE19")
Core224_38_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ24:BE24")
Core224_156421_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ29:BE29")
KY_Fig = plot(time_X_core224_6,Core224_6_KY)
Any solutions? I want to plot graph but gives me this error. this is the code i used
time_X_core224_6= readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","A3:A4401")
time_X_core224_7= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","G3:G4401")
time_X_core224_9= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","M3:M4401")
time_X_core224_28= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","S3:S4401")
time_X_core224_38= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","Y3:Y4401")
time_X_core156421= readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AE3:AE4401")
Core224_6_KY = readmatrix("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ4:BE4")
Core224_7_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ9:BE9")
Core224_9_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ14:BE14")
Core224_28_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ19:BE19")
Core224_38_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ24:BE24")
Core224_156421_KY = readtable("Лист Microsoft Excel.xlsx","Sheet","Лист1","Range","AZ29:BE29")
KY_Fig = plot(time_X_core224_6,Core224_6_KY)
Any solutions? graph, plotting, 2d, error MATLAB Answers — New Questions
matlab command for delete bus objects
can any one help me, Matlab command for delete busobjects.can any one help me, Matlab command for delete busobjects. can any one help me, Matlab command for delete busobjects. busobjects MATLAB Answers — New Questions
Findings experimental values closest to the setpoint value
Hi there,
I will try to explain the issue I am having to the best of my ability (I have also attached an example excel for clarity). Essentially, in my experiment, I am trying to analyze the loads achieved at specific angles based on setpoint angles I am feeding the actuator (each case has different setpoints but in the case I am introducing here, the setpoints go from -50 to 10). There are two actuators in this example that I am testing (Compu1 and Compu2) (there are actually about 50 overall I’m testing but in this example, there are 2), each with a different achieved angle value and its equavlient load measurement. What I am trying to have Matlab do is export the load value of that actuator that best represents the neareast achieved angle based on the set point fed into it.
Reason for that, is that when I plot the loads achieved of the two actuators, my X axis (set point angle) will have ranging values for each individual actuator so I’m trying to essentially "normalize" the data based on my set "angles to plot" column in excel (increment of 0.1 degrees) and I would want matlab to just export the nearest value to that column so that each actuator can be properly plotted together against the same X range for direct comparsion.
I hope that made sense. Again, this example only includes 2 actutors but I would appreciate it if the solution can be tailored towards an X number of actuators.
Thanks so much in advance!Hi there,
I will try to explain the issue I am having to the best of my ability (I have also attached an example excel for clarity). Essentially, in my experiment, I am trying to analyze the loads achieved at specific angles based on setpoint angles I am feeding the actuator (each case has different setpoints but in the case I am introducing here, the setpoints go from -50 to 10). There are two actuators in this example that I am testing (Compu1 and Compu2) (there are actually about 50 overall I’m testing but in this example, there are 2), each with a different achieved angle value and its equavlient load measurement. What I am trying to have Matlab do is export the load value of that actuator that best represents the neareast achieved angle based on the set point fed into it.
Reason for that, is that when I plot the loads achieved of the two actuators, my X axis (set point angle) will have ranging values for each individual actuator so I’m trying to essentially "normalize" the data based on my set "angles to plot" column in excel (increment of 0.1 degrees) and I would want matlab to just export the nearest value to that column so that each actuator can be properly plotted together against the same X range for direct comparsion.
I hope that made sense. Again, this example only includes 2 actutors but I would appreciate it if the solution can be tailored towards an X number of actuators.
Thanks so much in advance! Hi there,
I will try to explain the issue I am having to the best of my ability (I have also attached an example excel for clarity). Essentially, in my experiment, I am trying to analyze the loads achieved at specific angles based on setpoint angles I am feeding the actuator (each case has different setpoints but in the case I am introducing here, the setpoints go from -50 to 10). There are two actuators in this example that I am testing (Compu1 and Compu2) (there are actually about 50 overall I’m testing but in this example, there are 2), each with a different achieved angle value and its equavlient load measurement. What I am trying to have Matlab do is export the load value of that actuator that best represents the neareast achieved angle based on the set point fed into it.
Reason for that, is that when I plot the loads achieved of the two actuators, my X axis (set point angle) will have ranging values for each individual actuator so I’m trying to essentially "normalize" the data based on my set "angles to plot" column in excel (increment of 0.1 degrees) and I would want matlab to just export the nearest value to that column so that each actuator can be properly plotted together against the same X range for direct comparsion.
I hope that made sense. Again, this example only includes 2 actutors but I would appreciate it if the solution can be tailored towards an X number of actuators.
Thanks so much in advance! matlab, optimization, plot MATLAB Answers — New Questions
I’m trying to plot matrix data from an Excel file, but the plot I obtained (named “2”) doesn’t match my expected result (named “1”); here’s my code—can anyone assist?
I am trying to plot my matrix data from an excel file. However, what I obtained is the same as what I desired. The expected plot is name 1, while what I have obtained is named 2. Here is my code:
% Load the matrix from the Excel sheet
matrix1 = readmatrix(‘Sample_Axes.xlsx’, ‘Sheet’, ‘one’);
% Create a figure with subplots
figure;
% Plot matrix1 using contour
subplot(1, 3, 1);
contourf(matrix1, 20, ‘LineColor’, ‘none’); % 20 contour levels, ‘LineColor’, ‘none’ for no contour lines
cb1 = colorbar;
colormap jet;
title(‘Matrix 1’);
Can someone help me out?I am trying to plot my matrix data from an excel file. However, what I obtained is the same as what I desired. The expected plot is name 1, while what I have obtained is named 2. Here is my code:
% Load the matrix from the Excel sheet
matrix1 = readmatrix(‘Sample_Axes.xlsx’, ‘Sheet’, ‘one’);
% Create a figure with subplots
figure;
% Plot matrix1 using contour
subplot(1, 3, 1);
contourf(matrix1, 20, ‘LineColor’, ‘none’); % 20 contour levels, ‘LineColor’, ‘none’ for no contour lines
cb1 = colorbar;
colormap jet;
title(‘Matrix 1’);
Can someone help me out? I am trying to plot my matrix data from an excel file. However, what I obtained is the same as what I desired. The expected plot is name 1, while what I have obtained is named 2. Here is my code:
% Load the matrix from the Excel sheet
matrix1 = readmatrix(‘Sample_Axes.xlsx’, ‘Sheet’, ‘one’);
% Create a figure with subplots
figure;
% Plot matrix1 using contour
subplot(1, 3, 1);
contourf(matrix1, 20, ‘LineColor’, ‘none’); % 20 contour levels, ‘LineColor’, ‘none’ for no contour lines
cb1 = colorbar;
colormap jet;
title(‘Matrix 1’);
Can someone help me out? matrix, importing excel data, contour MATLAB Answers — New Questions
Plotting a Simulink reinforcement learning environment
Hello there,
I have declared an environment starting from a simulink model:
env = rlSimulinkEnv("main","main/RL Agent",obsInfo,actInfo);
Then i have properly defined the training options and i have executed the training.
Now, I would like to plot the environment during the training process. In the help center i have found the possibility to use create a plot function exploiting a callback on environment update.
Are there any ways to do something similar also for the rlSimulinkEnv command without defining a custom environment with all the dynamic equations?
Thank you in advance.Hello there,
I have declared an environment starting from a simulink model:
env = rlSimulinkEnv("main","main/RL Agent",obsInfo,actInfo);
Then i have properly defined the training options and i have executed the training.
Now, I would like to plot the environment during the training process. In the help center i have found the possibility to use create a plot function exploiting a callback on environment update.
Are there any ways to do something similar also for the rlSimulinkEnv command without defining a custom environment with all the dynamic equations?
Thank you in advance. Hello there,
I have declared an environment starting from a simulink model:
env = rlSimulinkEnv("main","main/RL Agent",obsInfo,actInfo);
Then i have properly defined the training options and i have executed the training.
Now, I would like to plot the environment during the training process. In the help center i have found the possibility to use create a plot function exploiting a callback on environment update.
Are there any ways to do something similar also for the rlSimulinkEnv command without defining a custom environment with all the dynamic equations?
Thank you in advance. rl, simulink, enviroment, plot MATLAB Answers — New Questions
Issue on running PV array/VSC concurrently with Synchronous Machine
Hello,
I am having some trouble in simulating on Simulink this two blocks together:
PV array / Universal Bridge (VSC average model) – I don’t know which is responsible for the errors….
Synchronous Machine
I am able to run these blocks separately (by commenting one, then running the simulation and later commenting the other and running again) so I know it isn’t a problem with parameters and neither a singularity in the synchronous machine, which is one of the errors message that I receive when I try to simulate them together.
Also I know that, probably, it isn’t caused by the dynamics of the system because, as you can see in my model, I put a breaker on the PV array, and tried to run with it open, so that it doesn’t affect the dynamics of the system/synchronous machine, and even so the simulation goes wrong.
Does anybody knows what may be happening? Did this occur with you too? How can I solve it?
Please, try to run the cases I just said and see for yourself.*
The error happens at t = 0.0566 when both PV and SM are connected and non-commented.
*First, run "init_var.m" for setting the system parameters and variables.Hello,
I am having some trouble in simulating on Simulink this two blocks together:
PV array / Universal Bridge (VSC average model) – I don’t know which is responsible for the errors….
Synchronous Machine
I am able to run these blocks separately (by commenting one, then running the simulation and later commenting the other and running again) so I know it isn’t a problem with parameters and neither a singularity in the synchronous machine, which is one of the errors message that I receive when I try to simulate them together.
Also I know that, probably, it isn’t caused by the dynamics of the system because, as you can see in my model, I put a breaker on the PV array, and tried to run with it open, so that it doesn’t affect the dynamics of the system/synchronous machine, and even so the simulation goes wrong.
Does anybody knows what may be happening? Did this occur with you too? How can I solve it?
Please, try to run the cases I just said and see for yourself.*
The error happens at t = 0.0566 when both PV and SM are connected and non-commented.
*First, run "init_var.m" for setting the system parameters and variables. Hello,
I am having some trouble in simulating on Simulink this two blocks together:
PV array / Universal Bridge (VSC average model) – I don’t know which is responsible for the errors….
Synchronous Machine
I am able to run these blocks separately (by commenting one, then running the simulation and later commenting the other and running again) so I know it isn’t a problem with parameters and neither a singularity in the synchronous machine, which is one of the errors message that I receive when I try to simulate them together.
Also I know that, probably, it isn’t caused by the dynamics of the system because, as you can see in my model, I put a breaker on the PV array, and tried to run with it open, so that it doesn’t affect the dynamics of the system/synchronous machine, and even so the simulation goes wrong.
Does anybody knows what may be happening? Did this occur with you too? How can I solve it?
Please, try to run the cases I just said and see for yourself.*
The error happens at t = 0.0566 when both PV and SM are connected and non-commented.
*First, run "init_var.m" for setting the system parameters and variables. pv array, simulink, synchronous machine, universal bridge, vsc MATLAB Answers — New Questions
Gaussian spherical beam code
Does anyone know how to code a gaussian spherical beam in matlab?Does anyone know how to code a gaussian spherical beam in matlab? Does anyone know how to code a gaussian spherical beam in matlab? beams, structured beams, polarisation, propagation MATLAB Answers — New Questions
How do I submit my Kroger Feedback?
It’s my first visit at Kroger and I want to give my feedback to Kroger. I know little bit about Kroger feedback survey, but don’t have deep knowledge. Please guys if anyone know about this customer satisfaction Kroger customer satisfaction surveyIt’s my first visit at Kroger and I want to give my feedback to Kroger. I know little bit about Kroger feedback survey, but don’t have deep knowledge. Please guys if anyone know about this customer satisfaction Kroger customer satisfaction survey It’s my first visit at Kroger and I want to give my feedback to Kroger. I know little bit about Kroger feedback survey, but don’t have deep knowledge. Please guys if anyone know about this customer satisfaction Kroger customer satisfaction survey kroger feedback, feedback survey MATLAB Answers — New Questions
cell array to string array
fp31 =’#CC’ ‘#CB’ ‘#CN’ ‘#CO’ ‘#CP’ ‘#CF’ ‘#CS’ ‘#CI’ ‘#CQ’ ‘#CW’
i have a cell array like this ..
i want to convert every single cell of the array to string.
fp31(1)=’#CC’ should be string.fp31 =’#CC’ ‘#CB’ ‘#CN’ ‘#CO’ ‘#CP’ ‘#CF’ ‘#CS’ ‘#CI’ ‘#CQ’ ‘#CW’
i have a cell array like this ..
i want to convert every single cell of the array to string.
fp31(1)=’#CC’ should be string. fp31 =’#CC’ ‘#CB’ ‘#CN’ ‘#CO’ ‘#CP’ ‘#CF’ ‘#CS’ ‘#CI’ ‘#CQ’ ‘#CW’
i have a cell array like this ..
i want to convert every single cell of the array to string.
fp31(1)=’#CC’ should be string. strings, cell arrays MATLAB Answers — New Questions
Connecting to a parallel server over the Internet
Hi,
I have managed to setup a MATLAB Parallel Server toolbox on a workstation computer and mangaged to submit jobs from my laptop. But this can only be done when the two computers are connected to the same local network. Is there a way to do this over the Internet?
Thank you.Hi,
I have managed to setup a MATLAB Parallel Server toolbox on a workstation computer and mangaged to submit jobs from my laptop. But this can only be done when the two computers are connected to the same local network. Is there a way to do this over the Internet?
Thank you. Hi,
I have managed to setup a MATLAB Parallel Server toolbox on a workstation computer and mangaged to submit jobs from my laptop. But this can only be done when the two computers are connected to the same local network. Is there a way to do this over the Internet?
Thank you. parallel server MATLAB Answers — New Questions
Error: “Incorrect type of ‘Z’ for ‘predict’ in Layer ‘samplelayer’. Expected ‘gpuArray’, but instead was ‘single’.” This error is shown during using a custom deep layer.
I have created a custom deep learning layer for my network for image classification. While using that layer with cpu the network is properly working during the training process, but when I utilize the gpu available in the workstation it is showing this error:
"Incorrect type of ‘Z’ for ‘predict’ in Layer ‘samplelayer’. Expected ‘gpuArray’, but instead was ‘single’."
‘Z’ is the variable used in the predict function which represents the output of the layer. The portion of the code which has error is shown below:
PE_1={PE_even PE_odd};
Z=single(cat(2,PE_1{:}));
Z=dlarray(Z,"CB");
If I change ‘single’ with ‘gpuArray’ the same error will show in reverse way. Can anyone help me with this? I have started the class function like this: "classdef sinusoidalPositionEncoding < nnet.layer.Layer …
& nnet.layer.Formattable …
& nnet.layer.Acceleratable"
Thanks for the help in advanceI have created a custom deep learning layer for my network for image classification. While using that layer with cpu the network is properly working during the training process, but when I utilize the gpu available in the workstation it is showing this error:
"Incorrect type of ‘Z’ for ‘predict’ in Layer ‘samplelayer’. Expected ‘gpuArray’, but instead was ‘single’."
‘Z’ is the variable used in the predict function which represents the output of the layer. The portion of the code which has error is shown below:
PE_1={PE_even PE_odd};
Z=single(cat(2,PE_1{:}));
Z=dlarray(Z,"CB");
If I change ‘single’ with ‘gpuArray’ the same error will show in reverse way. Can anyone help me with this? I have started the class function like this: "classdef sinusoidalPositionEncoding < nnet.layer.Layer …
& nnet.layer.Formattable …
& nnet.layer.Acceleratable"
Thanks for the help in advance I have created a custom deep learning layer for my network for image classification. While using that layer with cpu the network is properly working during the training process, but when I utilize the gpu available in the workstation it is showing this error:
"Incorrect type of ‘Z’ for ‘predict’ in Layer ‘samplelayer’. Expected ‘gpuArray’, but instead was ‘single’."
‘Z’ is the variable used in the predict function which represents the output of the layer. The portion of the code which has error is shown below:
PE_1={PE_even PE_odd};
Z=single(cat(2,PE_1{:}));
Z=dlarray(Z,"CB");
If I change ‘single’ with ‘gpuArray’ the same error will show in reverse way. Can anyone help me with this? I have started the class function like this: "classdef sinusoidalPositionEncoding < nnet.layer.Layer …
& nnet.layer.Formattable …
& nnet.layer.Acceleratable"
Thanks for the help in advance digital image processing, matrix, matrix array, matrix manipulation, deep learning, machine learning, neural network, image segmentation, deep convolutional neural networks, cnn, mathematics MATLAB Answers — New Questions
zcu102: split tasks between the 4 available CPUs
Hi,
I’m doing some testing on a ZCU102. I followed a few examples and I was able to run HDL to split some programming between FPGA and CPU and run my model on the target. Based on the examples I found, as far as I understand, basically everything that is not processed via HDL goes on the CPU. The ZCU102 as a quadcore. I would like to try to split some tasks between them. I found a few examples like but when I go into Allow tasks to execute concurrently on target and I click Configure Tasks I cannot find the ZCU102 in the possible target applications and if I select custom it just shows one CPU. Is there something I’m missing? Is there an example I can follow?
thanks
MicheleHi,
I’m doing some testing on a ZCU102. I followed a few examples and I was able to run HDL to split some programming between FPGA and CPU and run my model on the target. Based on the examples I found, as far as I understand, basically everything that is not processed via HDL goes on the CPU. The ZCU102 as a quadcore. I would like to try to split some tasks between them. I found a few examples like but when I go into Allow tasks to execute concurrently on target and I click Configure Tasks I cannot find the ZCU102 in the possible target applications and if I select custom it just shows one CPU. Is there something I’m missing? Is there an example I can follow?
thanks
Michele Hi,
I’m doing some testing on a ZCU102. I followed a few examples and I was able to run HDL to split some programming between FPGA and CPU and run my model on the target. Based on the examples I found, as far as I understand, basically everything that is not processed via HDL goes on the CPU. The ZCU102 as a quadcore. I would like to try to split some tasks between them. I found a few examples like but when I go into Allow tasks to execute concurrently on target and I click Configure Tasks I cannot find the ZCU102 in the possible target applications and if I select custom it just shows one CPU. Is there something I’m missing? Is there an example I can follow?
thanks
Michele zcu102, multicore MATLAB Answers — New Questions
Jacobians using Simscape (numerical or symbolic)
I’m working with a Simscape model and I’m trying to get a numerical or possibly analytical form Jacobian for my system (given specific frames).
Actually I’m using multibody, but problem could be of general interest. Better if using geometrical approach. I know that some toolbox already perform same operation and give it using geometrical approch.
I tought using a numerical differentiation would be an answer, but is by far too complex, heavy and clumsy to carrry out for my purpose, thus I was looking for an alternative method to be used in one single run.I’m working with a Simscape model and I’m trying to get a numerical or possibly analytical form Jacobian for my system (given specific frames).
Actually I’m using multibody, but problem could be of general interest. Better if using geometrical approach. I know that some toolbox already perform same operation and give it using geometrical approch.
I tought using a numerical differentiation would be an answer, but is by far too complex, heavy and clumsy to carrry out for my purpose, thus I was looking for an alternative method to be used in one single run. I’m working with a Simscape model and I’m trying to get a numerical or possibly analytical form Jacobian for my system (given specific frames).
Actually I’m using multibody, but problem could be of general interest. Better if using geometrical approach. I know that some toolbox already perform same operation and give it using geometrical approch.
I tought using a numerical differentiation would be an answer, but is by far too complex, heavy and clumsy to carrry out for my purpose, thus I was looking for an alternative method to be used in one single run. simscape, jacobian MATLAB Answers — New Questions
How to order a Shapes object with actxserver for Excel?
I am trying to send an image I input into an Excel file to the back of the Shapes object. I have tried two different methods.
Method 1: Selection and Send to Back
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
ShapeToBack = myshapes.Item(N);
ShapeToBack.SendToBack();
The problem is that the .SendToBack function is not recognized. I did test out the Send To Back option in Excel and this did reorder the image in the myshapes. I was hoping to do that programatically, but I can’t find a way to do it in MATLAB.
Method 2: Copy Delete and Paste
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
for j = 1:N-1
ShapeToCopy = myshapes.Item(j);
ShapeToCopy.Copy();
myshapes.Item(j).Delete
objExcel.ActiveSheet.Paste();
end
The problem here is that for some reason this doesn’t change the order. The shape object at the end of myshapes stays at the end.I am trying to send an image I input into an Excel file to the back of the Shapes object. I have tried two different methods.
Method 1: Selection and Send to Back
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
ShapeToBack = myshapes.Item(N);
ShapeToBack.SendToBack();
The problem is that the .SendToBack function is not recognized. I did test out the Send To Back option in Excel and this did reorder the image in the myshapes. I was hoping to do that programatically, but I can’t find a way to do it in MATLAB.
Method 2: Copy Delete and Paste
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
for j = 1:N-1
ShapeToCopy = myshapes.Item(j);
ShapeToCopy.Copy();
myshapes.Item(j).Delete
objExcel.ActiveSheet.Paste();
end
The problem here is that for some reason this doesn’t change the order. The shape object at the end of myshapes stays at the end. I am trying to send an image I input into an Excel file to the back of the Shapes object. I have tried two different methods.
Method 1: Selection and Send to Back
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
ShapeToBack = myshapes.Item(N);
ShapeToBack.SendToBack();
The problem is that the .SendToBack function is not recognized. I did test out the Send To Back option in Excel and this did reorder the image in the myshapes. I was hoping to do that programatically, but I can’t find a way to do it in MATLAB.
Method 2: Copy Delete and Paste
objExcel = actxserver(‘Excel.Application’);
objExcel.Workbooks.Open(excelFileName);
myshapes = objExcel.ActiveSheet.Shapes;
N = myshapes.Count;
for j = 1:N-1
ShapeToCopy = myshapes.Item(j);
ShapeToCopy.Copy();
myshapes.Item(j).Delete
objExcel.ActiveSheet.Paste();
end
The problem here is that for some reason this doesn’t change the order. The shape object at the end of myshapes stays at the end. actxserver, excel shapes, excel objects, excel MATLAB Answers — New Questions
Ramp a variable with 63 elements
I have a simulink variable that has 63 elements. I would like to ramp each element in the variable proportionally from 0 to the value of the variable.
For example
A = [22 17 39 …]
B = [0 0 0 …]
Sample time = Ts = 1e-6
B = Ramp A
Maybe I need a toolkit that has a premade ramp block that takes an input and sets upper and lower limits.
Thanks,
DavidI have a simulink variable that has 63 elements. I would like to ramp each element in the variable proportionally from 0 to the value of the variable.
For example
A = [22 17 39 …]
B = [0 0 0 …]
Sample time = Ts = 1e-6
B = Ramp A
Maybe I need a toolkit that has a premade ramp block that takes an input and sets upper and lower limits.
Thanks,
David I have a simulink variable that has 63 elements. I would like to ramp each element in the variable proportionally from 0 to the value of the variable.
For example
A = [22 17 39 …]
B = [0 0 0 …]
Sample time = Ts = 1e-6
B = Ramp A
Maybe I need a toolkit that has a premade ramp block that takes an input and sets upper and lower limits.
Thanks,
David constant ramp MATLAB Answers — New Questions
Issue with Exporting High-Resolution Mineral Images from CorelDRAW for MATLAB Processing
Image Preparation: I have outlined the minerals in CorelDRAW, and the quality looks excellent within the software.
Exporting Issue: When I export the image to PNG format, the resolution becomes pixelated, making it unsuitable for further processing in my MATLAB code.
Code Requirements: My MATLAB code accepts PNG, TIFF, JPEG, and BMP formats.
PNG Issue: The resolution is poor and pixelated.
Other Formats (TIFF, JPEG, BMP): The background of the image is selected, which is not desired.
Question:
What settings should I use in CorelDRAW to export a high-resolution image in PNG format without losing quality?
How can I ensure that the background is not selected when exporting to TIFF, JPEG, or BMP formats?
Any advice or tips would be greatly appreciated!
Thank you!Image Preparation: I have outlined the minerals in CorelDRAW, and the quality looks excellent within the software.
Exporting Issue: When I export the image to PNG format, the resolution becomes pixelated, making it unsuitable for further processing in my MATLAB code.
Code Requirements: My MATLAB code accepts PNG, TIFF, JPEG, and BMP formats.
PNG Issue: The resolution is poor and pixelated.
Other Formats (TIFF, JPEG, BMP): The background of the image is selected, which is not desired.
Question:
What settings should I use in CorelDRAW to export a high-resolution image in PNG format without losing quality?
How can I ensure that the background is not selected when exporting to TIFF, JPEG, or BMP formats?
Any advice or tips would be greatly appreciated!
Thank you! Image Preparation: I have outlined the minerals in CorelDRAW, and the quality looks excellent within the software.
Exporting Issue: When I export the image to PNG format, the resolution becomes pixelated, making it unsuitable for further processing in my MATLAB code.
Code Requirements: My MATLAB code accepts PNG, TIFF, JPEG, and BMP formats.
PNG Issue: The resolution is poor and pixelated.
Other Formats (TIFF, JPEG, BMP): The background of the image is selected, which is not desired.
Question:
What settings should I use in CorelDRAW to export a high-resolution image in PNG format without losing quality?
How can I ensure that the background is not selected when exporting to TIFF, JPEG, or BMP formats?
Any advice or tips would be greatly appreciated!
Thank you! #image exporting MATLAB Answers — New Questions
Network doesn’t work on test image
Hi all.
I’m trying to use and train a pretrained network (YOLO v2) on my own dataset (80 images).
I divided my set in training, validation and test, but network works correctly only on these images and not on other images that aren’t in these set.
What can I do? I have to test my network only on the images that I have labeled?
ThanksHi all.
I’m trying to use and train a pretrained network (YOLO v2) on my own dataset (80 images).
I divided my set in training, validation and test, but network works correctly only on these images and not on other images that aren’t in these set.
What can I do? I have to test my network only on the images that I have labeled?
Thanks Hi all.
I’m trying to use and train a pretrained network (YOLO v2) on my own dataset (80 images).
I divided my set in training, validation and test, but network works correctly only on these images and not on other images that aren’t in these set.
What can I do? I have to test my network only on the images that I have labeled?
Thanks deep learning, yolov2, matlab, neural networks MATLAB Answers — New Questions
Thermal Camera Image Analyzing
Hi,I have thermal images and I need to draw weight lines for specific points:areas in the image. How to do that?Hi,I have thermal images and I need to draw weight lines for specific points:areas in the image. How to do that? Hi,I have thermal images and I need to draw weight lines for specific points:areas in the image. How to do that? thermal, outlines, contours MATLAB Answers — New Questions
Live script fprintf temporarily not printing whole line
While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something?While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something? While doing a bunch of file IO in a Live Script, and printing with fprintf, sometimes the line does not complete printing. Temporarily, it looks like the image below until the next iteration begins.
I was able to sort of recreate the effect with the code below, but what can be only a flicker in the execution of this snippet is much more noticable on my other project.
for i= 1:10
fprintf("Hello %dn",i)
B= inv(rand(3000)+ 2*eye(3000));
end
Is this a bug or am I missing something? live, script, fprinf MATLAB Answers — New Questions