Category: Matlab
Category Archives: Matlab
Handling the hub location problem without limit capacity
Due to my limited abilities, I would like to use MATLAB programming and genetic algorithm code to solve the model I have established. I would greatly appreciate it if someone capable could provide specific code to implement the solution for this model. The specific data involved in the model can be temporarily left blank, with a notation indicating where to input the data. Thank you very much!Due to my limited abilities, I would like to use MATLAB programming and genetic algorithm code to solve the model I have established. I would greatly appreciate it if someone capable could provide specific code to implement the solution for this model. The specific data involved in the model can be temporarily left blank, with a notation indicating where to input the data. Thank you very much! Due to my limited abilities, I would like to use MATLAB programming and genetic algorithm code to solve the model I have established. I would greatly appreciate it if someone capable could provide specific code to implement the solution for this model. The specific data involved in the model can be temporarily left blank, with a notation indicating where to input the data. Thank you very much! transferred MATLAB Answers — New Questions
XCP Timeout Error F28379D.
Hello,
I am recieving the following error:
Error:External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
I have seen numorous people ask about this error on this forum. None of the proposed solutions have worked for me. I have checked my add-ons. I have checked device manager. I have made sure I am using the right .ccxml file.
The model:
Device Manager:
Hardware Implementation:
Since the other discussion on this forum haven’t helped, I am wondering if I am experiencing something with a more uncommon cause. Thank you for your help!Hello,
I am recieving the following error:
Error:External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
I have seen numorous people ask about this error on this forum. None of the proposed solutions have worked for me. I have checked my add-ons. I have checked device manager. I have made sure I am using the right .ccxml file.
The model:
Device Manager:
Hardware Implementation:
Since the other discussion on this forum haven’t helped, I am wondering if I am experiencing something with a more uncommon cause. Thank you for your help! Hello,
I am recieving the following error:
Error:External Mode Open Protocol Connect command failed
Caused by:
Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command
I have seen numorous people ask about this error on this forum. None of the proposed solutions have worked for me. I have checked my add-ons. I have checked device manager. I have made sure I am using the right .ccxml file.
The model:
Device Manager:
Hardware Implementation:
Since the other discussion on this forum haven’t helped, I am wondering if I am experiencing something with a more uncommon cause. Thank you for your help! simulink, code generation, c2000, xcd MATLAB Answers — New Questions
help to plot cross section
Hello,
I want to plot cross section of salinity I use contourf but i want to add the value os salinity in same figure such as this picture
i wnt to show how the salinity change with depth and longitude .
the dimention of may data (time,lat,lon)
time=730*1;
lat=200*500;
lon=200*500;Hello,
I want to plot cross section of salinity I use contourf but i want to add the value os salinity in same figure such as this picture
i wnt to show how the salinity change with depth and longitude .
the dimention of may data (time,lat,lon)
time=730*1;
lat=200*500;
lon=200*500; Hello,
I want to plot cross section of salinity I use contourf but i want to add the value os salinity in same figure such as this picture
i wnt to show how the salinity change with depth and longitude .
the dimention of may data (time,lat,lon)
time=730*1;
lat=200*500;
lon=200*500; plot, cross, section MATLAB Answers — New Questions
I have a gas tank with a hole in it. How do I model the gas pressure in the tank with respect to time.
I have a gas tank (lets say 1m3 volume) with a hole in it. The gas at 6 bar pressure starts leaking through the hole. How do I model the gas pressure in the tank with respect to time after the leakage begins? I want to model it in the simscape.I have a gas tank (lets say 1m3 volume) with a hole in it. The gas at 6 bar pressure starts leaking through the hole. How do I model the gas pressure in the tank with respect to time after the leakage begins? I want to model it in the simscape. I have a gas tank (lets say 1m3 volume) with a hole in it. The gas at 6 bar pressure starts leaking through the hole. How do I model the gas pressure in the tank with respect to time after the leakage begins? I want to model it in the simscape. simscape, gas, simulink MATLAB Answers — New Questions
Freehand ROI for MEDSAM automated algorithm in medical image labeller
I am trying to implement the segmentation labelling based on MEDSAM from this link into the medical image labeller:
Interactively Segment and Analyze ROI Using MedSAM and Radiomics – MATLAB & Simulink – MathWorks América Latina
Automate Labeling in Medical Image Labeler – MATLAB & Simulink – MathWorks América Latina
However, I the unique way to create do this is opening a figure different than the interface of the medical image labeller, who takes times and is inefficient. Is there a way at least to create the ROI inside the medical image labeller (using freehand), and then passing this ROI to the automated function? I created my function below from the image. Also I was trying to create a listener without success for tuning the ROI while doing the segmentation on the medical image labeller.
function MASK = medsam_p(I,MASK)
%Medical Image Processing Function with MEDSAM
%
% Replace the sample below with your code———————————-
medsam = medicalSegmentAnythingModel;
embeddings = extractEmbeddings(medsam,I);
%roi = drawrectangle;
f = figure;
ax = axes(f);
dispIm = imshow(I,[],Parent=ax);
f.WindowState="maximized";
roi = drawrectangle(ax,’Label’,’ROI’);
%wait(roi); % Wait for the user to finish drawing
% Get the position of the drawn rectangle
MASK = segmentObjectsFromEmbeddings(medsam,embeddings,size(I),BoundingBox=roi.Position);
%————————————————————————–
endI am trying to implement the segmentation labelling based on MEDSAM from this link into the medical image labeller:
Interactively Segment and Analyze ROI Using MedSAM and Radiomics – MATLAB & Simulink – MathWorks América Latina
Automate Labeling in Medical Image Labeler – MATLAB & Simulink – MathWorks América Latina
However, I the unique way to create do this is opening a figure different than the interface of the medical image labeller, who takes times and is inefficient. Is there a way at least to create the ROI inside the medical image labeller (using freehand), and then passing this ROI to the automated function? I created my function below from the image. Also I was trying to create a listener without success for tuning the ROI while doing the segmentation on the medical image labeller.
function MASK = medsam_p(I,MASK)
%Medical Image Processing Function with MEDSAM
%
% Replace the sample below with your code———————————-
medsam = medicalSegmentAnythingModel;
embeddings = extractEmbeddings(medsam,I);
%roi = drawrectangle;
f = figure;
ax = axes(f);
dispIm = imshow(I,[],Parent=ax);
f.WindowState="maximized";
roi = drawrectangle(ax,’Label’,’ROI’);
%wait(roi); % Wait for the user to finish drawing
% Get the position of the drawn rectangle
MASK = segmentObjectsFromEmbeddings(medsam,embeddings,size(I),BoundingBox=roi.Position);
%————————————————————————–
end I am trying to implement the segmentation labelling based on MEDSAM from this link into the medical image labeller:
Interactively Segment and Analyze ROI Using MedSAM and Radiomics – MATLAB & Simulink – MathWorks América Latina
Automate Labeling in Medical Image Labeler – MATLAB & Simulink – MathWorks América Latina
However, I the unique way to create do this is opening a figure different than the interface of the medical image labeller, who takes times and is inefficient. Is there a way at least to create the ROI inside the medical image labeller (using freehand), and then passing this ROI to the automated function? I created my function below from the image. Also I was trying to create a listener without success for tuning the ROI while doing the segmentation on the medical image labeller.
function MASK = medsam_p(I,MASK)
%Medical Image Processing Function with MEDSAM
%
% Replace the sample below with your code———————————-
medsam = medicalSegmentAnythingModel;
embeddings = extractEmbeddings(medsam,I);
%roi = drawrectangle;
f = figure;
ax = axes(f);
dispIm = imshow(I,[],Parent=ax);
f.WindowState="maximized";
roi = drawrectangle(ax,’Label’,’ROI’);
%wait(roi); % Wait for the user to finish drawing
% Get the position of the drawn rectangle
MASK = segmentObjectsFromEmbeddings(medsam,embeddings,size(I),BoundingBox=roi.Position);
%————————————————————————–
end medical image labeller, medsam MATLAB Answers — New Questions
Export training-progress plots
I am using Matlab on a remote system. I use the -nodesktop flag and interact via command line.
I use trainnet to train deep learning networks. I would like to save and export the training-progress plots for viewing on a local system. Is this possible and if so, how do I do it?
Thank you.I am using Matlab on a remote system. I use the -nodesktop flag and interact via command line.
I use trainnet to train deep learning networks. I would like to save and export the training-progress plots for viewing on a local system. Is this possible and if so, how do I do it?
Thank you. I am using Matlab on a remote system. I use the -nodesktop flag and interact via command line.
I use trainnet to train deep learning networks. I would like to save and export the training-progress plots for viewing on a local system. Is this possible and if so, how do I do it?
Thank you. trainnet MATLAB Answers — New Questions
How do I include a PID block to control the required torque? I want to control the vehicle speed with a speed setpoint or speed profile (NEDC)
I have a basic electric car model where I can see speed, displacement, acceleration, force, etc as the torque of the motor moves the car. I want to add a PID controller so I can control the vehicle speed. I tried having the PID directly connected to the torque input and add them, and I would get a good velocity vs time graph but every other graph became a mess. Anyone help?I have a basic electric car model where I can see speed, displacement, acceleration, force, etc as the torque of the motor moves the car. I want to add a PID controller so I can control the vehicle speed. I tried having the PID directly connected to the torque input and add them, and I would get a good velocity vs time graph but every other graph became a mess. Anyone help? I have a basic electric car model where I can see speed, displacement, acceleration, force, etc as the torque of the motor moves the car. I want to add a PID controller so I can control the vehicle speed. I tried having the PID directly connected to the torque input and add them, and I would get a good velocity vs time graph but every other graph became a mess. Anyone help? pid, car, model, simulink MATLAB Answers — New Questions
How do i multiply this matrix to work in MATLAB, it keeps sending an error
(3^.5)*sind(x)*(p.)+cosd(x)*(p.)-800(3^.5)*sind(x)*(p.)+cosd(x)*(p.)-800 (3^.5)*sind(x)*(p.)+cosd(x)*(p.)-800 matlab code MATLAB Answers — New Questions
My licensu # 40960531. I have Matlab and 4 toolboxes and I wish to purchase Simulink
purchase of Simulinkpurchase of Simulink purchase of Simulink simulink MATLAB Answers — New Questions
Compare char data in a cell {‘x’} to a character ‘x’
I want to find what’s in my table that’s in a category column 1
If you read through you will see what I tries and how I finally figured it out. I’m posing the question because I can’t be the only person that wanted to do this simple (but not clearly and simply documented)
Starting with a text file:
HEADER that is ignored
R 0 5
L 5 0
Set up how I want the table (not that MATLAB will pay any attention)
app.StimInputTable.Data = table(‘Size’,[4 3],…
‘VariableTypes’,{‘categorical’,’uint8′,’uint8′});
What did I get? Got what I asked for
K>> class (app.StimInputTable.Data.Var1)
ans =
‘categorical’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘uint8’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘uint8’
Read in the file
app.StimInputTable.Data = readtable(infile);
MATLAB changes all the types
K>> class (app.StimInputTable.Data.Var1)
ans =
‘cell’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘double’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘double’
I can redo the .. table(… VariableTypes), but then it tosses all my category data instead of converting
So here’s my table, I can deal with the cells
K>> app.StimInputTable.Data
ans =
2×3 table
Var1 Var2 Var3
_____ ____ ____
{‘L’} 5 0
{‘R’} 0 5
So the char is considered a cell, ok I’ve seen a warning about how chars (or char vectors) get put into cells, but my users are not going to type "R" 5 0 etc these files already exist.
K>> app.StimInputTable.Data(jj,1)
ans =
table
Var1
{‘L’}
Try to pull it out and I get another table, not the cell
OK so I pull it this way
K>> app.StimInputTable.Data{jj,1}
ans =
1×1 cell array
{‘L’}
Now I have a more simple 1×1 cell array, now to the character out of the cell or compare cell to cell
How about I compare it to a cell with the char in it
K>> {‘L’}
ans =
1×1 cell array
{‘L’}
That looks good, same types, lets try it
K>> app.StimInputTable.Data{jj,1} == {‘L’}
Operator ‘==’ is not supported for operands of type ‘cell’.
So that didn’t work, so I’ll try
K>> cl = app.StimInputTable.Data{jj,1}
cl =
1×1 cell array
{‘L’}
Get the char out of the cell
K>> cl{1,1}
ans =
‘L’
K>> cl{1,1}== ‘L’
ans =
logical
1
Finally!
cl = app.StimInputTable.Data{jj,1}
if cl{1,1}== ‘L’
…
end
Is this really what I have to do? It took way too long to figure out. I never could find Help on how to extract the single cell of data out of a table. I have R and L as catagories when I use them later but can’t read them in as such initing the table size and variabletypes gets ignored by the read()
Wait a moment
app.StimInputTable.Data{j,1} % This gives a cell as above, but
app.StimInputTable.Data.Var1{j} % is going to work? Where is that documented?
ans =
‘L’
So now
if app.StimInputTable.Data.Var1{j} == ‘L’
Apparently using .Var1{i} is not the same as indexing with {j}
This works but where will you find it documented? Good luckI want to find what’s in my table that’s in a category column 1
If you read through you will see what I tries and how I finally figured it out. I’m posing the question because I can’t be the only person that wanted to do this simple (but not clearly and simply documented)
Starting with a text file:
HEADER that is ignored
R 0 5
L 5 0
Set up how I want the table (not that MATLAB will pay any attention)
app.StimInputTable.Data = table(‘Size’,[4 3],…
‘VariableTypes’,{‘categorical’,’uint8′,’uint8′});
What did I get? Got what I asked for
K>> class (app.StimInputTable.Data.Var1)
ans =
‘categorical’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘uint8’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘uint8’
Read in the file
app.StimInputTable.Data = readtable(infile);
MATLAB changes all the types
K>> class (app.StimInputTable.Data.Var1)
ans =
‘cell’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘double’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘double’
I can redo the .. table(… VariableTypes), but then it tosses all my category data instead of converting
So here’s my table, I can deal with the cells
K>> app.StimInputTable.Data
ans =
2×3 table
Var1 Var2 Var3
_____ ____ ____
{‘L’} 5 0
{‘R’} 0 5
So the char is considered a cell, ok I’ve seen a warning about how chars (or char vectors) get put into cells, but my users are not going to type "R" 5 0 etc these files already exist.
K>> app.StimInputTable.Data(jj,1)
ans =
table
Var1
{‘L’}
Try to pull it out and I get another table, not the cell
OK so I pull it this way
K>> app.StimInputTable.Data{jj,1}
ans =
1×1 cell array
{‘L’}
Now I have a more simple 1×1 cell array, now to the character out of the cell or compare cell to cell
How about I compare it to a cell with the char in it
K>> {‘L’}
ans =
1×1 cell array
{‘L’}
That looks good, same types, lets try it
K>> app.StimInputTable.Data{jj,1} == {‘L’}
Operator ‘==’ is not supported for operands of type ‘cell’.
So that didn’t work, so I’ll try
K>> cl = app.StimInputTable.Data{jj,1}
cl =
1×1 cell array
{‘L’}
Get the char out of the cell
K>> cl{1,1}
ans =
‘L’
K>> cl{1,1}== ‘L’
ans =
logical
1
Finally!
cl = app.StimInputTable.Data{jj,1}
if cl{1,1}== ‘L’
…
end
Is this really what I have to do? It took way too long to figure out. I never could find Help on how to extract the single cell of data out of a table. I have R and L as catagories when I use them later but can’t read them in as such initing the table size and variabletypes gets ignored by the read()
Wait a moment
app.StimInputTable.Data{j,1} % This gives a cell as above, but
app.StimInputTable.Data.Var1{j} % is going to work? Where is that documented?
ans =
‘L’
So now
if app.StimInputTable.Data.Var1{j} == ‘L’
Apparently using .Var1{i} is not the same as indexing with {j}
This works but where will you find it documented? Good luck I want to find what’s in my table that’s in a category column 1
If you read through you will see what I tries and how I finally figured it out. I’m posing the question because I can’t be the only person that wanted to do this simple (but not clearly and simply documented)
Starting with a text file:
HEADER that is ignored
R 0 5
L 5 0
Set up how I want the table (not that MATLAB will pay any attention)
app.StimInputTable.Data = table(‘Size’,[4 3],…
‘VariableTypes’,{‘categorical’,’uint8′,’uint8′});
What did I get? Got what I asked for
K>> class (app.StimInputTable.Data.Var1)
ans =
‘categorical’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘uint8’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘uint8’
Read in the file
app.StimInputTable.Data = readtable(infile);
MATLAB changes all the types
K>> class (app.StimInputTable.Data.Var1)
ans =
‘cell’
K>> class (app.StimInputTable.Data.Var2)
ans =
‘double’
K>> class (app.StimInputTable.Data.Var3)
ans =
‘double’
I can redo the .. table(… VariableTypes), but then it tosses all my category data instead of converting
So here’s my table, I can deal with the cells
K>> app.StimInputTable.Data
ans =
2×3 table
Var1 Var2 Var3
_____ ____ ____
{‘L’} 5 0
{‘R’} 0 5
So the char is considered a cell, ok I’ve seen a warning about how chars (or char vectors) get put into cells, but my users are not going to type "R" 5 0 etc these files already exist.
K>> app.StimInputTable.Data(jj,1)
ans =
table
Var1
{‘L’}
Try to pull it out and I get another table, not the cell
OK so I pull it this way
K>> app.StimInputTable.Data{jj,1}
ans =
1×1 cell array
{‘L’}
Now I have a more simple 1×1 cell array, now to the character out of the cell or compare cell to cell
How about I compare it to a cell with the char in it
K>> {‘L’}
ans =
1×1 cell array
{‘L’}
That looks good, same types, lets try it
K>> app.StimInputTable.Data{jj,1} == {‘L’}
Operator ‘==’ is not supported for operands of type ‘cell’.
So that didn’t work, so I’ll try
K>> cl = app.StimInputTable.Data{jj,1}
cl =
1×1 cell array
{‘L’}
Get the char out of the cell
K>> cl{1,1}
ans =
‘L’
K>> cl{1,1}== ‘L’
ans =
logical
1
Finally!
cl = app.StimInputTable.Data{jj,1}
if cl{1,1}== ‘L’
…
end
Is this really what I have to do? It took way too long to figure out. I never could find Help on how to extract the single cell of data out of a table. I have R and L as catagories when I use them later but can’t read them in as such initing the table size and variabletypes gets ignored by the read()
Wait a moment
app.StimInputTable.Data{j,1} % This gives a cell as above, but
app.StimInputTable.Data.Var1{j} % is going to work? Where is that documented?
ans =
‘L’
So now
if app.StimInputTable.Data.Var1{j} == ‘L’
Apparently using .Var1{i} is not the same as indexing with {j}
This works but where will you find it documented? Good luck get data in a cell MATLAB Answers — New Questions
How to model marine exhaust system using Simscape.
I want to create a simulation for marine exhaust systems for large vessels but I’m not sure how to set everything up.
I have values for temperature (from turbo), ambient temp (engine compartment), k values, h values, various exhaust pipe diameters, lengths, and thermal properties (stainless steel, aluminum, etc.).
Sections of the exhaust use a multilayer multi product insulation. I know the diameters at each layer, h and k values of the different layers, and thermal resistances of the layers.
Eventually, I want to include where the exhaust gas mixes with sea water in a mixing chamber.
My end goal is to create a model that can find the surface temperature, the internal temperature, and the internal pressure at any location of the exhaust system.
Can someone help with creating a basic model to start with?I want to create a simulation for marine exhaust systems for large vessels but I’m not sure how to set everything up.
I have values for temperature (from turbo), ambient temp (engine compartment), k values, h values, various exhaust pipe diameters, lengths, and thermal properties (stainless steel, aluminum, etc.).
Sections of the exhaust use a multilayer multi product insulation. I know the diameters at each layer, h and k values of the different layers, and thermal resistances of the layers.
Eventually, I want to include where the exhaust gas mixes with sea water in a mixing chamber.
My end goal is to create a model that can find the surface temperature, the internal temperature, and the internal pressure at any location of the exhaust system.
Can someone help with creating a basic model to start with? I want to create a simulation for marine exhaust systems for large vessels but I’m not sure how to set everything up.
I have values for temperature (from turbo), ambient temp (engine compartment), k values, h values, various exhaust pipe diameters, lengths, and thermal properties (stainless steel, aluminum, etc.).
Sections of the exhaust use a multilayer multi product insulation. I know the diameters at each layer, h and k values of the different layers, and thermal resistances of the layers.
Eventually, I want to include where the exhaust gas mixes with sea water in a mixing chamber.
My end goal is to create a model that can find the surface temperature, the internal temperature, and the internal pressure at any location of the exhaust system.
Can someone help with creating a basic model to start with? simscape, simulink, thermal fluids MATLAB Answers — New Questions
Changing my OS reduced maximum number of threads for parallel processing
I recently changed my OS system from Fedora to Ubuntu 24.04. On Fedora I could setup a thread-based parallel pool with 10 threads no problem (parpool(‘threads’, 10). When I try doing the same thing in Ubuntu, I get the following error:
‘A minimum pool size of 10 was requested. The maximum thread-based pool size is currently 2.’
I’ve tried a couple of things with no luck
maxNumCompThreads(10)
I checked nproc to make sure that Ubuntu recognizes all the CPU’s – it does
reinstalled the parallel computing toolbox
Varying the settings in cluster profile manager
Is there anything else I could try?I recently changed my OS system from Fedora to Ubuntu 24.04. On Fedora I could setup a thread-based parallel pool with 10 threads no problem (parpool(‘threads’, 10). When I try doing the same thing in Ubuntu, I get the following error:
‘A minimum pool size of 10 was requested. The maximum thread-based pool size is currently 2.’
I’ve tried a couple of things with no luck
maxNumCompThreads(10)
I checked nproc to make sure that Ubuntu recognizes all the CPU’s – it does
reinstalled the parallel computing toolbox
Varying the settings in cluster profile manager
Is there anything else I could try? I recently changed my OS system from Fedora to Ubuntu 24.04. On Fedora I could setup a thread-based parallel pool with 10 threads no problem (parpool(‘threads’, 10). When I try doing the same thing in Ubuntu, I get the following error:
‘A minimum pool size of 10 was requested. The maximum thread-based pool size is currently 2.’
I’ve tried a couple of things with no luck
maxNumCompThreads(10)
I checked nproc to make sure that Ubuntu recognizes all the CPU’s – it does
reinstalled the parallel computing toolbox
Varying the settings in cluster profile manager
Is there anything else I could try? parallel computing, ubuntu, parfor, linux MATLAB Answers — New Questions
Number of bits per symbol (m) range in Reed-Solomon coding
I’m playing around with Reed-Solomon codes. In the parameters of rsenc, help shows m represents the "number of bits per symbol" and has the range of "3 to 16".
The way I understood on m is that it has minimum three bits per symbol, i.e., 000, 001, 010, …, 111. Am I correct? What if I need to use two bits or one bit per symbol? What am I supposed to do if I want to construct a message with length of 20 (as an example) and each symbol has bit (i.e., 0 or 1)?I’m playing around with Reed-Solomon codes. In the parameters of rsenc, help shows m represents the "number of bits per symbol" and has the range of "3 to 16".
The way I understood on m is that it has minimum three bits per symbol, i.e., 000, 001, 010, …, 111. Am I correct? What if I need to use two bits or one bit per symbol? What am I supposed to do if I want to construct a message with length of 20 (as an example) and each symbol has bit (i.e., 0 or 1)? I’m playing around with Reed-Solomon codes. In the parameters of rsenc, help shows m represents the "number of bits per symbol" and has the range of "3 to 16".
The way I understood on m is that it has minimum three bits per symbol, i.e., 000, 001, 010, …, 111. Am I correct? What if I need to use two bits or one bit per symbol? What am I supposed to do if I want to construct a message with length of 20 (as an example) and each symbol has bit (i.e., 0 or 1)? rsenc, reed-solomon MATLAB Answers — New Questions
Fill below the 3D terrain data
A=imread(‘appRasterNEDAPIService1708354512850-756880040.tif’);
X=1:324;
Y=1:194;
[X,Y]=meshgrid(X,Y);
surf(X,Y,A)
Hello. I have this terrain data. The size of A matrix is 194×324 and contain elevation data. I want to fill below the terrain from the elevation of the data to the 0 (mean sea level). I use fill code
hFill = fill3(X, Y, A, patchColor, ‘LineWidth’, 1, ‘EdgeColor’, patchColor, …
‘FaceAlpha’, 0.5);
However, it only fill below the surface with thin layer. I try to fill from the elevation to the 0 (mean sea level).
Thank you,A=imread(‘appRasterNEDAPIService1708354512850-756880040.tif’);
X=1:324;
Y=1:194;
[X,Y]=meshgrid(X,Y);
surf(X,Y,A)
Hello. I have this terrain data. The size of A matrix is 194×324 and contain elevation data. I want to fill below the terrain from the elevation of the data to the 0 (mean sea level). I use fill code
hFill = fill3(X, Y, A, patchColor, ‘LineWidth’, 1, ‘EdgeColor’, patchColor, …
‘FaceAlpha’, 0.5);
However, it only fill below the surface with thin layer. I try to fill from the elevation to the 0 (mean sea level).
Thank you, A=imread(‘appRasterNEDAPIService1708354512850-756880040.tif’);
X=1:324;
Y=1:194;
[X,Y]=meshgrid(X,Y);
surf(X,Y,A)
Hello. I have this terrain data. The size of A matrix is 194×324 and contain elevation data. I want to fill below the terrain from the elevation of the data to the 0 (mean sea level). I use fill code
hFill = fill3(X, Y, A, patchColor, ‘LineWidth’, 1, ‘EdgeColor’, patchColor, …
‘FaceAlpha’, 0.5);
However, it only fill below the surface with thin layer. I try to fill from the elevation to the 0 (mean sea level).
Thank you, image processing MATLAB Answers — New Questions
How can I upgrade my MATLAB Parallel Server cluster to the new version?
I would like to install the new version of MATLAB Parallel Server on my cluster. How can I do this?I would like to install the new version of MATLAB Parallel Server on my cluster. How can I do this? I would like to install the new version of MATLAB Parallel Server on my cluster. How can I do this? MATLAB Answers — New Questions
Use a single variable name/label with the dot notation, to get access to a table content
Hi, I have a table called "mydata"
>> class(mydata)
ans = ‘table’
from which I usually retreive data (stored in its columns) throught the following dot notation command:
mydata.BLUE
mydata.GREEN
mydata.WHITE
…
This time, I would like to use a single "table variable name/label" which contains all the "columns names"
label = {‘BLUE’,’GREEN’,’WHITE’}
in order to get access to all the data I need. Something like this, that obviously does not work:
for i = 1 : 3
mydata.label(i)
end
Any suggestion?
P.S.: I am not sure if I used the correct matlab terminology to explain my question and for the corresponding title. If both title and question are not clear, I will change them.Hi, I have a table called "mydata"
>> class(mydata)
ans = ‘table’
from which I usually retreive data (stored in its columns) throught the following dot notation command:
mydata.BLUE
mydata.GREEN
mydata.WHITE
…
This time, I would like to use a single "table variable name/label" which contains all the "columns names"
label = {‘BLUE’,’GREEN’,’WHITE’}
in order to get access to all the data I need. Something like this, that obviously does not work:
for i = 1 : 3
mydata.label(i)
end
Any suggestion?
P.S.: I am not sure if I used the correct matlab terminology to explain my question and for the corresponding title. If both title and question are not clear, I will change them. Hi, I have a table called "mydata"
>> class(mydata)
ans = ‘table’
from which I usually retreive data (stored in its columns) throught the following dot notation command:
mydata.BLUE
mydata.GREEN
mydata.WHITE
…
This time, I would like to use a single "table variable name/label" which contains all the "columns names"
label = {‘BLUE’,’GREEN’,’WHITE’}
in order to get access to all the data I need. Something like this, that obviously does not work:
for i = 1 : 3
mydata.label(i)
end
Any suggestion?
P.S.: I am not sure if I used the correct matlab terminology to explain my question and for the corresponding title. If both title and question are not clear, I will change them. dot notation, table MATLAB Answers — New Questions
Why did CD folder; give such a goofy error message when I just forgot ()
It works other places but suddenly I can change directory
K>> apploc
apploc =
‘C:UsersCPSLabDocumentsOdorChoiceDev’
K>> cd apploc
Error using cd
Unable to change current folder to ‘C:UsersCPSLabDocumentsOdorChoiceDevapploc’ (Name is
nonexistent or not a folder).
Why did it add the variable name to the value of the variable instead of just reminding me I forgot the parentheses
cd (apploc)It works other places but suddenly I can change directory
K>> apploc
apploc =
‘C:UsersCPSLabDocumentsOdorChoiceDev’
K>> cd apploc
Error using cd
Unable to change current folder to ‘C:UsersCPSLabDocumentsOdorChoiceDevapploc’ (Name is
nonexistent or not a folder).
Why did it add the variable name to the value of the variable instead of just reminding me I forgot the parentheses
cd (apploc) It works other places but suddenly I can change directory
K>> apploc
apploc =
‘C:UsersCPSLabDocumentsOdorChoiceDev’
K>> cd apploc
Error using cd
Unable to change current folder to ‘C:UsersCPSLabDocumentsOdorChoiceDevapploc’ (Name is
nonexistent or not a folder).
Why did it add the variable name to the value of the variable instead of just reminding me I forgot the parentheses
cd (apploc) cd fail MATLAB Answers — New Questions
Converting result after substituting numerical values into symbolic expression not possible. Matlab creates new symbolic variables by complex symbolic expression.
I have 22 symbolic variables, which I create different subexpressions with. Then I mathematically combine all these subexpression in one big expression according to the calculation I have to perform. I do these steps to keep some readability. However, matlab automatically creates new variables in the final expression, whereby they are named sigmas. When I then substitute numerical values into the symbolic variables, I get a complex result, which I can convert into a double precision number. However, I need to compute the derivative first and then substitute numerical values and at that point I get the error that it is not possible to convert them because symbolic variabls remains in the expression. I suppose that’s because of the new sigma variables. I tried vpa(), double(), simplify() but I do not get it solved. Does someone have an idea how I could handle that ? You can see that the derivative result is displayed with a D if you open the result and not sigma can be seen like it is displayed in the script.
syms T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC
syms R1508 R1511 ADC2ADC_GainError ADC2ADC_OffsetError ADC2ADC_Isolation
%% Resistor network TEMP_DCB
R_NTC = NTC_R.*exp(NTC_B2585*(1./(T_NTC)-1/298.15));
Rs_TEMP_DCB = R1509 + 1./(1./R1510+1./R_NTC+1./R1507);
TEMP_DCB = S3V3S_A.*(R_NTC.*R1510./(R_NTC+R1510))./(R_NTC.*R1510./(R_NTC+R1510)+R1507) + (Rs_TEMP_DCB+Ron).*LeakageCurrent;
ADC_error_TEMP_DCB = GainError.*TEMP_DCB./VOLT_REF_3V + OffsetError + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
TEMP_DCB_ADCRawValue = round(TEMP_DCB.*2^ResolutionADC./VOLT_REF_3V + ADC_error_TEMP_DCB);
%% Resistor network 3V3S_A
Rs_VOLT_3V3S_A = R1508.*R1511./(R1508+R1511);
VOLT_3V3S_A = S3V3S_A.*R1511./(R1511+R1508) + (Rs_VOLT_3V3S_A+Ron).*LeakageCurrent;
ADC_error_3V3S_A = (GainError+ADC2ADC_GainError).*VOLT_3V3S_A./VOLT_REF_3V + OffsetError + ADC2ADC_OffsetError + ADC2ADC_Isolation + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
VOLT_3V3S_A_ADCRawValue = round(VOLT_3V3S_A.*2^ResolutionADC./VOLT_REF_3V + ADC_error_3V3S_A);
%% Ratio TEMP_DCB/VOLT_3V3S_A
y = TEMP_DCB_ADCRawValue./VOLT_3V3S_A_ADCRawValue
%% Derivatives
dy_dNTC_R = diff(y, NTC_R);
dy_dNTC_B2585 = diff(y, NTC_B2585);
dy_dR1509 = diff(y, R1509);
dy_dR1510 = diff(y, R1510);
dy_dR1507 = diff(y, R1507);
dy_dS3V3S_A = diff(y, S3V3S_A);
dy_dRon = diff(y, Ron);
dy_dLeakageCurrent = diff(y, LeakageCurrent);
dy_dGainError = diff(y, GainError);
dy_dVOLT_REF_3V = diff(y, VOLT_REF_3V);
dy_dOffsetError = diff(y, OffsetError);
dy_dINLError = diff(y, INLError);
dy_dDNLError = diff(y, DNLError);
dy_dS3V3S_A_Ripple = diff(y, S3V3S_A_Ripple);
dy_dPSRR = diff(y, PSRR);
dy_dResolutionADC = diff(y, ResolutionADC);
dy_dR1508 = diff(y, R1508);
dy_dR1511 = diff(y, R1511);
dy_dADC2ADC_GainError = diff(y, ADC2ADC_GainError);
dy_dADC2ADC_OffsetError = diff(y, ADC2ADC_OffsetError);
dy_dADC2ADC_Isolation = diff(y, ADC2ADC_Isolation);
%% Define working points
% Define your working point values
T_NTC_wp1 = 130 + 273.15;
NTC_R_wp1 = 5e3;
NTC_B2585_wp1 = 3420;
R1509_wp1 = 1e3;
R1510_wp1 = 20e3;
R1507_wp1 = 2e3;
S3V3S_A_wp1 = 3.33;
Ron_wp1 = 500;
LeakageCurrent_wp1 = 0;
GainError_wp1 = 0;
OffsetError_wp1 = 0;
VOLT_REF_3V_wp1 = 3;
INLError_wp1 = 0;
DNLError_wp1 = 0;
S3V3S_A_Ripple_wp1 = 10e-3;
PSRR_wp1 = 57;
ResolutionADC_wp1 = 12;
R1508_wp1 = 1e3;
R1511_wp1 = 1e3;
ADC2ADC_GainError_wp1 = 0;
ADC2ADC_OffsetError_wp1 = 0;
ADC2ADC_Isolation_wp1 = 0;
%% Combine working points into a vector
WP1 = [T_NTC_wp1 NTC_R_wp1 NTC_B2585_wp1 R1509_wp1 R1510_wp1 R1507_wp1 S3V3S_A_wp1 Ron_wp1 …
LeakageCurrent_wp1 GainError_wp1 OffsetError_wp1 VOLT_REF_3V_wp1 INLError_wp1 …
DNLError_wp1 S3V3S_A_Ripple_wp1 PSRR_wp1 ResolutionADC_wp1 R1508_wp1 R1511_wp1 …
ADC2ADC_GainError_wp1 ADC2ADC_OffsetError_wp1 ADC2ADC_Isolation_wp1];
%% Calculate sensitivity
symbols = [T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError …
VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC R1508 R1511 ADC2ADC_GainError …
ADC2ADC_OffsetError ADC2ADC_Isolation];
S_NTC_R_wp1 = (subs(dy_dNTC_R, symbols, WP1) * NTC_R_wp1) / subs(y, symbols, WP1)
% S_NTC_R_wp1_num = double(S_NTC_R_wp1);
S_NTC_R_wp1_num = vpa(S_NTC_R_wp1);I have 22 symbolic variables, which I create different subexpressions with. Then I mathematically combine all these subexpression in one big expression according to the calculation I have to perform. I do these steps to keep some readability. However, matlab automatically creates new variables in the final expression, whereby they are named sigmas. When I then substitute numerical values into the symbolic variables, I get a complex result, which I can convert into a double precision number. However, I need to compute the derivative first and then substitute numerical values and at that point I get the error that it is not possible to convert them because symbolic variabls remains in the expression. I suppose that’s because of the new sigma variables. I tried vpa(), double(), simplify() but I do not get it solved. Does someone have an idea how I could handle that ? You can see that the derivative result is displayed with a D if you open the result and not sigma can be seen like it is displayed in the script.
syms T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC
syms R1508 R1511 ADC2ADC_GainError ADC2ADC_OffsetError ADC2ADC_Isolation
%% Resistor network TEMP_DCB
R_NTC = NTC_R.*exp(NTC_B2585*(1./(T_NTC)-1/298.15));
Rs_TEMP_DCB = R1509 + 1./(1./R1510+1./R_NTC+1./R1507);
TEMP_DCB = S3V3S_A.*(R_NTC.*R1510./(R_NTC+R1510))./(R_NTC.*R1510./(R_NTC+R1510)+R1507) + (Rs_TEMP_DCB+Ron).*LeakageCurrent;
ADC_error_TEMP_DCB = GainError.*TEMP_DCB./VOLT_REF_3V + OffsetError + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
TEMP_DCB_ADCRawValue = round(TEMP_DCB.*2^ResolutionADC./VOLT_REF_3V + ADC_error_TEMP_DCB);
%% Resistor network 3V3S_A
Rs_VOLT_3V3S_A = R1508.*R1511./(R1508+R1511);
VOLT_3V3S_A = S3V3S_A.*R1511./(R1511+R1508) + (Rs_VOLT_3V3S_A+Ron).*LeakageCurrent;
ADC_error_3V3S_A = (GainError+ADC2ADC_GainError).*VOLT_3V3S_A./VOLT_REF_3V + OffsetError + ADC2ADC_OffsetError + ADC2ADC_Isolation + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
VOLT_3V3S_A_ADCRawValue = round(VOLT_3V3S_A.*2^ResolutionADC./VOLT_REF_3V + ADC_error_3V3S_A);
%% Ratio TEMP_DCB/VOLT_3V3S_A
y = TEMP_DCB_ADCRawValue./VOLT_3V3S_A_ADCRawValue
%% Derivatives
dy_dNTC_R = diff(y, NTC_R);
dy_dNTC_B2585 = diff(y, NTC_B2585);
dy_dR1509 = diff(y, R1509);
dy_dR1510 = diff(y, R1510);
dy_dR1507 = diff(y, R1507);
dy_dS3V3S_A = diff(y, S3V3S_A);
dy_dRon = diff(y, Ron);
dy_dLeakageCurrent = diff(y, LeakageCurrent);
dy_dGainError = diff(y, GainError);
dy_dVOLT_REF_3V = diff(y, VOLT_REF_3V);
dy_dOffsetError = diff(y, OffsetError);
dy_dINLError = diff(y, INLError);
dy_dDNLError = diff(y, DNLError);
dy_dS3V3S_A_Ripple = diff(y, S3V3S_A_Ripple);
dy_dPSRR = diff(y, PSRR);
dy_dResolutionADC = diff(y, ResolutionADC);
dy_dR1508 = diff(y, R1508);
dy_dR1511 = diff(y, R1511);
dy_dADC2ADC_GainError = diff(y, ADC2ADC_GainError);
dy_dADC2ADC_OffsetError = diff(y, ADC2ADC_OffsetError);
dy_dADC2ADC_Isolation = diff(y, ADC2ADC_Isolation);
%% Define working points
% Define your working point values
T_NTC_wp1 = 130 + 273.15;
NTC_R_wp1 = 5e3;
NTC_B2585_wp1 = 3420;
R1509_wp1 = 1e3;
R1510_wp1 = 20e3;
R1507_wp1 = 2e3;
S3V3S_A_wp1 = 3.33;
Ron_wp1 = 500;
LeakageCurrent_wp1 = 0;
GainError_wp1 = 0;
OffsetError_wp1 = 0;
VOLT_REF_3V_wp1 = 3;
INLError_wp1 = 0;
DNLError_wp1 = 0;
S3V3S_A_Ripple_wp1 = 10e-3;
PSRR_wp1 = 57;
ResolutionADC_wp1 = 12;
R1508_wp1 = 1e3;
R1511_wp1 = 1e3;
ADC2ADC_GainError_wp1 = 0;
ADC2ADC_OffsetError_wp1 = 0;
ADC2ADC_Isolation_wp1 = 0;
%% Combine working points into a vector
WP1 = [T_NTC_wp1 NTC_R_wp1 NTC_B2585_wp1 R1509_wp1 R1510_wp1 R1507_wp1 S3V3S_A_wp1 Ron_wp1 …
LeakageCurrent_wp1 GainError_wp1 OffsetError_wp1 VOLT_REF_3V_wp1 INLError_wp1 …
DNLError_wp1 S3V3S_A_Ripple_wp1 PSRR_wp1 ResolutionADC_wp1 R1508_wp1 R1511_wp1 …
ADC2ADC_GainError_wp1 ADC2ADC_OffsetError_wp1 ADC2ADC_Isolation_wp1];
%% Calculate sensitivity
symbols = [T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError …
VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC R1508 R1511 ADC2ADC_GainError …
ADC2ADC_OffsetError ADC2ADC_Isolation];
S_NTC_R_wp1 = (subs(dy_dNTC_R, symbols, WP1) * NTC_R_wp1) / subs(y, symbols, WP1)
% S_NTC_R_wp1_num = double(S_NTC_R_wp1);
S_NTC_R_wp1_num = vpa(S_NTC_R_wp1); I have 22 symbolic variables, which I create different subexpressions with. Then I mathematically combine all these subexpression in one big expression according to the calculation I have to perform. I do these steps to keep some readability. However, matlab automatically creates new variables in the final expression, whereby they are named sigmas. When I then substitute numerical values into the symbolic variables, I get a complex result, which I can convert into a double precision number. However, I need to compute the derivative first and then substitute numerical values and at that point I get the error that it is not possible to convert them because symbolic variabls remains in the expression. I suppose that’s because of the new sigma variables. I tried vpa(), double(), simplify() but I do not get it solved. Does someone have an idea how I could handle that ? You can see that the derivative result is displayed with a D if you open the result and not sigma can be seen like it is displayed in the script.
syms T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC
syms R1508 R1511 ADC2ADC_GainError ADC2ADC_OffsetError ADC2ADC_Isolation
%% Resistor network TEMP_DCB
R_NTC = NTC_R.*exp(NTC_B2585*(1./(T_NTC)-1/298.15));
Rs_TEMP_DCB = R1509 + 1./(1./R1510+1./R_NTC+1./R1507);
TEMP_DCB = S3V3S_A.*(R_NTC.*R1510./(R_NTC+R1510))./(R_NTC.*R1510./(R_NTC+R1510)+R1507) + (Rs_TEMP_DCB+Ron).*LeakageCurrent;
ADC_error_TEMP_DCB = GainError.*TEMP_DCB./VOLT_REF_3V + OffsetError + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
TEMP_DCB_ADCRawValue = round(TEMP_DCB.*2^ResolutionADC./VOLT_REF_3V + ADC_error_TEMP_DCB);
%% Resistor network 3V3S_A
Rs_VOLT_3V3S_A = R1508.*R1511./(R1508+R1511);
VOLT_3V3S_A = S3V3S_A.*R1511./(R1511+R1508) + (Rs_VOLT_3V3S_A+Ron).*LeakageCurrent;
ADC_error_3V3S_A = (GainError+ADC2ADC_GainError).*VOLT_3V3S_A./VOLT_REF_3V + OffsetError + ADC2ADC_OffsetError + ADC2ADC_Isolation + INLError + DNLError + S3V3S_A_Ripple*10.^(-PSRR/20).*2.^ResolutionADC./VOLT_REF_3V;
VOLT_3V3S_A_ADCRawValue = round(VOLT_3V3S_A.*2^ResolutionADC./VOLT_REF_3V + ADC_error_3V3S_A);
%% Ratio TEMP_DCB/VOLT_3V3S_A
y = TEMP_DCB_ADCRawValue./VOLT_3V3S_A_ADCRawValue
%% Derivatives
dy_dNTC_R = diff(y, NTC_R);
dy_dNTC_B2585 = diff(y, NTC_B2585);
dy_dR1509 = diff(y, R1509);
dy_dR1510 = diff(y, R1510);
dy_dR1507 = diff(y, R1507);
dy_dS3V3S_A = diff(y, S3V3S_A);
dy_dRon = diff(y, Ron);
dy_dLeakageCurrent = diff(y, LeakageCurrent);
dy_dGainError = diff(y, GainError);
dy_dVOLT_REF_3V = diff(y, VOLT_REF_3V);
dy_dOffsetError = diff(y, OffsetError);
dy_dINLError = diff(y, INLError);
dy_dDNLError = diff(y, DNLError);
dy_dS3V3S_A_Ripple = diff(y, S3V3S_A_Ripple);
dy_dPSRR = diff(y, PSRR);
dy_dResolutionADC = diff(y, ResolutionADC);
dy_dR1508 = diff(y, R1508);
dy_dR1511 = diff(y, R1511);
dy_dADC2ADC_GainError = diff(y, ADC2ADC_GainError);
dy_dADC2ADC_OffsetError = diff(y, ADC2ADC_OffsetError);
dy_dADC2ADC_Isolation = diff(y, ADC2ADC_Isolation);
%% Define working points
% Define your working point values
T_NTC_wp1 = 130 + 273.15;
NTC_R_wp1 = 5e3;
NTC_B2585_wp1 = 3420;
R1509_wp1 = 1e3;
R1510_wp1 = 20e3;
R1507_wp1 = 2e3;
S3V3S_A_wp1 = 3.33;
Ron_wp1 = 500;
LeakageCurrent_wp1 = 0;
GainError_wp1 = 0;
OffsetError_wp1 = 0;
VOLT_REF_3V_wp1 = 3;
INLError_wp1 = 0;
DNLError_wp1 = 0;
S3V3S_A_Ripple_wp1 = 10e-3;
PSRR_wp1 = 57;
ResolutionADC_wp1 = 12;
R1508_wp1 = 1e3;
R1511_wp1 = 1e3;
ADC2ADC_GainError_wp1 = 0;
ADC2ADC_OffsetError_wp1 = 0;
ADC2ADC_Isolation_wp1 = 0;
%% Combine working points into a vector
WP1 = [T_NTC_wp1 NTC_R_wp1 NTC_B2585_wp1 R1509_wp1 R1510_wp1 R1507_wp1 S3V3S_A_wp1 Ron_wp1 …
LeakageCurrent_wp1 GainError_wp1 OffsetError_wp1 VOLT_REF_3V_wp1 INLError_wp1 …
DNLError_wp1 S3V3S_A_Ripple_wp1 PSRR_wp1 ResolutionADC_wp1 R1508_wp1 R1511_wp1 …
ADC2ADC_GainError_wp1 ADC2ADC_OffsetError_wp1 ADC2ADC_Isolation_wp1];
%% Calculate sensitivity
symbols = [T_NTC NTC_R NTC_B2585 R1509 R1510 R1507 S3V3S_A Ron LeakageCurrent GainError OffsetError …
VOLT_REF_3V INLError DNLError S3V3S_A_Ripple PSRR ResolutionADC R1508 R1511 ADC2ADC_GainError …
ADC2ADC_OffsetError ADC2ADC_Isolation];
S_NTC_R_wp1 = (subs(dy_dNTC_R, symbols, WP1) * NTC_R_wp1) / subs(y, symbols, WP1)
% S_NTC_R_wp1_num = double(S_NTC_R_wp1);
S_NTC_R_wp1_num = vpa(S_NTC_R_wp1); symbolic, matlab, convert, function, variables MATLAB Answers — New Questions
Simulating a high performance, very compact optical distance measurement sensors for applications such as ADAS
I was reading on innovative techniques to help implement a Vehicle-to-Pedestrian system when I came across this article "https://ieeexplore.ieee.org/document/7131685". Upon reeading, I intend to start with the MATLAB simulation. Does mathworks provide such a functionality of simulating a ladar that is edge emitting, and having 905nm, single stripe laser technology? I look forward to hearing from you.I was reading on innovative techniques to help implement a Vehicle-to-Pedestrian system when I came across this article "https://ieeexplore.ieee.org/document/7131685". Upon reeading, I intend to start with the MATLAB simulation. Does mathworks provide such a functionality of simulating a ladar that is edge emitting, and having 905nm, single stripe laser technology? I look forward to hearing from you. I was reading on innovative techniques to help implement a Vehicle-to-Pedestrian system when I came across this article "https://ieeexplore.ieee.org/document/7131685". Upon reeading, I intend to start with the MATLAB simulation. Does mathworks provide such a functionality of simulating a ladar that is edge emitting, and having 905nm, single stripe laser technology? I look forward to hearing from you. lidar, sensor, its, v2x MATLAB Answers — New Questions
Why are the lines not showing up on my graph?
I need to show two separate lines on the same figure, one for dcs and one for d2p, using the values provided by each iteration of the for loop. I’m not sure what I’m doing wrong here. Thanks in advance! Here is my code:
N = [10 90 1000]; % number of peers
F = 20 * 1024; % converting Gbits to Mbits
us = 30; % server upload
di = 2; % client download
u = 300/1024; % client upload
dcs = zeros(size(N));
dp2 = zeros(size(N));
figure();
grid
hold on;
for i = 1:1:length(N)
Nval = N(i);
cs1 = Nval*F/us;
cs2 = F/di;
dcs = max(cs1,cs2);
p21 = F/us;
ui = u*Nval;
p23 = Nval*F/(us+ui);
dp2 = max([p21(:); cs2(:); p23(:)]);
plot(dcs, Nval);
plot(dp2, Nval);
title(‘Distribution Time’)
end
ylabel(‘Minimum Distribution Time’)
xlabel(‘N’)I need to show two separate lines on the same figure, one for dcs and one for d2p, using the values provided by each iteration of the for loop. I’m not sure what I’m doing wrong here. Thanks in advance! Here is my code:
N = [10 90 1000]; % number of peers
F = 20 * 1024; % converting Gbits to Mbits
us = 30; % server upload
di = 2; % client download
u = 300/1024; % client upload
dcs = zeros(size(N));
dp2 = zeros(size(N));
figure();
grid
hold on;
for i = 1:1:length(N)
Nval = N(i);
cs1 = Nval*F/us;
cs2 = F/di;
dcs = max(cs1,cs2);
p21 = F/us;
ui = u*Nval;
p23 = Nval*F/(us+ui);
dp2 = max([p21(:); cs2(:); p23(:)]);
plot(dcs, Nval);
plot(dp2, Nval);
title(‘Distribution Time’)
end
ylabel(‘Minimum Distribution Time’)
xlabel(‘N’) I need to show two separate lines on the same figure, one for dcs and one for d2p, using the values provided by each iteration of the for loop. I’m not sure what I’m doing wrong here. Thanks in advance! Here is my code:
N = [10 90 1000]; % number of peers
F = 20 * 1024; % converting Gbits to Mbits
us = 30; % server upload
di = 2; % client download
u = 300/1024; % client upload
dcs = zeros(size(N));
dp2 = zeros(size(N));
figure();
grid
hold on;
for i = 1:1:length(N)
Nval = N(i);
cs1 = Nval*F/us;
cs2 = F/di;
dcs = max(cs1,cs2);
p21 = F/us;
ui = u*Nval;
p23 = Nval*F/(us+ui);
dp2 = max([p21(:); cs2(:); p23(:)]);
plot(dcs, Nval);
plot(dp2, Nval);
title(‘Distribution Time’)
end
ylabel(‘Minimum Distribution Time’)
xlabel(‘N’) graph, for loop, max MATLAB Answers — New Questions