Month: April 2025
Inverting an 8×8 symbolic matrix
I am trying to invert an 8×8 symbolic matrix with 32 symbolic variables in total. However, when running the standard inversion methods with inv() or mldivide(), the program takes a lot of time and ended up crashing all the times I tried to invert this matrix. I tried some workarounds, such as a recursive inversion algorithm using Schur decomposition and other ways of using the fact that I know that the matrix is symmetric, but to no avail. The function has a lot of sines and cosines of these variables, which might also be a problem.
I am looking for ways I can get this matrix inverted, or any further suggestion on how to tackle this problem.
Thanks in advance.
For context: the matrix I am trying to invert is the inertia matrix for a tiltrotor UAV. the 32 parameters consist of 6 state variables and 26 model parameters. My goal with this is to get an analytic expression for the system equations of motion:
With that expression, I intend to obtain an analytic linearization of the system in order to get a linear model , where . With these analytical expressions should be able to easily get A, B matrices for different values of the system parameters and formulate robust linear controllers with polytopic uncertainty.I am trying to invert an 8×8 symbolic matrix with 32 symbolic variables in total. However, when running the standard inversion methods with inv() or mldivide(), the program takes a lot of time and ended up crashing all the times I tried to invert this matrix. I tried some workarounds, such as a recursive inversion algorithm using Schur decomposition and other ways of using the fact that I know that the matrix is symmetric, but to no avail. The function has a lot of sines and cosines of these variables, which might also be a problem.
I am looking for ways I can get this matrix inverted, or any further suggestion on how to tackle this problem.
Thanks in advance.
For context: the matrix I am trying to invert is the inertia matrix for a tiltrotor UAV. the 32 parameters consist of 6 state variables and 26 model parameters. My goal with this is to get an analytic expression for the system equations of motion:
With that expression, I intend to obtain an analytic linearization of the system in order to get a linear model , where . With these analytical expressions should be able to easily get A, B matrices for different values of the system parameters and formulate robust linear controllers with polytopic uncertainty. I am trying to invert an 8×8 symbolic matrix with 32 symbolic variables in total. However, when running the standard inversion methods with inv() or mldivide(), the program takes a lot of time and ended up crashing all the times I tried to invert this matrix. I tried some workarounds, such as a recursive inversion algorithm using Schur decomposition and other ways of using the fact that I know that the matrix is symmetric, but to no avail. The function has a lot of sines and cosines of these variables, which might also be a problem.
I am looking for ways I can get this matrix inverted, or any further suggestion on how to tackle this problem.
Thanks in advance.
For context: the matrix I am trying to invert is the inertia matrix for a tiltrotor UAV. the 32 parameters consist of 6 state variables and 26 model parameters. My goal with this is to get an analytic expression for the system equations of motion:
With that expression, I intend to obtain an analytic linearization of the system in order to get a linear model , where . With these analytical expressions should be able to easily get A, B matrices for different values of the system parameters and formulate robust linear controllers with polytopic uncertainty. symbolic, matrix, inverse MATLAB Answers — New Questions
Solve DAEs using IDASolve function of SUNDIALS 2.6.2 version
I am trying to solve the system of differential algebraic equations which are used to model the IEEE 9 bus system. The differential equations determines the dynamic behaviour of the generators while the algebraic equations consists of the stator and the network (power flow) equations.
I have attached a MATLAB code in which the function "fun_DAE" gives out all of the equations in the form of a column vectors. ‘ F_D ‘ gives the 21 differential equations (7 for each generator), ‘ F_SA ‘ gives 18 network equations (real and reactive power balances for 9 buses) and ‘ F_SA’ gives the 6 stator equations (2 for each generator). ‘ F_SA’ and ‘ F_N ‘ constitutes the algebraic constraints.
the differential variables are for each generator. The initial values of this state variables are calculated and stored as matrix.
I need some help in using the IDAInit, IDASetOptions and IDASolve functions or any other relevant functions to be used to get a solution.
Thank You.I am trying to solve the system of differential algebraic equations which are used to model the IEEE 9 bus system. The differential equations determines the dynamic behaviour of the generators while the algebraic equations consists of the stator and the network (power flow) equations.
I have attached a MATLAB code in which the function "fun_DAE" gives out all of the equations in the form of a column vectors. ‘ F_D ‘ gives the 21 differential equations (7 for each generator), ‘ F_SA ‘ gives 18 network equations (real and reactive power balances for 9 buses) and ‘ F_SA’ gives the 6 stator equations (2 for each generator). ‘ F_SA’ and ‘ F_N ‘ constitutes the algebraic constraints.
the differential variables are for each generator. The initial values of this state variables are calculated and stored as matrix.
I need some help in using the IDAInit, IDASetOptions and IDASolve functions or any other relevant functions to be used to get a solution.
Thank You. I am trying to solve the system of differential algebraic equations which are used to model the IEEE 9 bus system. The differential equations determines the dynamic behaviour of the generators while the algebraic equations consists of the stator and the network (power flow) equations.
I have attached a MATLAB code in which the function "fun_DAE" gives out all of the equations in the form of a column vectors. ‘ F_D ‘ gives the 21 differential equations (7 for each generator), ‘ F_SA ‘ gives 18 network equations (real and reactive power balances for 9 buses) and ‘ F_SA’ gives the 6 stator equations (2 for each generator). ‘ F_SA’ and ‘ F_N ‘ constitutes the algebraic constraints.
the differential variables are for each generator. The initial values of this state variables are calculated and stored as matrix.
I need some help in using the IDAInit, IDASetOptions and IDASolve functions or any other relevant functions to be used to get a solution.
Thank You. sundials, ode MATLAB Answers — New Questions
MATLAB’s volshow command displays gray pixels as the inverse RGB color of any colored pixels also present in the dataset
I have a segmented 3D image dataset that I am trying to visualize. Because there are two segmented phases, I am exploring different colors for each phase to make them stand out from each other. In particular, I would like one of the phases to be blue (RGB [0, 0, 255]) and the other phase to be gray (RGB [128, 128, 128]). I have created a 4D uint8 dataset of the segmented images to allow for this, and when I load the image stack in MATLAB’s sliceViewer everything looks correct. However, when I then load the same dataset in MATLAB’s volshow, it colors the gray pixels yellow while the blue pixels remain blue. See pictures below:
SliceViewer Image Showing Gray = Gray with Blue Colored Phase
Volshow Image Showing Gray = Yellow with Blue Colored Phase
I thought that perhaps there was an issue with the lighting option being colored and casting a color onto gray pixels, but I have the lighting option turned off. I then thought that perhaps there was an issue with grayscale pixels in volshow, but when I convert the gray pixels to white (RGB [255, 255, 255]) they appear white in volshow. The same exact effect is achieved if the blue pixels are reduced in intensity to RGB [0, 0, 128] while leaving the gray pixels as RGB [128, 128, 128] (the sliceViewer will look different showing a darker blue but the volshow looks identical to the picture below with a bright blue and white-colored gray pixels). See pictures below:
SliceViewer Image Showing White = White with Blue Colored Phase
Volshow Image Showing White = White with Blue Colored Phase
I then explored other colors to see if there is a specific issue with the blue/gray combination and found interesting results. When I converted the blue pixels to red (RGB [255, 0, 0]), the gray pixels remained gray in sliceViewer but now display as cyan in volshow. See pictures below:
SliceViewer Image Showing Gray = Gray with Red Colored Phase
Volshow Image Showing Gray = Cyan with Red Colored Phase
The blue/gray and red/gray tests demonstrate that volshow will replace gray pixels with the inverse RGB color of any colored pixels in the dataset (yellow is the opposite RGB of blue ([255, 255, 0] vs. [0, 0, 255]) and cyan is the opposite RGB of red ([0, 255, 255] vs. [255, 0, 0])). However, the yellow and cyan colors do not appear to be their full intensity versions ([255, 255, 0] for yellow and [0, 255, 255] for cyan) and they may have some degree of their typically absent color present, but I cannot tell as these pixels do not actually have these intensity values in the image data so I cannot tell to what the true color is that they are creating. Thus, I cannot determine to what degree the opposite colors are added and the main color is substracted from the gray pixels.
I then tried substituting the colored phase for white to see if that maintained the gray pixels, and this worked (note that it may be difficult to see the difference between white and gray in the volShow, but I turned the volume around, zoomed in, and was able to verify that this was the case). See pictures below:
SliceViewer Image Showing Gray = Gray with White Colored Phase
Volshow Image Showing Gray = Gray with White Colored Phase
I was then curious as to what would happen to the gray pixels if I added a third, differently-colored phase. So, I added a red strip down one side of the blue/gray volume. Now, the gray pixels turned green (again, to what degree the blue and red intensities were added vs. substracted and how much of the green intensity was added, I cannot know). See pictures below:
SliceViewer Image Showing Gray = Gray with Blue and Red Colored Phases
Volshow Image Showing Gray = Green with Blue and Red Colored Phases
I don’t know if I am doing something wrong, so I have provided a snippet of code that will re-create all of this as well as a google drive link (the file is >5 MB so I can’t upload it) to the dataset I am using to investigate this. The code will let you select the data and automatically load it for you and then produce all of the images I have included here in there sliceViewer and volshow formats so that you can explore them). Here is the link to the dataset and here is the code:
%% Test Case %%
close all
clear
clc
% Select image file
fprintf(‘Select an image file.nn’)
[file_name, path_intro] = uigetfile(‘*.*’, ‘Select an image file’);
file_path = sprintf(‘%s%s’, path_intro, file_name);
% Import image message
clc
fprintf(‘Importing image stack…nn’)
% Create tiff
stack_tiff = Tiff(file_path);
% Determine number of images in stack
info = imfinfo(file_path);
no_slice = numel(info);
% Determine necessary tags from tiff
bits = getTag(stack_tiff, ‘BitsPerSample’);
long = getTag(stack_tiff, ‘ImageLength’);
wide = getTag(stack_tiff, ‘ImageWidth’);
samples = getTag(stack_tiff, ‘SamplesPerPixel’);
% Pre-allocate volume array
volume = zeros(long, wide, no_slice, samples, ‘uint8’);
% Import first image
volume(:, :, 1, 🙂 = read(stack_tiff);
% Import loop
for n = 2:no_slice
% Update current directory
nextDirectory(stack_tiff);
% Add current slice to volume
volume(:, :, n, 🙂 = read(stack_tiff);
end
% Close tiff
close(stack_tiff)
% Create transformation matrix
T = [1.31 0 0 0; 0 1.31 0 0; 0 0 1.31 0; 0 0 0 1];
tform = affinetform3d(T);
% Create viewer parameters structure
view_struct = struct;
% Populate viewer parameters structure
view_struct.BackgroundColor = [1 1 1];
view_struct.BackgroundGradient = ‘off’;
view_struct.Lighting = ‘off’;
% Load first slice viewer
clc
fprintf(‘Loading first slice viewer…nn’)
f1 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Blue Colored Phase’);
sliceViewer(volume, parent = f1);
% Load first volume viewer
clc
fprintf(‘Loading first volume viewer…nn’)
uif1 = uifigure(‘Name’, ‘Gray = Yellow in Volume Viewer with Blue Colored Phase’);
viewer1 = viewer3d(view_struct, parent = uif1);
V1 = volshow(volume, ‘Transformation’, tform, parent = viewer1);
% Convert gray to white in second volume
clc
fprintf(‘Converting gray to white…nn’)
g2w_vol = volume;
g2w_vol(volume == 128) = 255;
% Load second slice viewer
clc
fprintf(‘Loading second slice viewer…nn’)
f2 = figure(‘Name’, ‘White = White in Slice Viewer with Blue Colored Phase’);
sliceViewer(g2w_vol, parent = f2);
% Load second volume viewer
clc
fprintf(‘Loading second volume viewer…nn’)
uif2 = uifigure(‘Name’, ‘White = White in Volume Viewer with Blue Colored Phase’);
viewer2 = viewer3d(view_struct, parent = uif2);
V2 = volshow(g2w_vol, ‘Transformation’, tform, parent = viewer2);
% Convert blue to red in third volume
clc
fprintf(‘Converting blue to red…nn’)
b2r_vol = volume;
b2r_vol(:, :, :, 1) = volume(:, :, :, 3);
b2r_vol(:, :, :, 3) = volume(:, :, :, 1);
% Load third slice viewer
clc
fprintf(‘Loading third slice viewer…nn’)
f3 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Red Colored Phase’);
sliceViewer(b2r_vol, parent = f3);
% Load third volume viewer
clc
fprintf(‘Loading third volume viewer…nn’)
uif3 = uifigure(‘Name’, ‘Gray = Cyan in Volume Viewer with Red Colored Phase’);
viewer3 = viewer3d(view_struct, parent = uif3);
V3 = volshow(b2r_vol, ‘Transformation’, tform, parent = viewer3);
% Convert blue to white in fourth volume
clc
fprintf(‘Converting blue to white…nn’)
b2w_vol = volume;
b2w_vol(:, :, :, 1) = volume(:, :, :, 3);
b2w_vol(:, :, :, 2) = volume(:, :, :, 3);
% Load fourth slice viewer
clc
fprintf(‘Loading fourth slice viewer…nn’)
f4 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(b2w_vol, parent = f4);
% Load fourth volume viewer
clc
fprintf(‘Loading fourth volume viewer…nn’)
uif4 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer4 = viewer3d(view_struct, parent = uif4);
V4 = volshow(b2w_vol, ‘Transformation’, tform, parent = viewer4);
% Add red strip in fifth volume
clc
fprintf(‘Adding red strip…nn’)
br_vol = volume;
br_vol(:, 1:25, :, 1) = 255;
br_vol(:, 1:25, :, 2:3) = 0;
% Load fifth slice viewer
clc
fprintf(‘Loading fifth slice viewer…nn’)
f5 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(br_vol, parent = f5);
% Load fifth volume viewer
clc
fprintf(‘Loading fifth volume viewer…nn’)
uif5 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer5 = viewer3d(view_struct, parent = uif5);
V5 = volshow(br_vol, ‘Transformation’, tform, parent = viewer5);
% End message
clc
fprintf(‘Finished!nn’)I have a segmented 3D image dataset that I am trying to visualize. Because there are two segmented phases, I am exploring different colors for each phase to make them stand out from each other. In particular, I would like one of the phases to be blue (RGB [0, 0, 255]) and the other phase to be gray (RGB [128, 128, 128]). I have created a 4D uint8 dataset of the segmented images to allow for this, and when I load the image stack in MATLAB’s sliceViewer everything looks correct. However, when I then load the same dataset in MATLAB’s volshow, it colors the gray pixels yellow while the blue pixels remain blue. See pictures below:
SliceViewer Image Showing Gray = Gray with Blue Colored Phase
Volshow Image Showing Gray = Yellow with Blue Colored Phase
I thought that perhaps there was an issue with the lighting option being colored and casting a color onto gray pixels, but I have the lighting option turned off. I then thought that perhaps there was an issue with grayscale pixels in volshow, but when I convert the gray pixels to white (RGB [255, 255, 255]) they appear white in volshow. The same exact effect is achieved if the blue pixels are reduced in intensity to RGB [0, 0, 128] while leaving the gray pixels as RGB [128, 128, 128] (the sliceViewer will look different showing a darker blue but the volshow looks identical to the picture below with a bright blue and white-colored gray pixels). See pictures below:
SliceViewer Image Showing White = White with Blue Colored Phase
Volshow Image Showing White = White with Blue Colored Phase
I then explored other colors to see if there is a specific issue with the blue/gray combination and found interesting results. When I converted the blue pixels to red (RGB [255, 0, 0]), the gray pixels remained gray in sliceViewer but now display as cyan in volshow. See pictures below:
SliceViewer Image Showing Gray = Gray with Red Colored Phase
Volshow Image Showing Gray = Cyan with Red Colored Phase
The blue/gray and red/gray tests demonstrate that volshow will replace gray pixels with the inverse RGB color of any colored pixels in the dataset (yellow is the opposite RGB of blue ([255, 255, 0] vs. [0, 0, 255]) and cyan is the opposite RGB of red ([0, 255, 255] vs. [255, 0, 0])). However, the yellow and cyan colors do not appear to be their full intensity versions ([255, 255, 0] for yellow and [0, 255, 255] for cyan) and they may have some degree of their typically absent color present, but I cannot tell as these pixels do not actually have these intensity values in the image data so I cannot tell to what the true color is that they are creating. Thus, I cannot determine to what degree the opposite colors are added and the main color is substracted from the gray pixels.
I then tried substituting the colored phase for white to see if that maintained the gray pixels, and this worked (note that it may be difficult to see the difference between white and gray in the volShow, but I turned the volume around, zoomed in, and was able to verify that this was the case). See pictures below:
SliceViewer Image Showing Gray = Gray with White Colored Phase
Volshow Image Showing Gray = Gray with White Colored Phase
I was then curious as to what would happen to the gray pixels if I added a third, differently-colored phase. So, I added a red strip down one side of the blue/gray volume. Now, the gray pixels turned green (again, to what degree the blue and red intensities were added vs. substracted and how much of the green intensity was added, I cannot know). See pictures below:
SliceViewer Image Showing Gray = Gray with Blue and Red Colored Phases
Volshow Image Showing Gray = Green with Blue and Red Colored Phases
I don’t know if I am doing something wrong, so I have provided a snippet of code that will re-create all of this as well as a google drive link (the file is >5 MB so I can’t upload it) to the dataset I am using to investigate this. The code will let you select the data and automatically load it for you and then produce all of the images I have included here in there sliceViewer and volshow formats so that you can explore them). Here is the link to the dataset and here is the code:
%% Test Case %%
close all
clear
clc
% Select image file
fprintf(‘Select an image file.nn’)
[file_name, path_intro] = uigetfile(‘*.*’, ‘Select an image file’);
file_path = sprintf(‘%s%s’, path_intro, file_name);
% Import image message
clc
fprintf(‘Importing image stack…nn’)
% Create tiff
stack_tiff = Tiff(file_path);
% Determine number of images in stack
info = imfinfo(file_path);
no_slice = numel(info);
% Determine necessary tags from tiff
bits = getTag(stack_tiff, ‘BitsPerSample’);
long = getTag(stack_tiff, ‘ImageLength’);
wide = getTag(stack_tiff, ‘ImageWidth’);
samples = getTag(stack_tiff, ‘SamplesPerPixel’);
% Pre-allocate volume array
volume = zeros(long, wide, no_slice, samples, ‘uint8’);
% Import first image
volume(:, :, 1, 🙂 = read(stack_tiff);
% Import loop
for n = 2:no_slice
% Update current directory
nextDirectory(stack_tiff);
% Add current slice to volume
volume(:, :, n, 🙂 = read(stack_tiff);
end
% Close tiff
close(stack_tiff)
% Create transformation matrix
T = [1.31 0 0 0; 0 1.31 0 0; 0 0 1.31 0; 0 0 0 1];
tform = affinetform3d(T);
% Create viewer parameters structure
view_struct = struct;
% Populate viewer parameters structure
view_struct.BackgroundColor = [1 1 1];
view_struct.BackgroundGradient = ‘off’;
view_struct.Lighting = ‘off’;
% Load first slice viewer
clc
fprintf(‘Loading first slice viewer…nn’)
f1 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Blue Colored Phase’);
sliceViewer(volume, parent = f1);
% Load first volume viewer
clc
fprintf(‘Loading first volume viewer…nn’)
uif1 = uifigure(‘Name’, ‘Gray = Yellow in Volume Viewer with Blue Colored Phase’);
viewer1 = viewer3d(view_struct, parent = uif1);
V1 = volshow(volume, ‘Transformation’, tform, parent = viewer1);
% Convert gray to white in second volume
clc
fprintf(‘Converting gray to white…nn’)
g2w_vol = volume;
g2w_vol(volume == 128) = 255;
% Load second slice viewer
clc
fprintf(‘Loading second slice viewer…nn’)
f2 = figure(‘Name’, ‘White = White in Slice Viewer with Blue Colored Phase’);
sliceViewer(g2w_vol, parent = f2);
% Load second volume viewer
clc
fprintf(‘Loading second volume viewer…nn’)
uif2 = uifigure(‘Name’, ‘White = White in Volume Viewer with Blue Colored Phase’);
viewer2 = viewer3d(view_struct, parent = uif2);
V2 = volshow(g2w_vol, ‘Transformation’, tform, parent = viewer2);
% Convert blue to red in third volume
clc
fprintf(‘Converting blue to red…nn’)
b2r_vol = volume;
b2r_vol(:, :, :, 1) = volume(:, :, :, 3);
b2r_vol(:, :, :, 3) = volume(:, :, :, 1);
% Load third slice viewer
clc
fprintf(‘Loading third slice viewer…nn’)
f3 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Red Colored Phase’);
sliceViewer(b2r_vol, parent = f3);
% Load third volume viewer
clc
fprintf(‘Loading third volume viewer…nn’)
uif3 = uifigure(‘Name’, ‘Gray = Cyan in Volume Viewer with Red Colored Phase’);
viewer3 = viewer3d(view_struct, parent = uif3);
V3 = volshow(b2r_vol, ‘Transformation’, tform, parent = viewer3);
% Convert blue to white in fourth volume
clc
fprintf(‘Converting blue to white…nn’)
b2w_vol = volume;
b2w_vol(:, :, :, 1) = volume(:, :, :, 3);
b2w_vol(:, :, :, 2) = volume(:, :, :, 3);
% Load fourth slice viewer
clc
fprintf(‘Loading fourth slice viewer…nn’)
f4 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(b2w_vol, parent = f4);
% Load fourth volume viewer
clc
fprintf(‘Loading fourth volume viewer…nn’)
uif4 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer4 = viewer3d(view_struct, parent = uif4);
V4 = volshow(b2w_vol, ‘Transformation’, tform, parent = viewer4);
% Add red strip in fifth volume
clc
fprintf(‘Adding red strip…nn’)
br_vol = volume;
br_vol(:, 1:25, :, 1) = 255;
br_vol(:, 1:25, :, 2:3) = 0;
% Load fifth slice viewer
clc
fprintf(‘Loading fifth slice viewer…nn’)
f5 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(br_vol, parent = f5);
% Load fifth volume viewer
clc
fprintf(‘Loading fifth volume viewer…nn’)
uif5 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer5 = viewer3d(view_struct, parent = uif5);
V5 = volshow(br_vol, ‘Transformation’, tform, parent = viewer5);
% End message
clc
fprintf(‘Finished!nn’) I have a segmented 3D image dataset that I am trying to visualize. Because there are two segmented phases, I am exploring different colors for each phase to make them stand out from each other. In particular, I would like one of the phases to be blue (RGB [0, 0, 255]) and the other phase to be gray (RGB [128, 128, 128]). I have created a 4D uint8 dataset of the segmented images to allow for this, and when I load the image stack in MATLAB’s sliceViewer everything looks correct. However, when I then load the same dataset in MATLAB’s volshow, it colors the gray pixels yellow while the blue pixels remain blue. See pictures below:
SliceViewer Image Showing Gray = Gray with Blue Colored Phase
Volshow Image Showing Gray = Yellow with Blue Colored Phase
I thought that perhaps there was an issue with the lighting option being colored and casting a color onto gray pixels, but I have the lighting option turned off. I then thought that perhaps there was an issue with grayscale pixels in volshow, but when I convert the gray pixels to white (RGB [255, 255, 255]) they appear white in volshow. The same exact effect is achieved if the blue pixels are reduced in intensity to RGB [0, 0, 128] while leaving the gray pixels as RGB [128, 128, 128] (the sliceViewer will look different showing a darker blue but the volshow looks identical to the picture below with a bright blue and white-colored gray pixels). See pictures below:
SliceViewer Image Showing White = White with Blue Colored Phase
Volshow Image Showing White = White with Blue Colored Phase
I then explored other colors to see if there is a specific issue with the blue/gray combination and found interesting results. When I converted the blue pixels to red (RGB [255, 0, 0]), the gray pixels remained gray in sliceViewer but now display as cyan in volshow. See pictures below:
SliceViewer Image Showing Gray = Gray with Red Colored Phase
Volshow Image Showing Gray = Cyan with Red Colored Phase
The blue/gray and red/gray tests demonstrate that volshow will replace gray pixels with the inverse RGB color of any colored pixels in the dataset (yellow is the opposite RGB of blue ([255, 255, 0] vs. [0, 0, 255]) and cyan is the opposite RGB of red ([0, 255, 255] vs. [255, 0, 0])). However, the yellow and cyan colors do not appear to be their full intensity versions ([255, 255, 0] for yellow and [0, 255, 255] for cyan) and they may have some degree of their typically absent color present, but I cannot tell as these pixels do not actually have these intensity values in the image data so I cannot tell to what the true color is that they are creating. Thus, I cannot determine to what degree the opposite colors are added and the main color is substracted from the gray pixels.
I then tried substituting the colored phase for white to see if that maintained the gray pixels, and this worked (note that it may be difficult to see the difference between white and gray in the volShow, but I turned the volume around, zoomed in, and was able to verify that this was the case). See pictures below:
SliceViewer Image Showing Gray = Gray with White Colored Phase
Volshow Image Showing Gray = Gray with White Colored Phase
I was then curious as to what would happen to the gray pixels if I added a third, differently-colored phase. So, I added a red strip down one side of the blue/gray volume. Now, the gray pixels turned green (again, to what degree the blue and red intensities were added vs. substracted and how much of the green intensity was added, I cannot know). See pictures below:
SliceViewer Image Showing Gray = Gray with Blue and Red Colored Phases
Volshow Image Showing Gray = Green with Blue and Red Colored Phases
I don’t know if I am doing something wrong, so I have provided a snippet of code that will re-create all of this as well as a google drive link (the file is >5 MB so I can’t upload it) to the dataset I am using to investigate this. The code will let you select the data and automatically load it for you and then produce all of the images I have included here in there sliceViewer and volshow formats so that you can explore them). Here is the link to the dataset and here is the code:
%% Test Case %%
close all
clear
clc
% Select image file
fprintf(‘Select an image file.nn’)
[file_name, path_intro] = uigetfile(‘*.*’, ‘Select an image file’);
file_path = sprintf(‘%s%s’, path_intro, file_name);
% Import image message
clc
fprintf(‘Importing image stack…nn’)
% Create tiff
stack_tiff = Tiff(file_path);
% Determine number of images in stack
info = imfinfo(file_path);
no_slice = numel(info);
% Determine necessary tags from tiff
bits = getTag(stack_tiff, ‘BitsPerSample’);
long = getTag(stack_tiff, ‘ImageLength’);
wide = getTag(stack_tiff, ‘ImageWidth’);
samples = getTag(stack_tiff, ‘SamplesPerPixel’);
% Pre-allocate volume array
volume = zeros(long, wide, no_slice, samples, ‘uint8’);
% Import first image
volume(:, :, 1, 🙂 = read(stack_tiff);
% Import loop
for n = 2:no_slice
% Update current directory
nextDirectory(stack_tiff);
% Add current slice to volume
volume(:, :, n, 🙂 = read(stack_tiff);
end
% Close tiff
close(stack_tiff)
% Create transformation matrix
T = [1.31 0 0 0; 0 1.31 0 0; 0 0 1.31 0; 0 0 0 1];
tform = affinetform3d(T);
% Create viewer parameters structure
view_struct = struct;
% Populate viewer parameters structure
view_struct.BackgroundColor = [1 1 1];
view_struct.BackgroundGradient = ‘off’;
view_struct.Lighting = ‘off’;
% Load first slice viewer
clc
fprintf(‘Loading first slice viewer…nn’)
f1 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Blue Colored Phase’);
sliceViewer(volume, parent = f1);
% Load first volume viewer
clc
fprintf(‘Loading first volume viewer…nn’)
uif1 = uifigure(‘Name’, ‘Gray = Yellow in Volume Viewer with Blue Colored Phase’);
viewer1 = viewer3d(view_struct, parent = uif1);
V1 = volshow(volume, ‘Transformation’, tform, parent = viewer1);
% Convert gray to white in second volume
clc
fprintf(‘Converting gray to white…nn’)
g2w_vol = volume;
g2w_vol(volume == 128) = 255;
% Load second slice viewer
clc
fprintf(‘Loading second slice viewer…nn’)
f2 = figure(‘Name’, ‘White = White in Slice Viewer with Blue Colored Phase’);
sliceViewer(g2w_vol, parent = f2);
% Load second volume viewer
clc
fprintf(‘Loading second volume viewer…nn’)
uif2 = uifigure(‘Name’, ‘White = White in Volume Viewer with Blue Colored Phase’);
viewer2 = viewer3d(view_struct, parent = uif2);
V2 = volshow(g2w_vol, ‘Transformation’, tform, parent = viewer2);
% Convert blue to red in third volume
clc
fprintf(‘Converting blue to red…nn’)
b2r_vol = volume;
b2r_vol(:, :, :, 1) = volume(:, :, :, 3);
b2r_vol(:, :, :, 3) = volume(:, :, :, 1);
% Load third slice viewer
clc
fprintf(‘Loading third slice viewer…nn’)
f3 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with Red Colored Phase’);
sliceViewer(b2r_vol, parent = f3);
% Load third volume viewer
clc
fprintf(‘Loading third volume viewer…nn’)
uif3 = uifigure(‘Name’, ‘Gray = Cyan in Volume Viewer with Red Colored Phase’);
viewer3 = viewer3d(view_struct, parent = uif3);
V3 = volshow(b2r_vol, ‘Transformation’, tform, parent = viewer3);
% Convert blue to white in fourth volume
clc
fprintf(‘Converting blue to white…nn’)
b2w_vol = volume;
b2w_vol(:, :, :, 1) = volume(:, :, :, 3);
b2w_vol(:, :, :, 2) = volume(:, :, :, 3);
% Load fourth slice viewer
clc
fprintf(‘Loading fourth slice viewer…nn’)
f4 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(b2w_vol, parent = f4);
% Load fourth volume viewer
clc
fprintf(‘Loading fourth volume viewer…nn’)
uif4 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer4 = viewer3d(view_struct, parent = uif4);
V4 = volshow(b2w_vol, ‘Transformation’, tform, parent = viewer4);
% Add red strip in fifth volume
clc
fprintf(‘Adding red strip…nn’)
br_vol = volume;
br_vol(:, 1:25, :, 1) = 255;
br_vol(:, 1:25, :, 2:3) = 0;
% Load fifth slice viewer
clc
fprintf(‘Loading fifth slice viewer…nn’)
f5 = figure(‘Name’, ‘Gray = Gray in Slice Viewer with White Colored Phase’);
sliceViewer(br_vol, parent = f5);
% Load fifth volume viewer
clc
fprintf(‘Loading fifth volume viewer…nn’)
uif5 = uifigure(‘Name’, ‘Gray = Gray in Volume Viewer with White Colored Phase’);
viewer5 = viewer3d(view_struct, parent = uif5);
V5 = volshow(br_vol, ‘Transformation’, tform, parent = viewer5);
% End message
clc
fprintf(‘Finished!nn’) volshow, image processing, image segmentation MATLAB Answers — New Questions
We have tetrahedra mesh we went to extract a sphere from this mesh and adabting the mesh
We do this code, but we found a problem in the output tri
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
% model = createpde;
% [gCube,mshC]=geometryFromMesh(model,loc’,tri’);
% %save (‘nodesn.txt’, ‘tri’)
% tri
% loc;
axis equalWe do this code, but we found a problem in the output tri
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
% model = createpde;
% [gCube,mshC]=geometryFromMesh(model,loc’,tri’);
% %save (‘nodesn.txt’, ‘tri’)
% tri
% loc;
axis equal We do this code, but we found a problem in the output tri
fid = fopen(‘nodes10.dat’);
data = fscanf(fid, ‘%g %g %g’, [3, Inf]);
A = data’;
fclose(fid);
A;
n=size(A);
kk=n(1);
R=1.5;
MM=zeros(kk,1);
for k=1:kk
MM(k)=0;
for i=1:3
MM(k)= MM(k)+ A(k,i)*A(k,i);
end
MM(k)=sqrt(MM(k));
end
M = A(MM >R,:);
[x1,y1,z1] = sphere(1);
Psphere = [R*x1(:) R*y1(:) R*z1(:)];
Psphere = unique(Psphere,’rows’);
P = [M;Psphere];
plot3(P(:,1),P(:,2),P(:,3),’.’)
shp= alphaShape(P(:,1),P(:,2),P(:,3),1);
plot(shp)
shp.Alpha = 2;
[tri,loc] = alphaTriangulation(shp);
fid = fopen(‘nodess.dat’,’w’);
fprintf(fid,’%it %it %in’,loc);
fclose(fid);
fid = fopen(‘tetreades.dat’,’w’);
fprintf(fid,’%it %it %it %in’,tri);
fclose(fid);
numtetrahedra = size(tri,1);
numnodes = size(loc);
% model = createpde;
% [gCube,mshC]=geometryFromMesh(model,loc’,tri’);
% %save (‘nodesn.txt’, ‘tri’)
% tri
% loc;
axis equal sphere in tetrahedra MATLAB Answers — New Questions
How to generate 2-D Lookup Table data for a 3-Output Fuzzy Logic System
I want design a look up table for fuzzy logic which has 2 inputs and 3 outputs. I referred to help on mathworks however its for 2 inputs and 1 output. Please refer to attached image.
https://www.mathworks.com/help//releases/R2021a/fuzzy/implement-fuzzy-pid-controller-in-simulink-using-lookup-table.html#d123e17778
Please suggest a way to create look up table for fuzzy logic using 2 inputs and 3 outputs.I want design a look up table for fuzzy logic which has 2 inputs and 3 outputs. I referred to help on mathworks however its for 2 inputs and 1 output. Please refer to attached image.
https://www.mathworks.com/help//releases/R2021a/fuzzy/implement-fuzzy-pid-controller-in-simulink-using-lookup-table.html#d123e17778
Please suggest a way to create look up table for fuzzy logic using 2 inputs and 3 outputs. I want design a look up table for fuzzy logic which has 2 inputs and 3 outputs. I referred to help on mathworks however its for 2 inputs and 1 output. Please refer to attached image.
https://www.mathworks.com/help//releases/R2021a/fuzzy/implement-fuzzy-pid-controller-in-simulink-using-lookup-table.html#d123e17778
Please suggest a way to create look up table for fuzzy logic using 2 inputs and 3 outputs. simulink, matlab, fuzzy, fuzzy logic toolbox, lookuptables MATLAB Answers — New Questions
Deploying CNN model on FPGA DE0 Nano Board
Hello,
I am planning to deploy a CNN on my FPGA DE0 Nano Board (Cyclone IV), which is a custom board not directly supported by MATLAB. I have made myself comfortable with HDL Coder in Simulink by working on FIL (FPGA-in-the-loop) workflow for video processing application and hence I am looking for a similar workflow using Simulink, HDL coder, etc.
Could you outline the exact steps to follow on how do I go about developing a simple model using Simulink (maybe start with SqueezeNet to begin with on Deep Network Designer), making it hardware compatible and the process to deploy it on my FPGA? The resources available online talk about IP core generation, etc, which are a bit confusing and overwhelming.
Thanks :)Hello,
I am planning to deploy a CNN on my FPGA DE0 Nano Board (Cyclone IV), which is a custom board not directly supported by MATLAB. I have made myself comfortable with HDL Coder in Simulink by working on FIL (FPGA-in-the-loop) workflow for video processing application and hence I am looking for a similar workflow using Simulink, HDL coder, etc.
Could you outline the exact steps to follow on how do I go about developing a simple model using Simulink (maybe start with SqueezeNet to begin with on Deep Network Designer), making it hardware compatible and the process to deploy it on my FPGA? The resources available online talk about IP core generation, etc, which are a bit confusing and overwhelming.
Thanks 🙂 Hello,
I am planning to deploy a CNN on my FPGA DE0 Nano Board (Cyclone IV), which is a custom board not directly supported by MATLAB. I have made myself comfortable with HDL Coder in Simulink by working on FIL (FPGA-in-the-loop) workflow for video processing application and hence I am looking for a similar workflow using Simulink, HDL coder, etc.
Could you outline the exact steps to follow on how do I go about developing a simple model using Simulink (maybe start with SqueezeNet to begin with on Deep Network Designer), making it hardware compatible and the process to deploy it on my FPGA? The resources available online talk about IP core generation, etc, which are a bit confusing and overwhelming.
Thanks 🙂 fpga, simulink, neural network, hdl, fpga in the loop MATLAB Answers — New Questions
Is it possible to use the serialport object to connect exactly like Putty is able to?
I am using a MATLAB GUI app I wrote to connect via serial over USB to an Arduino. Unfortunately whenever I open the connection, the Arduino resets. This is expected behaviour, and there are hardware workarounds (including cutting the reset line, or using a 22uF cap like discussed here https://electronics.stackexchange.com/questions/24743/arduino-resetting-while-reconnecting-the-serial-terminal).
However, it IS also possible to prevent this behaviour by controlling the DTR line on the connection. For example, in Putty, if I select DSR/DTR mode, then the Arduino does not reset, so I know it is possible. I have not however been able to work out how to do it with MATLAB, and don’t know whether it is possible. I have explored the SerialPort object help, and am aware of the DTR option. However, I have exhausted all attempts at getting this to work and am now not sure whether it is even possible.
Has anyone ever done this or got it working?
Many thanks,I am using a MATLAB GUI app I wrote to connect via serial over USB to an Arduino. Unfortunately whenever I open the connection, the Arduino resets. This is expected behaviour, and there are hardware workarounds (including cutting the reset line, or using a 22uF cap like discussed here https://electronics.stackexchange.com/questions/24743/arduino-resetting-while-reconnecting-the-serial-terminal).
However, it IS also possible to prevent this behaviour by controlling the DTR line on the connection. For example, in Putty, if I select DSR/DTR mode, then the Arduino does not reset, so I know it is possible. I have not however been able to work out how to do it with MATLAB, and don’t know whether it is possible. I have explored the SerialPort object help, and am aware of the DTR option. However, I have exhausted all attempts at getting this to work and am now not sure whether it is even possible.
Has anyone ever done this or got it working?
Many thanks, I am using a MATLAB GUI app I wrote to connect via serial over USB to an Arduino. Unfortunately whenever I open the connection, the Arduino resets. This is expected behaviour, and there are hardware workarounds (including cutting the reset line, or using a 22uF cap like discussed here https://electronics.stackexchange.com/questions/24743/arduino-resetting-while-reconnecting-the-serial-terminal).
However, it IS also possible to prevent this behaviour by controlling the DTR line on the connection. For example, in Putty, if I select DSR/DTR mode, then the Arduino does not reset, so I know it is possible. I have not however been able to work out how to do it with MATLAB, and don’t know whether it is possible. I have explored the SerialPort object help, and am aware of the DTR option. However, I have exhausted all attempts at getting this to work and am now not sure whether it is even possible.
Has anyone ever done this or got it working?
Many thanks, matlab, serialport, arduino, dtr MATLAB Answers — New Questions
How to send data between nodes in an iot network?
I have created a simulation environment for IoT network which consist of 10 nodes 1 edge node and 1 control center. I want to send data from nodes to the edge node.I have created a simulation environment for IoT network which consist of 10 nodes 1 edge node and 1 control center. I want to send data from nodes to the edge node. I have created a simulation environment for IoT network which consist of 10 nodes 1 edge node and 1 control center. I want to send data from nodes to the edge node. matlab, iot, nodes, iot network MATLAB Answers — New Questions
Transport Delay in Realtime simulation
Hello,
I set the simulation time to "inf" in order to be able to change the parameters during real-time.
However it seems that Transport Delay block is not working in this mode. When I switch to finite time, it is working, but then I can not change the parameters real-time.
How to solve this?
Thanks
M.Hello,
I set the simulation time to "inf" in order to be able to change the parameters during real-time.
However it seems that Transport Delay block is not working in this mode. When I switch to finite time, it is working, but then I can not change the parameters real-time.
How to solve this?
Thanks
M. Hello,
I set the simulation time to "inf" in order to be able to change the parameters during real-time.
However it seems that Transport Delay block is not working in this mode. When I switch to finite time, it is working, but then I can not change the parameters real-time.
How to solve this?
Thanks
M. delay, simulink, realtime MATLAB Answers — New Questions
I am using the queue counter, I have put the queue counter in VISSIM GUI and saved & enabled it but while i am coding it in MATLAB the results are showing NaN, Why is it so
%Link Numbers
Link_Num_1=Link_i.ItemByKey(5);
Link_Num_2=Link_i.ItemByKey(7);
Link_Num_3=Link_i.ItemByKey(13);
Link_Num_4=Link_i.ItemByKey(23);
simulation_duration = 7200; % Total simulation time in seconds
interval = 1; % Collect queue length every 120 seconds
num_intervals = simulation_duration / interval; % Number of 120-second intervals (60)
% Initialize matrix for queue lengths (60 rows)
queue_lengths = zeros(num_intervals, 1);
% Get queue counter
queue_counters_1 = Link_Num_1.QueueCounters.GetAll;
qc1 = queue_counters_1{1}; % First queue counter
% Display queue counter info
disp([‘Number of queue counters: ‘, num2str(length(queue_counters_1))]);
disp([‘Queue Counter Object: ‘, class(qc1)]);
disp([‘Queue Counter Name: ‘, qc1.get(‘AttValue’, ‘Name’)]);
% Run simulation and collect queue length every 120 seconds
interval_idx = 0; % Counter for interval index
for t = 1:interval:simulation_duration
% Run simulation for 120 seconds
for step = 1:interval
sim.RunSingleStep;
end
% Increment interval index
interval_idx = interval_idx + 1;
% Get queue length
queue_length = qc1.get(‘AttValue’, ‘QLen(Current, Last)’);
if isnan(queue_length)
queue_length = 0; % Replace NaN with 0
end
queue_lengths(interval_idx, 1) = queue_length;
% Display queue length for this interval
disp([‘Time ‘, num2str(t), ‘s: Queue Length = ‘, num2str(queue_length)]);
end
disp(‘Queue Length collection complete.’);%Link Numbers
Link_Num_1=Link_i.ItemByKey(5);
Link_Num_2=Link_i.ItemByKey(7);
Link_Num_3=Link_i.ItemByKey(13);
Link_Num_4=Link_i.ItemByKey(23);
simulation_duration = 7200; % Total simulation time in seconds
interval = 1; % Collect queue length every 120 seconds
num_intervals = simulation_duration / interval; % Number of 120-second intervals (60)
% Initialize matrix for queue lengths (60 rows)
queue_lengths = zeros(num_intervals, 1);
% Get queue counter
queue_counters_1 = Link_Num_1.QueueCounters.GetAll;
qc1 = queue_counters_1{1}; % First queue counter
% Display queue counter info
disp([‘Number of queue counters: ‘, num2str(length(queue_counters_1))]);
disp([‘Queue Counter Object: ‘, class(qc1)]);
disp([‘Queue Counter Name: ‘, qc1.get(‘AttValue’, ‘Name’)]);
% Run simulation and collect queue length every 120 seconds
interval_idx = 0; % Counter for interval index
for t = 1:interval:simulation_duration
% Run simulation for 120 seconds
for step = 1:interval
sim.RunSingleStep;
end
% Increment interval index
interval_idx = interval_idx + 1;
% Get queue length
queue_length = qc1.get(‘AttValue’, ‘QLen(Current, Last)’);
if isnan(queue_length)
queue_length = 0; % Replace NaN with 0
end
queue_lengths(interval_idx, 1) = queue_length;
% Display queue length for this interval
disp([‘Time ‘, num2str(t), ‘s: Queue Length = ‘, num2str(queue_length)]);
end
disp(‘Queue Length collection complete.’); %Link Numbers
Link_Num_1=Link_i.ItemByKey(5);
Link_Num_2=Link_i.ItemByKey(7);
Link_Num_3=Link_i.ItemByKey(13);
Link_Num_4=Link_i.ItemByKey(23);
simulation_duration = 7200; % Total simulation time in seconds
interval = 1; % Collect queue length every 120 seconds
num_intervals = simulation_duration / interval; % Number of 120-second intervals (60)
% Initialize matrix for queue lengths (60 rows)
queue_lengths = zeros(num_intervals, 1);
% Get queue counter
queue_counters_1 = Link_Num_1.QueueCounters.GetAll;
qc1 = queue_counters_1{1}; % First queue counter
% Display queue counter info
disp([‘Number of queue counters: ‘, num2str(length(queue_counters_1))]);
disp([‘Queue Counter Object: ‘, class(qc1)]);
disp([‘Queue Counter Name: ‘, qc1.get(‘AttValue’, ‘Name’)]);
% Run simulation and collect queue length every 120 seconds
interval_idx = 0; % Counter for interval index
for t = 1:interval:simulation_duration
% Run simulation for 120 seconds
for step = 1:interval
sim.RunSingleStep;
end
% Increment interval index
interval_idx = interval_idx + 1;
% Get queue length
queue_length = qc1.get(‘AttValue’, ‘QLen(Current, Last)’);
if isnan(queue_length)
queue_length = 0; % Replace NaN with 0
end
queue_lengths(interval_idx, 1) = queue_length;
% Display queue length for this interval
disp([‘Time ‘, num2str(t), ‘s: Queue Length = ‘, num2str(queue_length)]);
end
disp(‘Queue Length collection complete.’); help MATLAB Answers — New Questions
Using datetime in surf plot
I have a bunch of subplots that are linked with linkaxes and I currently use the FEX function <http://www.mathworks.com/matlabcentral/fileexchange/27075-intelligent-dynamic-date-ticks dynamicDateTicks> to update the tick labels when I zoom. BUT. The new datetime format looks better (less crowded) on the graphs. Only I can’t get it (datetime) to work with a surf plot.
Here’s a minimal working example:
X = 25:25:100;
T = datenum(2015,01,01,1:4,0,0);
Z = [ 1 2 3 4;
5 6 7 8;
9 10 11 12;
13 14 15 16];
[Xmesh,Tmesh] = meshgrid(X,T);
% Tmesh = datetime(Tmesh,’ConvertFrom’,’datenum’);
figure;
surf(Tmesh,Xmesh,Z);
If you uncomment the one line, this gives me the error:
Error using surf (line 57)
X, Y, Z, and C cannot be complex.
Anyone else have this problem? It seems like a bug, since it works fine with any other plot. For example:
plot(datetime(2014,01,1:2),1:2)
Any help would be appreciated. And just to be clear, I currently can get it all to work with dynamicDateTicks (datetick), I’m just hoping for a cleaner plot.I have a bunch of subplots that are linked with linkaxes and I currently use the FEX function <http://www.mathworks.com/matlabcentral/fileexchange/27075-intelligent-dynamic-date-ticks dynamicDateTicks> to update the tick labels when I zoom. BUT. The new datetime format looks better (less crowded) on the graphs. Only I can’t get it (datetime) to work with a surf plot.
Here’s a minimal working example:
X = 25:25:100;
T = datenum(2015,01,01,1:4,0,0);
Z = [ 1 2 3 4;
5 6 7 8;
9 10 11 12;
13 14 15 16];
[Xmesh,Tmesh] = meshgrid(X,T);
% Tmesh = datetime(Tmesh,’ConvertFrom’,’datenum’);
figure;
surf(Tmesh,Xmesh,Z);
If you uncomment the one line, this gives me the error:
Error using surf (line 57)
X, Y, Z, and C cannot be complex.
Anyone else have this problem? It seems like a bug, since it works fine with any other plot. For example:
plot(datetime(2014,01,1:2),1:2)
Any help would be appreciated. And just to be clear, I currently can get it all to work with dynamicDateTicks (datetick), I’m just hoping for a cleaner plot. I have a bunch of subplots that are linked with linkaxes and I currently use the FEX function <http://www.mathworks.com/matlabcentral/fileexchange/27075-intelligent-dynamic-date-ticks dynamicDateTicks> to update the tick labels when I zoom. BUT. The new datetime format looks better (less crowded) on the graphs. Only I can’t get it (datetime) to work with a surf plot.
Here’s a minimal working example:
X = 25:25:100;
T = datenum(2015,01,01,1:4,0,0);
Z = [ 1 2 3 4;
5 6 7 8;
9 10 11 12;
13 14 15 16];
[Xmesh,Tmesh] = meshgrid(X,T);
% Tmesh = datetime(Tmesh,’ConvertFrom’,’datenum’);
figure;
surf(Tmesh,Xmesh,Z);
If you uncomment the one line, this gives me the error:
Error using surf (line 57)
X, Y, Z, and C cannot be complex.
Anyone else have this problem? It seems like a bug, since it works fine with any other plot. For example:
plot(datetime(2014,01,1:2),1:2)
Any help would be appreciated. And just to be clear, I currently can get it all to work with dynamicDateTicks (datetick), I’m just hoping for a cleaner plot. surf, datetime, 3d plots MATLAB Answers — New Questions
creating struct array for libstruct to callib my c code
Hi,
I have b1 struct that has field "UserInput" and size up to 20 and "UserInput" has 2 fields "aaa", and "bbb". For example you can call b1.UserInput(20).a = double(10);
I tried this code.
struct1 = libstruct(‘struct1_T’);
inputStruct = libstruct(‘UserInput’, repmat( {struct1}, 1, 20));
so how do I create struct array in libstruct ?
I use matlab 2017bHi,
I have b1 struct that has field "UserInput" and size up to 20 and "UserInput" has 2 fields "aaa", and "bbb". For example you can call b1.UserInput(20).a = double(10);
I tried this code.
struct1 = libstruct(‘struct1_T’);
inputStruct = libstruct(‘UserInput’, repmat( {struct1}, 1, 20));
so how do I create struct array in libstruct ?
I use matlab 2017b Hi,
I have b1 struct that has field "UserInput" and size up to 20 and "UserInput" has 2 fields "aaa", and "bbb". For example you can call b1.UserInput(20).a = double(10);
I tried this code.
struct1 = libstruct(‘struct1_T’);
inputStruct = libstruct(‘UserInput’, repmat( {struct1}, 1, 20));
so how do I create struct array in libstruct ?
I use matlab 2017b libstruct, struct, structures, array, struct array, code generation MATLAB Answers — New Questions
How to resolve the error: the variable fuzout(1,i) cannot save fuzout = evalfis(fis, trainin)
Hello, i’m getting an error in my code:
Unable to perform assignment because the indices on the left side are not compatible with
the size of the right side.
Error in anfisloop (line 6)
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
my code: the function i’m calling:
this function will create 5 models each one will be in a column in T[].
so T(1,1) is the first model, T(1,2) the second …..
the idea of what i want to do is:
create a variable (here fuzout[]) that will stack in each column the output of a model
and another variable that will stack in each column the RMSE of a model.
function [T,fuzout,trnRMSE] = anfisloop(trainin,trainou,testin,testout,fis)
epoch=5;
for i = 1:epoch
opt=anfisopt(testin,testout,fis,i);
T(1,i) = anfis([trainin trainou],opt);
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
end
end
the function evaltrainset that the precious function call:
evalfis is a matlab’s function
function [fuzout,trnRMSE] = evaltrainset(fis,trainin,trainout)
fuzout = evalfis(fis,trainin);
trnRMSE = norm(fuzout-trainout)/sqrt(length(fuzout));
end
how i am calling the function :
>> [A,fuzout,trnRMSE]=anfisloop(trainin,trainout,testin,testout,fis)
please help.Hello, i’m getting an error in my code:
Unable to perform assignment because the indices on the left side are not compatible with
the size of the right side.
Error in anfisloop (line 6)
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
my code: the function i’m calling:
this function will create 5 models each one will be in a column in T[].
so T(1,1) is the first model, T(1,2) the second …..
the idea of what i want to do is:
create a variable (here fuzout[]) that will stack in each column the output of a model
and another variable that will stack in each column the RMSE of a model.
function [T,fuzout,trnRMSE] = anfisloop(trainin,trainou,testin,testout,fis)
epoch=5;
for i = 1:epoch
opt=anfisopt(testin,testout,fis,i);
T(1,i) = anfis([trainin trainou],opt);
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
end
end
the function evaltrainset that the precious function call:
evalfis is a matlab’s function
function [fuzout,trnRMSE] = evaltrainset(fis,trainin,trainout)
fuzout = evalfis(fis,trainin);
trnRMSE = norm(fuzout-trainout)/sqrt(length(fuzout));
end
how i am calling the function :
>> [A,fuzout,trnRMSE]=anfisloop(trainin,trainout,testin,testout,fis)
please help. Hello, i’m getting an error in my code:
Unable to perform assignment because the indices on the left side are not compatible with
the size of the right side.
Error in anfisloop (line 6)
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
my code: the function i’m calling:
this function will create 5 models each one will be in a column in T[].
so T(1,1) is the first model, T(1,2) the second …..
the idea of what i want to do is:
create a variable (here fuzout[]) that will stack in each column the output of a model
and another variable that will stack in each column the RMSE of a model.
function [T,fuzout,trnRMSE] = anfisloop(trainin,trainou,testin,testout,fis)
epoch=5;
for i = 1:epoch
opt=anfisopt(testin,testout,fis,i);
T(1,i) = anfis([trainin trainou],opt);
[fuzout(1,i),trnRMSE(1,i)] = evaltrainset(T(1,i),trainin,trainou);
end
end
the function evaltrainset that the precious function call:
evalfis is a matlab’s function
function [fuzout,trnRMSE] = evaltrainset(fis,trainin,trainout)
fuzout = evalfis(fis,trainin);
trnRMSE = norm(fuzout-trainout)/sqrt(length(fuzout));
end
how i am calling the function :
>> [A,fuzout,trnRMSE]=anfisloop(trainin,trainout,testin,testout,fis)
please help. function, functions, matlab, matlab function, code, programming, fuzzy MATLAB Answers — New Questions
Scatter plots and lines
I am wanting to add in a line like the graph below, but cannot seem to get the black line to stop going upwards. The gradient of the line is 4, please see my code and help!
clearvars;
close all;
clc;
% Extracted data
L = [0.2, 0.21, 0.22, 0.23, 0.24, 0.25]; % Length in µm
G = [0.002073593, 0.002034555, 0.00198774, 0.00194322, 0.00191650, 0.00188695]; % G in µm⁻¹
V = [33.4790, 35.0453, 35.5131, 35.7370, 36.2533, 36.3155]; % V in µm/s
% Plotting
figure;
hold on;
% Plot G vs V as a regular line plot
plot(V, G, ‘o’, ‘LineWidth’, 2, ‘Color’, ‘b’, ‘MarkerFaceColor’, ‘b’, ‘DisplayName’, ‘Data’);
% Add a black line with gradient = 4 starting from the origin
m = 4; % Gradient
V_line = linspace(0, max(V)+1, 100); % Start from 0
G_line = m * V_line;
plot(V_line, G_line, ‘k-‘, ‘LineWidth’, 2, ‘DisplayName’, ‘Gradient = 4 (from origin)’);
% Formatting the plot
xlabel(‘Velocity V (µm/s)’, ‘FontSize’, 30);
ylabel(‘Thermal Gradient G (µm⁻¹)’, ‘FontSize’, 30);
title(‘G vs V for Varying Separation Distances’, ‘FontSize’, 35);
legend(‘Location’, ‘northeast’, ‘FontSize’, 20);
grid on;
xlim([min(0, min(V)-0.5), max(V)+0.5]);
ylim([min(0, min(G)-0.00001), max(G)+0.00001]);I am wanting to add in a line like the graph below, but cannot seem to get the black line to stop going upwards. The gradient of the line is 4, please see my code and help!
clearvars;
close all;
clc;
% Extracted data
L = [0.2, 0.21, 0.22, 0.23, 0.24, 0.25]; % Length in µm
G = [0.002073593, 0.002034555, 0.00198774, 0.00194322, 0.00191650, 0.00188695]; % G in µm⁻¹
V = [33.4790, 35.0453, 35.5131, 35.7370, 36.2533, 36.3155]; % V in µm/s
% Plotting
figure;
hold on;
% Plot G vs V as a regular line plot
plot(V, G, ‘o’, ‘LineWidth’, 2, ‘Color’, ‘b’, ‘MarkerFaceColor’, ‘b’, ‘DisplayName’, ‘Data’);
% Add a black line with gradient = 4 starting from the origin
m = 4; % Gradient
V_line = linspace(0, max(V)+1, 100); % Start from 0
G_line = m * V_line;
plot(V_line, G_line, ‘k-‘, ‘LineWidth’, 2, ‘DisplayName’, ‘Gradient = 4 (from origin)’);
% Formatting the plot
xlabel(‘Velocity V (µm/s)’, ‘FontSize’, 30);
ylabel(‘Thermal Gradient G (µm⁻¹)’, ‘FontSize’, 30);
title(‘G vs V for Varying Separation Distances’, ‘FontSize’, 35);
legend(‘Location’, ‘northeast’, ‘FontSize’, 20);
grid on;
xlim([min(0, min(V)-0.5), max(V)+0.5]);
ylim([min(0, min(G)-0.00001), max(G)+0.00001]); I am wanting to add in a line like the graph below, but cannot seem to get the black line to stop going upwards. The gradient of the line is 4, please see my code and help!
clearvars;
close all;
clc;
% Extracted data
L = [0.2, 0.21, 0.22, 0.23, 0.24, 0.25]; % Length in µm
G = [0.002073593, 0.002034555, 0.00198774, 0.00194322, 0.00191650, 0.00188695]; % G in µm⁻¹
V = [33.4790, 35.0453, 35.5131, 35.7370, 36.2533, 36.3155]; % V in µm/s
% Plotting
figure;
hold on;
% Plot G vs V as a regular line plot
plot(V, G, ‘o’, ‘LineWidth’, 2, ‘Color’, ‘b’, ‘MarkerFaceColor’, ‘b’, ‘DisplayName’, ‘Data’);
% Add a black line with gradient = 4 starting from the origin
m = 4; % Gradient
V_line = linspace(0, max(V)+1, 100); % Start from 0
G_line = m * V_line;
plot(V_line, G_line, ‘k-‘, ‘LineWidth’, 2, ‘DisplayName’, ‘Gradient = 4 (from origin)’);
% Formatting the plot
xlabel(‘Velocity V (µm/s)’, ‘FontSize’, 30);
ylabel(‘Thermal Gradient G (µm⁻¹)’, ‘FontSize’, 30);
title(‘G vs V for Varying Separation Distances’, ‘FontSize’, 35);
legend(‘Location’, ‘northeast’, ‘FontSize’, 20);
grid on;
xlim([min(0, min(V)-0.5), max(V)+0.5]);
ylim([min(0, min(G)-0.00001), max(G)+0.00001]); scatter, line, plot MATLAB Answers — New Questions
Copilot’s Solution to Fix Grammar and Spellings
Fix Grammar and Spelling Problems with a Single Click
I am indebted to Paul Robichaux for pointing out a notable example of where Copilot for Word could help authors rewrite text to be clearer and more concise. The offending article is in the Microsoft Graph documentation for a topic called “enhanced personalization control overview.” It’s part of a set of controls for Microsoft 365 features such as name pronunciation and user pronouns in an area that’s been under development for several years. The text is turgid, unclear, and difficult to understand (Figure 1).

The Copilot Rewrite
I asked Copilot for Word to make the original text more consise and understandable. Copilot produced this text:
Microsoft 365 Copilot customizes itself for each user, assisting with daily tasks based on their work knowledge. Both tenant administrators and users can manage this personalization using advanced control features.
Discover how Microsoft 365 Copilot enhances personalization, ensures privacy, and provides control through improved settings.
The corrected text is still not good. Human intervention is necessary to explain how Copilot “can become personalized to each user” (original text) or how Copilot “customizes itself for each user” (revision), and so on. It is a stark warning of the danger of accepting AI-generated text without question. Not only can customer communications end up with absolute rubbish, but the danger also exists that AI-generated incorrect and misleading text ends up being stored in a file and reused ad nauseum by Copilot when it generates responses to future user prompts.
You might wonder why the Microsoft writers did not ask Copilot to refine their text. Well, I do not know if they did or not, but it could be that because the text is about a new feature that does not exist, Copilot could not find anything better to say in the Graph or in its LLMs. Remember, generative text depends on what has gone before. Copilot can rehash material it knows about, but it cannot write material about a new topic from scratch.
The Copilot Promise to Fix Grammar and Spelling Errors
Which brings me neatly to message center notification MC1060868 (23 April 2025, Microsoft 365 roadmap item 483954), which promises a new Copilot “fix grammar and spellings” feature that will address all grammar and spelling problems found in text with a single click. General availability of the feature is due in late April 2025 with deployment scheduled to complete worldwide by mid-June 2025.
Microsoft doesn’t say what languages are supported, but I assume that the feature will appear in all the languages supported by Copilot. MC1060868 contains no detail about which Copilot apps will benefit. Copilot for Word is an obvious target, and I assume that Copilot for Outlook will also receive help to tidy up email communications. As to the other apps, I guess we will see after the feature arrives.
It is a logical progression to have a single-pass process to find and remedy common errors in documents. Word has options to check for spelling and grammar errors as user type text into documents. The difference here is that Word suggests and nudges people when it detects potential errors whereas Copilot will go ahead and rewrite text to remove errors. It is then up to the user to decide whether to keep or discard the Copilot rewrite. Overall, Copilot’s one-click solution is a more proactive approach to helping people generate better text.
But is it Possible to Fix Grammar and Spelling with One Click?
That is, if everything works. The history of software designed to help people write better text is littered with dead ends. Does anyone pay much attention to the recommendations of Microsoft Editor? Why do people continue to subscribe to services like Grammarly when Microsoft offers spell and grammar checking in its products. Perhaps we are heading to a new golden age of beautiful text created by humans and enhanced by AI. Maybe, and I am sure the prospect will be welcomed by those who write the Graph documentation. But I am not holding my breath.
Make sure that you’re not surprised about changes that appear inside Microsoft 365 applications by subscribing to the Office 365 for IT Pros eBook. Our monthly updates make sure that our subscribers stay informed.
Selecting which prominence to use with findpeaks
Hello
I am using findpeaks to find the prominence of my peaks in the attached imaged. However the prominence for peak 4 is instead the entire height of the function. How can I change this to match the other peaks (1,2,3,5) and why is this behaviour happening?
Thanks
HP
Code:
prominance = max(xDose(:,2))/3;
[pks,locs,widths,proms] = findpeaks(xDose(:,2),xDose(:,1),’MinPeakProminence’, prominance);
findpeaks(xDose(:,2),xDose(:,1), ‘MinPeakProminence’, prominance,’Annotate’,’extents’)
text(locs+1,pks,num2str((1:numel(pks))’))Hello
I am using findpeaks to find the prominence of my peaks in the attached imaged. However the prominence for peak 4 is instead the entire height of the function. How can I change this to match the other peaks (1,2,3,5) and why is this behaviour happening?
Thanks
HP
Code:
prominance = max(xDose(:,2))/3;
[pks,locs,widths,proms] = findpeaks(xDose(:,2),xDose(:,1),’MinPeakProminence’, prominance);
findpeaks(xDose(:,2),xDose(:,1), ‘MinPeakProminence’, prominance,’Annotate’,’extents’)
text(locs+1,pks,num2str((1:numel(pks))’)) Hello
I am using findpeaks to find the prominence of my peaks in the attached imaged. However the prominence for peak 4 is instead the entire height of the function. How can I change this to match the other peaks (1,2,3,5) and why is this behaviour happening?
Thanks
HP
Code:
prominance = max(xDose(:,2))/3;
[pks,locs,widths,proms] = findpeaks(xDose(:,2),xDose(:,1),’MinPeakProminence’, prominance);
findpeaks(xDose(:,2),xDose(:,1), ‘MinPeakProminence’, prominance,’Annotate’,’extents’)
text(locs+1,pks,num2str((1:numel(pks))’)) findpeaks, data proccesing, graphs MATLAB Answers — New Questions
Stabilise the results of a simple DL model for binary class classification
I am training a simple DL model for binary class classification, with 2 blocks of these layers, followed by a softmax layer:
featureInputLayer -> fullyConnectedLayer -> layerNormalizationLayer -> reluLayer
For a fixed train, validation and test set, I am getting diverse results in accuracy, ranging from 45-85%. Kindly suggest how to stabilise the results.
Here, training instances are 100 (50 per class), validation 24 (10 per class) and using
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, … % Adjust based on dataset size
‘MiniBatchSize’, 16, … % Choose batch size based on memory
‘ValidationData’, valDS, … % Validation data
‘ValidationFrequency’, 5, … % Adjust based on dataset size
‘Verbose’, true, …
‘Plots’, ‘training-progress’, …
‘OutputNetwork’, ‘best-validation-loss’, … % Save best model
‘Shuffle’, ‘every-epoch’,…
‘LearnRateSchedule’, ‘cosine’);I am training a simple DL model for binary class classification, with 2 blocks of these layers, followed by a softmax layer:
featureInputLayer -> fullyConnectedLayer -> layerNormalizationLayer -> reluLayer
For a fixed train, validation and test set, I am getting diverse results in accuracy, ranging from 45-85%. Kindly suggest how to stabilise the results.
Here, training instances are 100 (50 per class), validation 24 (10 per class) and using
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, … % Adjust based on dataset size
‘MiniBatchSize’, 16, … % Choose batch size based on memory
‘ValidationData’, valDS, … % Validation data
‘ValidationFrequency’, 5, … % Adjust based on dataset size
‘Verbose’, true, …
‘Plots’, ‘training-progress’, …
‘OutputNetwork’, ‘best-validation-loss’, … % Save best model
‘Shuffle’, ‘every-epoch’,…
‘LearnRateSchedule’, ‘cosine’); I am training a simple DL model for binary class classification, with 2 blocks of these layers, followed by a softmax layer:
featureInputLayer -> fullyConnectedLayer -> layerNormalizationLayer -> reluLayer
For a fixed train, validation and test set, I am getting diverse results in accuracy, ranging from 45-85%. Kindly suggest how to stabilise the results.
Here, training instances are 100 (50 per class), validation 24 (10 per class) and using
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 100, … % Adjust based on dataset size
‘MiniBatchSize’, 16, … % Choose batch size based on memory
‘ValidationData’, valDS, … % Validation data
‘ValidationFrequency’, 5, … % Adjust based on dataset size
‘Verbose’, true, …
‘Plots’, ‘training-progress’, …
‘OutputNetwork’, ‘best-validation-loss’, … % Save best model
‘Shuffle’, ‘every-epoch’,…
‘LearnRateSchedule’, ‘cosine’); deep learning, softmax layer, stabilization MATLAB Answers — New Questions
Automatic Image Segmentation of three steel ropes using Image Processing Tools
Hello there,
I have an issue with dividing the image of three ropes into segments. You can see the original image (3104×3104) below:
I’d like to get some results of segmentation process like this:
How can I divide image into segments? What is the background should I choose? Please, help me with that.
I’ve written the code below, but I get unexpected results. How can I fix it?
I = imread(‘rope.jpg’)
gs = im2gray(I)
imshow(gs)
imhist(gs)
%Adjust image contrast ratio%
Aadj = imadjust(gs);
imshow(Aadj)
%create binary image automatically
imhist(Aadj)
bw = im2bw(Aadj);
imshow(bw);
%Extract the first two largest objects from the binary image.
bw = bwareafilt(bw,[400, inf]);
%Fill holes in the extracted object regions.
bw = 1 – bw;
imshow(bw)Hello there,
I have an issue with dividing the image of three ropes into segments. You can see the original image (3104×3104) below:
I’d like to get some results of segmentation process like this:
How can I divide image into segments? What is the background should I choose? Please, help me with that.
I’ve written the code below, but I get unexpected results. How can I fix it?
I = imread(‘rope.jpg’)
gs = im2gray(I)
imshow(gs)
imhist(gs)
%Adjust image contrast ratio%
Aadj = imadjust(gs);
imshow(Aadj)
%create binary image automatically
imhist(Aadj)
bw = im2bw(Aadj);
imshow(bw);
%Extract the first two largest objects from the binary image.
bw = bwareafilt(bw,[400, inf]);
%Fill holes in the extracted object regions.
bw = 1 – bw;
imshow(bw) Hello there,
I have an issue with dividing the image of three ropes into segments. You can see the original image (3104×3104) below:
I’d like to get some results of segmentation process like this:
How can I divide image into segments? What is the background should I choose? Please, help me with that.
I’ve written the code below, but I get unexpected results. How can I fix it?
I = imread(‘rope.jpg’)
gs = im2gray(I)
imshow(gs)
imhist(gs)
%Adjust image contrast ratio%
Aadj = imadjust(gs);
imshow(Aadj)
%create binary image automatically
imhist(Aadj)
bw = im2bw(Aadj);
imshow(bw);
%Extract the first two largest objects from the binary image.
bw = bwareafilt(bw,[400, inf]);
%Fill holes in the extracted object regions.
bw = 1 – bw;
imshow(bw) image segmentation, steel ropes, color segmentation, cables MATLAB Answers — New Questions
Constraint tolerance setting is not working
I’m using fmincon for optimizing a system for trajectory optimization. Recently, my optimization problem seems to go well below 1e-06 feasibility for the ‘interior point’ solver. For this project, I will have to perform multiple trajectory optimizations and hence want my sovler to stop < 1e-06 feasibility. When I add the option of constraint tolerance, the solver continues to further iterate. How do I tackle this problem. I found the same problem wiith StepTolerance option as wellI’m using fmincon for optimizing a system for trajectory optimization. Recently, my optimization problem seems to go well below 1e-06 feasibility for the ‘interior point’ solver. For this project, I will have to perform multiple trajectory optimizations and hence want my sovler to stop < 1e-06 feasibility. When I add the option of constraint tolerance, the solver continues to further iterate. How do I tackle this problem. I found the same problem wiith StepTolerance option as well I’m using fmincon for optimizing a system for trajectory optimization. Recently, my optimization problem seems to go well below 1e-06 feasibility for the ‘interior point’ solver. For this project, I will have to perform multiple trajectory optimizations and hence want my sovler to stop < 1e-06 feasibility. When I add the option of constraint tolerance, the solver continues to further iterate. How do I tackle this problem. I found the same problem wiith StepTolerance option as well fmincon MATLAB Answers — New Questions
Data extraction for figure
Hey,
Could someone please extract the data for Data 1, Data 2, and Data 3 from the figure? I would like to use the digitized data for my analysis. If you could provie data in .csv file that would be appricated.Hey,
Could someone please extract the data for Data 1, Data 2, and Data 3 from the figure? I would like to use the digitized data for my analysis. If you could provie data in .csv file that would be appricated. Hey,
Could someone please extract the data for Data 1, Data 2, and Data 3 from the figure? I would like to use the digitized data for my analysis. If you could provie data in .csv file that would be appricated. extracting data MATLAB Answers — New Questions