https://jp.mathworks.com/matlabcentral/answers/questionsMATLAB Answers — 新規の質問2021-03-03T16:03:37Ztag:jp.mathworks.com,2005:Question/7618412021-03-03T16:03:37Z2021-03-03T16:03:37ZLoad pretrained model in Matlab: semanticseg(frame, net)Dear community,
I am exploring image semantic segmentation based on model ResNet-101 in Matlab R2020b:
netStruct = load('imagenet-resnet-101-dag.mat'); https://drive.google.com/drive/folders/1Y0s5la0HvEhpNqfKGdJTwNTHzIjKt0VT
C = semanticseg(frame, net);
B = labeloverlay(frame,C);
However, function semanticseg expects net as structure DAGNetwork, while after load netStruct is [layers, params, vars, meta]. Please, can anyone has solution?
Thank you!Janko Vukotichttps://jp.mathworks.com/matlabcentral/profile/authors/21475454tag:jp.mathworks.com,2005:Question/7617112021-03-03T14:46:28Z2021-03-03T16:03:24Zreadtable, excel, date baseHow can I tell readtable what the appropriate excel base date is?Brucehttps://jp.mathworks.com/matlabcentral/profile/authors/217173tag:jp.mathworks.com,2005:Question/7584542021-02-28T10:15:12Z2021-03-03T16:01:46ZA question about MATLAB library "vibration of rotary machinery"My question is about vibration of rotary machinery:
https://au.mathworks.com/help/signal/ug/vibration-analysis-of-rotating-machinery.html
The author claims the wavforms correponding to input shaft, output shaft, and gear mesh measured by sensors can be reported as:
vfIn = 0.4*sin(2*pi*fPin*t); % Pinion waveform
vfOut = 0.2*sin(2*pi*fGear*t); % Gear waveform
vMesh = sin(2*pi*fMesh*t); % Gear-mesh waveform
A1 sensor can measure vfOut.
A2 sensor can measure vMesh.
But how can you measure vfIn?
Si Sohttps://jp.mathworks.com/matlabcentral/profile/authors/20792574tag:jp.mathworks.com,2005:Question/7613462021-03-03T08:39:21Z2021-03-03T16:00:55Zcontinue and return in a loopHi,
See my script below. I added in this script what I exactly want.
So if a value is what i want it is, go out of the loop and continue the script.
How can I fix this?
fullfilename = fullfile(RCA(30).folder, RCA(30).name);
for k = 1:length(RCA)
fullfilename = fullfile(RCA(k).folder, RCA(k).name);
thisData = readmatrix(fullfilename, 'Range', 2, 'Delimiter', ',');
%% Run ICP (standard settings)
for i = 2:100
[Ricp Ticp ER weight] = icp(M, D, i);
% Transform data-matrix using ICP result
Dicp = Ricp * D + repmat(Ticp, 1, n);
set(0, 'CurrentFigure', f1)
ER1 = ER(end-1) - ER(end)
end
%% this is the point where i need to add something:
%% If ER1 < 0.005 it has to continue outside the i loop.
%% So if ER < 0.005 continue at plot3(D..... otherwise continue for i = 3 and so on.
plot3(D(1,:),D(2,:),D(3,:),'bo',M(1,:),M(2,:),M(3,:),'-');
hold on
xlim([-40 70]);
ylim([-50 50]);
zlim([-90 10]);
ER2(k,1)=ER(end);
ER2(k,2) = ER(end-1)-ER(end);Dion Theunissenhttps://jp.mathworks.com/matlabcentral/profile/authors/12198422tag:jp.mathworks.com,2005:Question/7485622021-02-17T23:36:59Z2021-03-03T15:58:42ZCant ignore errors anymoreI used to have an options with right mouse click to ignore any errors in the editor, but it no longer apears. What happened to it? This is worse than irritating as it makes it difficult to see if the file contains errors. For example, when appending a table with a cell of strings the editor gives an error saying that I should be using square braces. I now have to continuously go through every error to see if it is something that should be ignored or not.Matthew Parryhttps://jp.mathworks.com/matlabcentral/profile/authors/8865413tag:jp.mathworks.com,2005:Question/7618362021-03-03T15:58:34Z2021-03-03T15:58:34ZIndex exceeds the number of array elements (53).filename = 'Test1.xlsx';
sheet=1;
cell_location = 'A2:A72';
Time = xlsread('Test1.xlsx', sheet, cell_location);
cell_location2 = 'E2:E72';
Altitude = xlsread('Test1.xlsx', sheet, cell_location2);
plot(Time, Altitude);
grid on;
dbstop if error
title('A graph to show the variation of Altitude across Time');
xlabel('Time');
ylabel('Altitude');
I am trying to add title along with x and y labels onto my graph. Why does it have issues with arrays when adding that?Rajarshi Dasguptahttps://jp.mathworks.com/matlabcentral/profile/authors/14446907tag:jp.mathworks.com,2005:Question/3144382016-11-28T05:00:00Z2021-03-03T15:58:28ZWhy am I prompted for an Activation Key during installation or activation?Why am I prompted for an Activation Key during installation or activation?MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7618312021-02-17T05:00:00Z2021-03-03T15:57:55ZAuto-populate Thermal Liquid Properties Block with REFPROP TablesI have a thermal liquid system built in Simscape Fluids with a "Thermal Liquid Settings" block connected. I have access to REFPROP tables from NIST, but it does not seem as if I can populate the "Thermal Liquid Settings" parameters with the REFPROP tables. However, this is possible for the "Two-Phase Fluids Properties" block using the "twoPhaseFluidTables" function.
Is there a good way to populate the "Thermal Liquid Settings" block with REFPROP tables?MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7614212021-03-03T09:47:58Z2021-03-03T15:56:16ZHow to change LineWidth and MarkerSize in plot fit curve ?I am using this code in order to plot my data.
The problem is that I can not change the size and the linewidth of my plot.
I used this
filename='final.txt'
d1= importdata(filename);
x=d1.data(:,1)
y=d1.data(:,2)
f=fit(x,y,'poly1')
plot(f,'r--',x,y,'b^','MarkerSize',10);
But no use. The problem is in command
plot(f,'r--',x,y,'b^','MarkerSize',10);
Command window shows
Error in test_trendline (line 17)
plot(f,'r--',Distance,IMM,'b^','MarkerSize',10);
Could you please help me?Ivan Michhttps://jp.mathworks.com/matlabcentral/profile/authors/15708342tag:jp.mathworks.com,2005:Question/7613212021-03-03T08:15:55Z2021-03-03T15:55:08ZSwitching between open files in editor by searchingI know this has been asked before, but among the questions I found, no one mentioned the already implemented search which is the closest match.
I want to quickly switch to an open file in the matlab editor by starting to type the name of the file, e.g. "myFu" would suggest "myFunction.m" and any other matching "myFu*". I find this functionality when the file "tab-bar" on top of the editor is full, and the dropdown menu for selecting files is displayed. This dropdown menu has the search functionality that I am looking for (see attached imaged). I find this search only available when the file-tab bar is full. This is ok as the need for a search is often related to many simultaneously open files. My question is:
Is there a action for this search which i can bind with a shortcut?
(I am familiar with the "Find files" functionality and "Ctrl + Page Up/Down". I am currently on windows and running R2020b Update 5)Tord Fjordheim Onsteinhttps://jp.mathworks.com/matlabcentral/profile/authors/21402424tag:jp.mathworks.com,2005:Question/7553242021-02-24T21:15:57Z2021-03-03T15:53:56ZCreate and fill cell array with differntly sized arrays within a function Hi,
I wanted to write a function because because I need to extract blocks within a range from continous data. Thereby each block has a different length e.g. 1x20. First I implmented it as following
complete_block = cell(numel(x),1);
for i = 1:numel(start)
startInx = start(i);
endInx = ending(i);
complete_block{i} = data(start:ending);
end
Because I need to repeat this many times I wanted to outsource it to a function 'splitBlocks'
function cellArrayOfBlocks = splitBlocksEEG(data)
end
max = int8((numel( evalin('base', 'x'))))
start = evalin('base', 'start'); % size 240x1
ending = evalin('base', 'ending'); % get variable from current workspace
cellArrayOfBlocks = cell(max,1);
for i = 1:numel(start)
startInx = int8(start(i)); % is type double, cast to integer
endInx = int8(ending(i));
cellArrayOfBlocks{i} = data(startInx:endInx);
end
However I won't get the 240x1 cell array containing 1xN data. I tried to use cellmat to implement the cell array but I was not successfull. I thought that the error could be that the data is not an integer but that didn't solve the problem neither. Why is the mode of operation different within a function? Why can't I just write the same code in a function and get the same output?
I know that it is not a recommended structure to manage data, but I also do not know any better way.
Thank you for any advice in advance!Carina Uferhttps://jp.mathworks.com/matlabcentral/profile/authors/17757934tag:jp.mathworks.com,2005:Question/7614112021-03-03T09:38:08Z2021-03-03T15:53:27ZHow do i calculate for conditionsHi,
I am trying to calculate actual evapotranspiration(AE) from my data. the conditions and calculation are as follows:
if P - PET > 0
AE = PET
elseif P - PET < 0
AE = P - SMdiff
P, PET and SMdiff are all 12 x 1 double.
How do i compute this in matlab? Rahah Hadrihttps://jp.mathworks.com/matlabcentral/profile/authors/15309830tag:jp.mathworks.com,2005:Question/7615512021-03-03T12:16:16Z2021-03-03T15:53:01ZHow to calculate deviation between two trajectories based on the reported formula Hello,
I would like to calculate the trajectory volatility (TV) defined as the standard deviation between the real trajectory and the ideal trajectory.
The formula is the following:
where xi (i= 1,2,3...N, the order of point on the trajectory) is the actual measurement point sampled from the trajectory, and pi is the corresponding projection onto the ideal trajectory as shown in the pic
Both actual and ideal trajectories are 100x3 matrices of x,y and z coordinate.
Here a pic for a better understanding:
(purple one actual, green line ideal)
Do you have any suggestion on how to do calculate pi, so the projection on the ideal trajectory given xi?
Thanks! Elisa Iovenehttps://jp.mathworks.com/matlabcentral/profile/authors/10476606tag:jp.mathworks.com,2005:Question/7618262021-03-03T15:52:00Z2021-03-03T15:52:00ZInstalled Control Systems Toolbox, can't view or access any functionality, how do I find it?I have installed the add-on Control Systems Toolbox, and have used var to check that i have it installed and MATLAB up-to-date which is the case. However when i look in the Apps tab, and specificially in Simulink, I am unable to find any of the add-ons. (this is the case in base MATLAB too). Any help would be much appreciated.
Thanks. Joel Thomsonhttps://jp.mathworks.com/matlabcentral/profile/authors/20938675tag:jp.mathworks.com,2005:Question/7615362021-03-03T12:09:17Z2021-03-03T15:51:56ZHeat Map Cell values displayI noticed the cell values are displayed with arbitrary size and with 'normal' fontweight.
I wonder whether one can choose, the font, and fontweight for the diplayed values on each cell.Pappu Murthyhttps://jp.mathworks.com/matlabcentral/profile/authors/705603tag:jp.mathworks.com,2005:Question/7618212021-02-17T05:00:00Z2021-03-03T15:50:45ZSet starting position of a Uniform Circular ArrayHow can I control the element positions in a uniform circular array? I would like element #1 to be at the 3 o'clock position for example rather than at the default 9 o'clock position. The element positions can be seen using the command 'getElementPosition'.MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/950392013-08-06T20:31:00Z2021-03-03T15:49:20ZWhy does the SDK 7.1 installation fail with an "Installation Failed" message on my Windows system?I am working with MATLAB 7.14 (R2012a) 64-bit. I need to setup a compiler configuration for MATLAB on my system.
When I try to execute the following MATLAB command:
mex -setup
I receive the following error:
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2012a/win64.html
If I try to install Microsoft Windows SDK 7.1, a supported compiler for MATLAB 7.14 (R2012a), on my system, the installation fails with the following error message:
MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7618162021-03-03T15:48:00Z2021-03-03T15:48:00ZClassical orbital elements VectorsIf I would be given a R and a V vector and I would have to find orbital elements like... (a=semi-major axis)(eccentricity)(inclination)(right ascension of the ascending node)(argument of perigee)(true anomaly). After I defined the vectors and found the magnitudes I was trying to write out my equations but I guess matlab didn't like it. If you could look at my code and point me in the right direction I would appreciate it. I had quite a few of errors just to keep ending my functions over and over again?
First, solve for the angular momentum: h⃗ =r⃗ ×v⃗ h
The eccentricity vector is then: e⃗ =(v2−μ/r)r⃗ −(r⃗ ⋅v⃗ )v⃗
a=−μ/2E
i=cos−1hKhi = cos−1hKh
Ω=cos−1nInΩ = cos−1nIn
ω=cos−1n⃗ ⋅e⃗ neω = cos−1n→⋅e→ne
ν=cos−1e⃗ ⋅r⃗ er
R= [-7953.8073 - 4174.5370 - 1008.9496];
v= [3.6460035 - 4.9118820 - 4.9193608];
h=cross(R,v);
nhat=cross([0 0 1],h)
r=norm(R);
mu=3.986*10^5
energy = mag(v)^2/2-mu/mag(R)
e = mag(evec)
evec = ((mag(v)^2-mu/mag(R))*R-dot(R,v)*v)/mu
if abs(e-1.0)>eps
a = -mu/(2*energy)
p = a*(1-e^2)
else
p = mag(h)^2/mu
a = inf
end
i = acos(h(3)/mag(h))
Omega = acos(n(1)/mag(n))
if n(2)<0
Omega = 360-Omega
argp = acos(dot(n,evec)/(mag(n)*e))
end
if e(3)<0
argp = 360-argp
nu = acos(dot(evec,R)/(e*mag(R))
end
if dot(R,v)<0
nu = 360 - nu
endOskar Kinathttps://jp.mathworks.com/matlabcentral/profile/authors/19283967tag:jp.mathworks.com,2005:Question/7617262021-03-03T14:49:54Z2021-03-03T15:46:25ZTask: write matlab code for a class MinAngle which calculates the minimum angle between two bearings (bearing A and bearing B).The class shall store the two bearings as properties: angleA and angleB.
Both of these shall be stored as private properties.
The class shall implement a method InputA(angle, type) which sets the value of angleA.
The method shall have two input arguments: angle and type.
If type is ‘radians’ then the unit for angle is radians and the angle shall be stored in angleA.
If type is ‘degrees’ then the unit for angle is degrees and the angle shall be stored in angleA.
If type is any other value then an error should be given with the message ‘ERROR1’.
This is what I have so far:
classdef MinAngle < handle
properties (SetAccess = private)
angleA;
angleB;
end
methods
function InputA(obj,angle,type)
if (type = 'radians')
if(angle > 2*pi || angle < 0)
error('angle not within range')
end
angledeg = rad2deg(angle);
obj.angleA = angledeg;
elseif(type = 'degrees')
if(angle > 360 || angle < 0)
error('angle not within range')
end
obj.angleA = angle;
end
end
end
Need help after this as I am stuck.
Shikhar Singhhttps://jp.mathworks.com/matlabcentral/profile/authors/16408379tag:jp.mathworks.com,2005:Question/7617912021-03-03T15:28:34Z2021-03-03T15:44:08ZDir function with no file extensionDear communtiy.
I am using a script with the dir function as shown below but my question is I do not know what the data type of my file is. It has no description as ' data1.doc' It is just named as 'data1' and this continues to 'data40'. I have put several other files in the folder and it works. But it doesn't show the files that I want.
I have searched the community with file processing with no extension but coudn't find any.
I hope you guys can help me out
matFiles = dir('*.') ; % open certain files in the folder.%
N = length(matFiles) ;
for i = 1:N
load(matFiles(i).name) ; %
frequency = data(:,1);
zabsolute = data(:,2);
degree = data(:,3);
x= frequency * 1000; %% frequency is given in KHz multiply with 1000
y1 = zabsolute .* cosd(degree); %% formula to calculate the imaginair component of impedance
y2 = zabsolute .* sind(degree); %% formula to calculate the real component of impedance
figure(i)
subplot(2,1,1);
plot(x,y1),
title ( ' Resistance ' );
xlabel ( ' Frequency (Hz)');
ylabel ( ' Re Z');
subplot (2,1,2);
plot (x,y2);
title ( ' Reactance' );
xlabel ( ' Frequency (Hz)');
ylabel ( ' Img Z')
endBayram Akpinarhttps://jp.mathworks.com/matlabcentral/profile/authors/10964664tag:jp.mathworks.com,2005:Question/2751802016-03-24T00:14:58Z2021-03-03T15:43:48ZHow to get the pixels intersected with a vector line?I would like to get the image pixels which intersect with a vector line . As shown in the figure below, I would like to get the yellow pixels; the starting coordinates (x1,y1) and ending coordinates (x2,y2) of the vector line are known. Could anybody help me to solve this question? I used matlab sometimes but not well.
<</matlabcentral/answers/uploaded_files/48292/pixels_intersect_with_line.JPG>>
Lavender Liuhttps://jp.mathworks.com/matlabcentral/profile/authors/6038044tag:jp.mathworks.com,2005:Question/7617662021-03-03T15:10:30Z2021-03-03T15:40:43ZForming a matrix from dataHi,
I think I'm going mad, does anyone know why Matlab will not form a Matrix from the following. I've separated each of the 10 elements with a ; as it says in the help.
Kind regards,
Andy
a=[0.443412162162090
0.443412162162090
0.443412162162090
0.696790540540449
0.570101351351255
0.570101351351255
0.696790540540449
0.823479729729644
0.823479729729644
0.823479729729644;
0.443412162162090
4.11739864864855
10.7052364864864
12.7322635135134
13.4923986486486
14.2525337837837
14.6326013513513
14.6326013513513
15.2660472972972
15.2660472972972;
0.443412162162090
5.51097972972963
23.6275337837837
43.5177364864864
56.1866554054053
62.2677364864864
64.9282094594594
66.9552364864864
68.2221283783783
68.7288851351351;
0.443412162162090
5.63766891891882
27.8082770270270
57.5802364864865
88.1123310810811
110.536317567568
126.372466216216
135.240709459459
140.941722972973
143.855574324324;
0.570101351351225
5.89104729729721
30.3420608108107
45.2913851351350
60.2407094594594
74.9366554054054
105.215371621622
120.291385135135
135.240709459459
149.683277027027;
0.570101351351285
5.89104729729721
33.8893581081080
45.2913851351351
60.2407094594594
75.1900337837838
105.088682432432
120.164695945946
135.367398648649
149.683277027027;
0.570101351351405
6.27111486486491
35.6630067567568
45.2913851351351
60.2407094594594
75.3167229729729
105.342060810811
120.291385135135
135.240709459459
149.809966216216;
0.570101351351465
6.52449324324336
37.4366554054054
45.4180743243243
60.2407094594594
75.3167229729729
105.215371621622
120.291385135135
135.367398648648
149.809966216216;
0.570101351351495
7.03125000000014
39.0836148648649
45.4180743243244
60.2407094594595
75.1900337837838
105.088682432432
120.291385135135
135.367398648648
149.936655405405]Andy Wilemanhttps://jp.mathworks.com/matlabcentral/profile/authors/18683045tag:jp.mathworks.com,2005:Question/7596912021-03-01T19:29:46Z2021-03-03T15:38:30ZInstantiate an instance of C++ object via MATLAB CoderI have an interesting task. I would like to call a GNU Octave interpreter via MATLAB Coder. I have custom C++ source code that initialises and prepares Octave interpreter. My current problem lies in making MATLAB coder aware of the C++ `interpreter` instance. Please find below by current attempt:
function [status] = inter_c() %#coder
%INTER_C Initialises Octave interpreter
% Initialises Octave interpreter
coder.cinclude('/opt/local/include/octave-6.1.0/octave/oct.h');
coder.cinclude('/opt/local/include/octave-6.1.0/octave/interpreter.h');
coder.updateBuildInfo('addSourceFiles', 'inter.cpp');
inter = coder.opaque('octave::interpreter'); % <-- error occurs here
status = 0;
status = coder.ceval('initOctInter', coder.ref(inter));
end
When I try to generate the resulting C++ code with
codegen inter_c -lang:c++ -args {} -report
It crashes with the following error:
??? Variable 'inter' is not fully defined on some execution paths.
I understand, that I need to let MATLAB coder know all the details of the `interpreter` definition, but I don't know, how to do that correctly. I also tried to direct coder to the relevant header file with
inter = coder.opaque('interpreter', 'HeaderFile', '/opt/local/include/octave-6.1.0/octave/interpreter.h');
But the error remains the same.
The contents of custom C++ code in `inter.cpp` are:
#include <iostream>
#include <oct.h>
#include <octave.h>
#include <parse.h>
#include <interpreter.h>
// Initialises Octave interpreter
int initOctInter(interpreter &inter) {
int status = -1;
// Inhibit reading history file
inter.initialize_history(false);
// Set custom load path
inter.initialize_load_path(false);
// Initialise interpreter
inter.initialize();
status = (inter.initialized()) ? 0 : -1;
if (status != 0) {
cerr << "Octave interpreter initialisation failed!" << endl;
}
// Make interpreter ready to execute
status = inter.execute();
if (status != 0) {
cerr << "Creating embedded Octave interpreter failed!" << endl;
}
return status;
}
In C++ this task is achieved as follows:
#include <interpreter.h>
int main(void) {
interpreter inter;
// Initialise Octave interpreter
int status = initOctInter(inter);
if (status == 0) {
// Call compute functions
// ...
// Shutdown Octave interpreter (releases memory)
inter.shutdown();
}
return 0;
}
I would appreciate any help and guidance. If possible, would you please direct me to a relevant example? Thank you!Maksims Abalenkovshttps://jp.mathworks.com/matlabcentral/profile/authors/21542142tag:jp.mathworks.com,2005:Question/2783002016-04-11T05:33:53Z2021-03-03T15:38:02ZMatlab code help on Euler's MethodI have to implement for academic purpose a Matlab code on Euler's method(y(i+1) = y(i) + h * f(x(i),y(i))) which has a condition for stopping iteration will be based on given number of x. I am new in Matlab but I have to submit the code so soon. I am facing lots of error in implementing that though I haven't so many knowledge on Matlab. If anyone provide me so easy and simple code on that then it'll be very helpful for me. Thank you.Sanjida Ahmedhttps://jp.mathworks.com/matlabcentral/profile/authors/7625469tag:jp.mathworks.com,2005:Question/7617712021-03-03T15:11:03Z2021-03-03T15:37:33ZHow to plot cubic equations ?Hello all,
I'm new to matlab and am stuck trying to plot the function x*y*(x^2+y^2)>=47.3.
can someone explain/show how both the equality and inequality can be plotted.
Thanks.Amith Mallyahttps://jp.mathworks.com/matlabcentral/profile/authors/21415780tag:jp.mathworks.com,2005:Question/7618112021-03-03T15:36:40Z2021-03-03T15:36:40ZAutomatic Nuclei Count tif stacksI am using this borrowed code to automatically count DAPI stained nuclei:
Hs.dirPath = pwd;
[Hs.dataFiles,Hs.dataNums] = getDataFiles(Hs.dirPath);
[Hs.foundChannels,Hs.fileNums,Hs.imgExts] = getImageFiles(Hs.dirPath);
for i = 1:length(Hs.fileNums)
Hs.fileNum = Hs.fileNums(i);
fileName = ['dapi' sprintf('%03d',Hs.fileNum) '.tif'];
Hs.DI = readmm(fileName);
Hs.DI = Hs.DI.imagedata;
Hs.DI = scale(max(Hs.DI(:,:,round(linspace(10,size(Hs.DI,10),50))),[],3));
binDapi = Hs.DI>adaptthresh(Hs.DI);
masktmp = imclearborder(binDapi | ~Hs.DI);
masktmp = bwareaopen(masktmp,50);
if any(masktmp(:))
binDapi = masktmp;
end
L = bwlabel(binDapi);
numObjects = max(L,[],1:2);
Hs.currObjs = [];
Hs.allMasks = [];
for j = 1:numObjects
fnumStr = sprintf('%03d',Hs.fileNum);
objMask = L == j;
newObj = improc2.buildImageObject(objMask, fnumStr, Hs.dirPath);
Hs.currObjs = [Hs.currObjs, newObj];
Hs.allMasks = cat(3,Hs.allMasks,objMask);
end
objects = Hs.currObjs;
save(sprintf('%s%sdata%03d.mat',Hs.dirPath,filesep,Hs.fileNum),'objects');
[Hs.dataFiles,Hs.dataNums] = getDataFiles(Hs.dirPath);
clear objects;
Hs.currObjs = [];
end
It ends up fusing nuclei that are on different planes. In the image shown here (Matlab Output on the left and original on the right)there should be 14 nuclei but 1 and 6, 2 and 5 and 3 and 7 end up being counted as the same.
I have tried changing the threshold etc. but it does not help with the stacks.
Any suggestions to modify the code? Thanks.Priya Sivaramakrishnanhttps://jp.mathworks.com/matlabcentral/profile/authors/12409445tag:jp.mathworks.com,2005:Question/7616612021-03-03T14:08:21Z2021-03-03T15:34:45ZFit with an integral involvedHi everybody,
i have some problem in fitting my experimental data with a function involving an integral in it.
My fitting function is the subsequent:
where
and
where E1,E2,T^* and T^' are my fitting parameters, while T is my abscissa.
I have tried defining a unique function in lsqcurvefit but it does not work. I have some difficulties in defining the integral in the fitting function.
Can someone help me with the code?
Thaks a lot.Daniele Sonaglionihttps://jp.mathworks.com/matlabcentral/profile/authors/17179537tag:jp.mathworks.com,2005:Question/7616262021-03-03T13:36:30Z2021-03-03T15:31:41ZGetting error with optimization appsHi
A code that I was using before gives an error since I reinstalled matlab.
The error is Unable to resolve the name sdo.AnalyzeOptions. Is there anything changed or something I miss?Maryam Alieehttps://jp.mathworks.com/matlabcentral/profile/authors/15656910tag:jp.mathworks.com,2005:Question/990672013-03-05T15:36:00Z2021-03-03T15:30:56ZWhy do I receive License Manager Error -9?When I try to launch MATLAB, I get the following error:
ERROR: License checkout failed. Invalid host. License Manager Error -9MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7618062021-03-03T15:29:53Z2021-03-03T15:29:53ZVisual Studio compiling: DagNN.mex Dear MatConvNet community,
I am exploring MatConvNet for DagNN.mex file in image semantic segmentation based on model ResNet-101 in Matlab R2020b:
netStruct = load('imagenet-resnet-101-dag.mat');
net = dagnn.DagNN.loadobj(netStruct);
C = semanticseg(frame, net_config);
B = labeloverlay(frame,C);
However, I am getting many errors trying to compile using MSVS2019 project https://github.com/guosheng/refinenet.
So please, I urgently need only DagNN.mex file in order to load a model. Can anyone post only the DagNN.mex file?
Thank you!Janko Vukotichttps://jp.mathworks.com/matlabcentral/profile/authors/21475454tag:jp.mathworks.com,2005:Question/7618012020-11-10T05:00:00Z2021-03-03T15:29:38ZHow to append a row to an excel file?How can I append a row to an Excel file?MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7617962021-03-03T15:28:52Z2021-03-03T15:28:52ZCFD with initial boundary and conditions
Please show the matlab code
Cassidy Holenehttps://jp.mathworks.com/matlabcentral/profile/authors/17512545tag:jp.mathworks.com,2005:Question/7617862021-03-03T15:14:40Z2021-03-03T15:19:16ZConvert string array to numerical vectorI have numbers as string array A that I'd like to convert to numerical vector B:
A = ["01";"04";"12"];
B = [1; 4; 12];
I've tried with str2num but it seems to proceed only with string scalars rather than vectors.
Any tips without loop?John Taylorhttps://jp.mathworks.com/matlabcentral/profile/authors/21651586tag:jp.mathworks.com,2005:Question/2954882016-07-12T04:00:00Z2021-03-03T15:17:57ZIs a flag set on the possibility of a singular matrixI'm using the equation solver A=B\C . The matrix can become singular and MATLAB sends out a 'warning' to this effect.
Is there an associated flag that is set also in this case so I can make some decisions based on the possibility of a singular matrix?MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7617462021-03-03T15:01:03Z2021-03-03T15:16:45ZHow to remove elements from two arrays when one of them has a zeroHi everyone, I'll explain my problem.
I have two arrays of the same length which are called respectively: target_2019 and output_2019, what I am going to do is the difference between these two arrays and I calculate the MAPE. However, some of the values present in target_2019 are zeros, how can I eliminate these zeros by simultaneously eliminating the measure that corresponds to this zero in the output_2019 array?
I hope I was clear.
Would anyone know how to help me?Giuseppe D'Amicohttps://jp.mathworks.com/matlabcentral/profile/authors/9925574tag:jp.mathworks.com,2005:Question/7616662021-03-03T14:11:20Z2021-03-03T15:15:38ZHow to read the whole .txt file with data?In my pipeline, I need to save a table x to a txt file and then read it in another script of the same pipeline.
To save the table, I'm using
dlmwrite('filename.txt',x)
Then I read it in the other file using:
fileID = fopen('filename.txt','r');
formatSpec = '%f';
y = fscanf(fileID,formatSpec);
However, this assigns an empty value to y. If I specify something like [10 Inf] in fscanf, it reads only the first value.
I was wondering how I could read the whole table in the txt file. Should I change the code for saving the table or reading it?Ildar Sadreevhttps://jp.mathworks.com/matlabcentral/profile/authors/13128664tag:jp.mathworks.com,2005:Question/1027582009-06-27T01:11:00Z2021-03-03T15:14:44ZWhy do I get Linker errors while building a Simulink model for xPC target?The Simulink model contains a block 'Blk1' generated using the S-function target. 'Blk1' was generated from a Subsystem 'subsys1' via the S-function target. subsys1 contains a user written S-function block. (cnt.c). I get the following error when I try to build the model:
### Linking ...
D:\MATLAB6p1\sys\perl\win32\bin\perl
D:\MATLAB6p1\rtw\c\tools\mkvc_lnk.pl trial1_sfun.lnk trial1_sfun.obj
rt_sim.obj rt_nonfinite.obj xpctarget.obj trial10_sf.obj
link /DEBUG /NOLOGO /DLL /DEF:xpcvcdll.def /Include:_malloc
D:\MATLAB6p1\toolbox\rtw\targets\xpc\target\build\lib\rttheap.lib rtwlib.lib
@trial1_sfun.lnk -out:trial1_sfun.dll
Creating library trial1_sfun.lib and object trial1_sfun.exp
trial1_sfun.obj : error LNK2001: unresolved external symbol _cnt
trial1_sfun.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
I do not get this error when I build the model and I replace "Blk1" with "subsys1" (the original subsystem).MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7617812021-03-03T15:14:25Z2021-03-03T15:14:25ZIndex a cell array with an cellHi all
I have a cell array
C {1x2}
C{1} 1x180 values
C{2} 1x1260 values
and B with the same size containing zeros and ones. Now I want to do something:
C{B}=[]; to delete all entries of C where B contains a one whearas if B contains a zero all values should be maintained.
How can i do this?
Thank you!Christian Schieferhttps://jp.mathworks.com/matlabcentral/profile/authors/18084433tag:jp.mathworks.com,2005:Question/7617762021-03-03T15:11:42Z2021-03-03T15:11:42ZHow can i filter the spectrogram colours and take as matrix?Hello, I am trying to change spectrogram matrix colours. I am writing audio and music recognition system based on Spectrogram.
function spectrogram_graph(audiofile_name)
[y,fs]=audioread(audiofile_name);
fprintf("Amount of Fs is:%d \n",fs)
specgram(y);
xlabel("Samples")
ylabel("Normalized Frequency (x pi radians/sample)")
colormap gray
c=colorbar;
c.Label.String="Powerfrequency dB(rad/sample)";
end
I have this table from this function:
I need to filter, for example: Higher than -40dB will be white and lowers will be black. I need to recieve this as matrix with only ones and zeros. Thats why i am using grayscale.
Firsty, I couldnt filter and change the colours of the spectrogram.
Secondly, I couldnt obtain 2D matrix of the spectrogram.
Can you help me please guys, best wishes
AltemurAltemur Çelikayarhttps://jp.mathworks.com/matlabcentral/profile/authors/16453584tag:jp.mathworks.com,2005:Question/7616012021-03-03T13:10:20Z2021-03-03T15:11:14Zstandard deviation in errorbar[a very silly question!] How to calculate the errorbar with 2 standard deviations in this example?
x=1:10;
y=rand(10,50);
errorbar(x, mean(y,2), std(y,[],2)) % 1 standard deviation
Just multiplying std by 2 in the errorbar, right?
errorbar(x, mean(y,2), 2 * std(y,[],2))Simhttps://jp.mathworks.com/matlabcentral/profile/authors/14233052tag:jp.mathworks.com,2005:Question/2923622016-06-26T10:17:53Z2021-03-03T15:09:32ZHello all, how I can solve ODE simultaneously with fmincon?
I have a system subject to ordinary differential equations (ODE) which are the linear equality constraints and at the same time i want to minimize the objective function which depends on the parameters which are the solution of the (ODE). I try to follow MathWorks Support Team answer
http://www.mathworks.com/matlabcentral/answers/101883-how-do-i-estimate-or-optimize-the-parameters-of-my-ode-system-in-matlab-8-1-r2013a
The problem I have a confuse to follow MathWorks Support Team answer ; I do not know if I have to solve ODE first then I send the ODE solution to the objective function via fmincon as a passing parameters OR I have to solve the ODE inside the objective function.
ThanksMuna Shehanhttps://jp.mathworks.com/matlabcentral/profile/authors/4748028tag:jp.mathworks.com,2005:Question/7617562021-03-03T15:04:18Z2021-03-03T15:09:31ZMore details on fmincon function I am using the fmincon function in my script. Information I have so far found on fmincon (https://uk.mathworks.com/help/optim/ug/fmincon.html) and help'fmincon' is limited.
Is anyone aware of any other documents I can access that discuss the mathematics of the model in more detail.
Many thanks in advance! Hannah Cookhttps://jp.mathworks.com/matlabcentral/profile/authors/11148990tag:jp.mathworks.com,2005:Question/476682012-09-08T14:33:28Z2021-03-03T15:07:35ZOptical character recognition for seven-segment display digit.[MATLAB]Hi. recently i am doing on a project of Optical character recognition for seven-segment display digit.
I am asked to crop out [attach photo] the A,B,C,D,E,F,G accordingly
using *AUTO -CROPPING.*
http://i1149.photobucket.com/albums/o582/Pillowgerr/24bd59a8.jpg
and i had a hard time figuring the codes & ways succesfully do it.
I hope any of you can assist me with coding and explanations.
thank you so much! :)Estherhttps://jp.mathworks.com/matlabcentral/profile/authors/3663134tag:jp.mathworks.com,2005:Question/7617612021-03-03T15:05:58Z2021-03-03T15:05:58ZQuestion on block in Matlab Simulink<</matlabcentral/answers/uploaded_files/537466/IMG_20210303_200038.png>>
I was making a block set by watching videos on youtube but I stuck on a part of an element. I don't know the name of this element so I couldn't find it in my library. Please tell me the name of the element which is shown in the image. So that I can continue my work.
Thank you Krish Singhhttps://jp.mathworks.com/matlabcentral/profile/authors/18931472tag:jp.mathworks.com,2005:Question/7609812021-03-02T23:13:45Z2021-03-03T15:05:37Zsolving a system of 2nd order 2 ODE: output vector length not matching the initial condition vector lengthI am trying to solve a 2nd order system of 2 ODEs using the ODE45. the variables to be solved are V_1 and V_6.
the output vetor y = [V_1 ; V_1' ; V_6 ;V_6'] as I defined has the length of 4, and it matches the definition of the system of ODEs
the length of the initial condition vector is 4, and it matches the definition of the system of the 2 ODEs
but I get this error:
"LINEAR_ODE returns a vector of length 2, but the length of initial conditions vector is 4. The vector returned by
LINEAR_ODE and the initial conditions vector must have the same number of elements."
the ODE equations are pretty complicated but correspond to the equations of a coupled two LC resonators. I checked my code pretty much but going crazy.
I am following the same approch as is in this question (https://www.mathworks.com/matlabcentral/answers/491409-how-to-solve-system-of-2nd-order-differential-equations-using-ode45), and the code works with no error !
Thank you so much !
TimeScale= 10*1E-10;
TimeStep= 1 * 1E-15;
tspan = [0:TimeStep: TimeScale];
y0 = [0; 0; 0;0];
% y = [V_1; V_1'; V_6 ;V_6']
%y(1)=V_1 y(2)=V_1' y(3)=V_6 y(4)=V_6'
[t, y]= ode45(@Linear_ODE, tspan, y0);
function dydt=Linear_ODE(t,y)
h = 6.62607015 * 1E-34 ; % [J s]
e=1.60217662 * 1E-19; %[C] % elementary charge(C)
K_J= (2*e*2*pi)/h ;%2e/h_bar
C_1 = 0.3e-12;
L_5 = 10.0e-9;
L_J = 2*L_5;
L_3 = L_J;
M_4 = 100e-12;
C_6 = 0.3e-12;
tildeL_3 = L_3-M_4;
tildeL_5 = L_5-M_4;
V_0 = 1e-6;
R_s=50;
Ic_0= 25e-9;
w= 2.9e09;
Alpha= tildeL_3 + M_4;
Beta = tildeL_5 + M_4;
TimeStep= 1 * 1E-15;
dydt= [y(2); -1/(R_s*C_1)*y(2)-(1 + Alpha * 1/L_J)*1/(Alpha*C_1) * y(1) + M_4*C_6/(C_1*Alpha) * diff(y(4))/TimeStep-V_0*w*sin(w*t)/(R_s*C_1) ; y(4) ; M_4*C_1/(C_6*Beta)* diff(y(2))/TimeStep+ M_4/(R_s*C_6*Beta)* y(2)+ M_4*1/(C_6*Beta)* 1/L_J * y(1)+y(3)/(C_6*Beta)+ M_4/(R_s*C_6*Beta)*V_0*w*cos(w*t)];
end
yosri ayadihttps://jp.mathworks.com/matlabcentral/profile/authors/16787577tag:jp.mathworks.com,2005:Question/7617512021-03-03T15:04:02Z2021-03-03T15:04:02ZHow can I power a vehicle body with a fuel cellHello,
I am trying to simulate a fuel cell powered formula student vehicle. To do this I have followed and completed the steps in the following tutorial video: Student Competition: Physical Modeling Training, Part 3: Introduction to Vehicle Modelling.
I have my model but can't find resources to create a fuel cell power source to then drive this vehicle body.
Any help would be much appreciated. email is 180106237@aston.ac.uk
Thanks. James Thomashttps://jp.mathworks.com/matlabcentral/profile/authors/21615197tag:jp.mathworks.com,2005:Question/4700482019-07-03T09:02:31Z2021-03-03T15:00:09ZReading seven segment display with OCR commandI am trying to read the digits off of Images of a seven segment display, like the one below.
b = imread('frame1.jpg'); %image above
imshow(b)
BW1 = imbinarize(rgb2gray(b),0.2);
BW2 = imcomplement(BW1);
figure; imshow(BW2); roi = round(getPosition(imrect));
imshowpair(BW1,BW2,'montage')
ocrResults = ocr(BW2,roi,'CharacterSet','.0123456789','TextLayout','word');
recognizedText = ocrResults.Text;
text(600, 150, recognizedText, 'BackgroundColor', [1 1 1]);
However the ocr command cannot read the digits correclty, as can be seen in the textbox on the processed image below.
Are there any pre-processing steps I should additionaly take?
Do I need to use the ocr command in a different way?
Thanks in advance for any suggestionsKevin Ammannhttps://jp.mathworks.com/matlabcentral/profile/authors/5643562tag:jp.mathworks.com,2005:Question/7617412020-11-11T05:00:00Z2021-03-03T14:59:52ZSpecifying time frames for Simulink simulation, using colon operator, gives invalid dataI am using the below command:
sim(test.settings.model, [time(1) time(end)], [], input_struct);
Where input_struct is defined via:
input_struct.time
input_struct.signals(j).label
input_struct.signals(j).dataType
input_struct.signals(j).dimensions
If the "inports" have interpolation on, then "time" variable does not math with the following format of specified time frames:
t1 = [0:1/80:11/80]' % Do not work even though I provide in double format
I am providing 12 frames of time data which must align perfectly with time variable in input_struct, to prevent interpolation.
I can fix the problem by specifying time via:
t2 = 0.0125*[0:11]'
Using format long and taking the difference between these 2 approaches (t1-t2) frame 10 is not close enough to 0.
If the inports have interpolation off and t1 format is used, then Sim is holding last value and thus not using my exact input (I provided in the input_struct signals data).
Bottom line, the first method (t1) of specifying time is not accurate enough. Please expalin behavior?MathWorks Support Teamhttps://jp.mathworks.com/matlabcentral/profile/authors/4622813tag:jp.mathworks.com,2005:Question/7616312021-03-03T13:38:30Z2021-03-03T14:58:40ZHow to get matrix element A{1,2} at indices 1,2 from matrix A =@(x,y)How to get element with index 1,2 from matrix defined as function.
A =@(x,y) [x 1*x 2*x 3*x; y 5 6 7; 1 1 1 1; 2 3 4 5]
A(3,1) % evaluates the matrix for x=3 y =1
% How to get element at indices 1,2 A(3,1){1,2}=3 meaning 1*x = 3Olehttps://jp.mathworks.com/matlabcentral/profile/authors/5968107tag:jp.mathworks.com,2005:Question/7612812021-03-03T07:38:09Z2021-03-03T14:56:34ZError While Solving couple-Differential Equations@ Star Strider
I've tried to solve 5 differential equations. While running the script I'm getting some errors. What shall I modify in the script?
Parameter_TFP.m
function f_Pendulum_structure = Parameter_TFP(t,y, time,U_g, K_s,C_s,m_s,m_1,m_2,m_3,m_4,W,R_eff_1,R_eff_2,R_eff_3,R_eff_4,k_h,mu_1,mu_2,mu_3,mu_4,K_r,d_3,d_2)
% t1 y1 are the variables on which differential equation is formulated
interpolated_Ug = interp1(time,U_g,t);
% friction force calculation
% if condition == presliding
% f_h_1 = K_h *y(1); % pre-sliding condition for concave mass 1
% f_h_2= k_h*(y(3)-y(1)); % pre-sliding condition for concave mass 2
% f_h_3= k_h*(y(5)-y(3)); % pre-sliding condition for concave mass 3
% f_h_4= k_h*(y(7)-y(5)); % pre-sliding condition for concave mass 4
% end
%if condition == sliding
f_h_1= mu_1*W*sign(y(2)); % Sliding condition for concave mass 1
f_h_2= mu_2*W*sign(y(4)-y(2)); % Sliding condition for concave mass 2
f_h_3= mu_3*W*sign(y(6)-y(4)); % Sliding condition for concave mass 3
f_h_4= mu_4*W*sign(y(8)-y(6)); % Sliding condition for concave mass 4
%end
if abs(y(3)-y(1))>d_2
f_r_2 = K_r*(abs(y(3)-y(1))-d_2)*sign(y(3)-y(1));
else
f_r_2 = 0;
end
if abs(y(5)-y(3))>d_3
f_r_3 = K_r*(abs(y(5)-y(3))-d_3)*sign(y(5)-y(3));
else
f_r_3 = 0;
end
f_Pendulum_structure = [y(2);(-interpolated_Ug) + (f_h_2/m_1)-(f_h_1/m_1)-(W/(m_1*R_eff_1))*y(1)+((W/(R_eff_2*m_1))*(y(3)-y(1)))+(f_r_2/m_1);...
y(4);(-interpolated_Ug) + (f_h_3/m_2)-(f_h_2/m_2)-((W/(m_2*R_eff_2))*(y(3)-y(1)))+((W/(R_eff_3*m_2))*(y(5)-y(3)))+(f_r_3/m_2)-(f_r_2/m_2);...
y(6);(-interpolated_Ug) + (f_h_4/m_3)-(f_h_3/m_3)-((W/(m_3*R_eff_3))*(y(5)-y(3)))+((W/(R_eff_4*m_3))*(y(7)-y(5)))-(f_r_3/m_3);...
y(8);(-interpolated_Ug) - (f_h_4/m_4)-((W/(m_4*R_eff_4))*(y(7)-y(5)))+(C_s*(y(10)-y(8))/m_4)+(K_s*(y(9)-y(7))/m_4);...
y(10);(-interpolated_Ug) -(C_s*(y(10)-y(8))/m_s)-(K_s*(y(9)-y(7))/m_s)];
end
main file
clear all;
close all;
clc
%--------------------------------------------------------------------------
tic
%--------------------------------------------------------------------------
%% Ground Acceleration Data------------------------------------------------
load EQ_data_Peak.txt;
skip = 1;
time= EQ_data_Peak(1:skip:end,1);
U_g= 9.81*EQ_data_Peak(1:skip:end,2);
TIME_STEP = time(2) - time(1);
%%-------------------------------------------------------------------------
%%%%%%%%%%% Friction Pendulum with Structure as SDOF system
% model parameters
freq_natural = 1.2; % in Hz
T_natural = 1/freq_natural; % in sec
m_s = 1000*1223.2; % modal mass of the structure in kg
K_s = ((2*pi*freq_natural).^2)*m_s; %%%% stiffness of structure in N/m
eta = 0.01; % damping ratio
C_s = 2*eta* sqrt(K_s*m_s); % damping co-efficient of structure
omega = sqrt(K_s/m_s); % eigen-frequency (rad/s)
omega_d = omega.*sqrt(1-eta.^2); % damped eigen frequency (rad/s)
m_1 = 465; % in kg
m_2 = 465; % in kg
m_3 = 258; % in kg
m_4 = 853; % in kg
W = 12000*1000 ; % in N
R_eff_1 =1.522 ;% in m
R_eff_2 =0.190 ;% in m
R_eff_3 =0.190 ;% in m
R_eff_4 =1.522 ;% in m
k_h = (W/R_eff_4)+100; % Pre-sliding stiffness co-efficient
mu_1= 0.02;
mu_2 =0.0175;
mu_3 =0.0175;
mu_4 =0.02;
K_r = (W/R_eff_4)+100;
d_3 =0.07; % in m
d_2 =0.07; % in m
%%%%%%% initial condition provided
initial_condition = [0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0]; %values for start of Triple Pendulum Bearing along with SDOF Structure
%% Solving for 4 Concave Bearings Plate Along with SDOF Structure
[t,y] = ode15s(@(t,y) Parameter_TFP(t,y,time,U_g, K_s,C_s,m_s,m_1,m_2,m_3,m_4,W,R_eff_1,R_eff_2,R_eff_3,R_eff_4,k_h,mu_1,mu_2,mu_3,mu_4,K_r,d_3,d_2), time,initial_condition);
toc
error:
Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in Parameter_TFP (line 29)
f_Pendulum_structure = [y(2);(-interpolated_Ug) + (f_h_2/m_1)-(f_h_1/m_1)-(W/(m_1*R_eff_1))*y(1)+((W/(R_eff_2*m_1))*(y(3)-y(1)))+(f_r_2/m_1);...
Error in Structure_TFP_Bearing>@(t,y)Parameter_TFP(t,y,time,U_g,K_s,C_s,m_s,m_1,m_2,m_3,m_4,W,R_eff_1,R_eff_2,R_eff_3,R_eff_4,k_h,mu_1,mu_2,mu_3,mu_4,K_r,d_3,d_2)
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode15s (line 150)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in Structure_TFP_Bearing (line 46)
[t,y] = ode15s(@(t,y) Parameter_TFP(t,y,time,U_g, K_s,C_s,m_s,m_1,m_2,m_3,m_4,W,R_eff_1,R_eff_2,R_eff_3,R_eff_4,k_h,mu_1,mu_2,mu_3,mu_4,K_r,d_3,d_2),
time,initial_condition);
Sumit Sahahttps://jp.mathworks.com/matlabcentral/profile/authors/19706356