Category: Matlab
Category Archives: Matlab
求救TT HELP WITH THE PDE error (too many input arguments)
T = 3500;
L = 2;
D = 0.00611;
v = 0.012;
lambda1 = 0.000154;
lambda2 = 0.000154;
w=9/5;
theta1 = 0.818;
theta2=0.0818;
c0m = 1;
c0im = 0;
c0 = [c0m;c0im]
cin = 0;
M = 5;
N = 100;
t = linspace (T/M,T,M);
x = linspace (0,L,N);
options = odeset;
c = pdepe(0,@slowsorpde,@slowsorpic,@slowsorpbc,x,t,options,…
D,v,theta1,theta2,lambda1,lambda2,…
c0,cin,w);
plot (t,c(:,:,1))
xlabel (‘time’); ylabel (‘concentration’);
function [c,f,s] = slowsorpde(x,t,u,DuDx,D,v,theta1,theta2,lambda1,lambda2,c0,cin,w)
c = [1;1];
f = [D;0].*DuDx;
s = -[v;0].*DuDx – [lambda1;lambda2].*u – [(w/theta1)*(u(1)-u(2))-lambda2*u(2);(w/theta2)*(u(1)-u(2))];
end
function u0 = slowsorpic(x,d,v,c0)
u0 = c0;
end
function [pl,ql,pr,qr] = slowsorpbc(xl,ul,xr,ur,t,D,v,theta1,theata2,lambda1,lambda2,c0,cin)
pl = [ul(1)-cin;0];
ql = [0;1];
pr = [0;0];
qr = [1;1];
endT = 3500;
L = 2;
D = 0.00611;
v = 0.012;
lambda1 = 0.000154;
lambda2 = 0.000154;
w=9/5;
theta1 = 0.818;
theta2=0.0818;
c0m = 1;
c0im = 0;
c0 = [c0m;c0im]
cin = 0;
M = 5;
N = 100;
t = linspace (T/M,T,M);
x = linspace (0,L,N);
options = odeset;
c = pdepe(0,@slowsorpde,@slowsorpic,@slowsorpbc,x,t,options,…
D,v,theta1,theta2,lambda1,lambda2,…
c0,cin,w);
plot (t,c(:,:,1))
xlabel (‘time’); ylabel (‘concentration’);
function [c,f,s] = slowsorpde(x,t,u,DuDx,D,v,theta1,theta2,lambda1,lambda2,c0,cin,w)
c = [1;1];
f = [D;0].*DuDx;
s = -[v;0].*DuDx – [lambda1;lambda2].*u – [(w/theta1)*(u(1)-u(2))-lambda2*u(2);(w/theta2)*(u(1)-u(2))];
end
function u0 = slowsorpic(x,d,v,c0)
u0 = c0;
end
function [pl,ql,pr,qr] = slowsorpbc(xl,ul,xr,ur,t,D,v,theta1,theata2,lambda1,lambda2,c0,cin)
pl = [ul(1)-cin;0];
ql = [0;1];
pr = [0;0];
qr = [1;1];
end T = 3500;
L = 2;
D = 0.00611;
v = 0.012;
lambda1 = 0.000154;
lambda2 = 0.000154;
w=9/5;
theta1 = 0.818;
theta2=0.0818;
c0m = 1;
c0im = 0;
c0 = [c0m;c0im]
cin = 0;
M = 5;
N = 100;
t = linspace (T/M,T,M);
x = linspace (0,L,N);
options = odeset;
c = pdepe(0,@slowsorpde,@slowsorpic,@slowsorpbc,x,t,options,…
D,v,theta1,theta2,lambda1,lambda2,…
c0,cin,w);
plot (t,c(:,:,1))
xlabel (‘time’); ylabel (‘concentration’);
function [c,f,s] = slowsorpde(x,t,u,DuDx,D,v,theta1,theta2,lambda1,lambda2,c0,cin,w)
c = [1;1];
f = [D;0].*DuDx;
s = -[v;0].*DuDx – [lambda1;lambda2].*u – [(w/theta1)*(u(1)-u(2))-lambda2*u(2);(w/theta2)*(u(1)-u(2))];
end
function u0 = slowsorpic(x,d,v,c0)
u0 = c0;
end
function [pl,ql,pr,qr] = slowsorpbc(xl,ul,xr,ur,t,D,v,theta1,theata2,lambda1,lambda2,c0,cin)
pl = [ul(1)-cin;0];
ql = [0;1];
pr = [0;0];
qr = [1;1];
end pde too manyinput arguments error MATLAB Answers — New Questions
Trying to use function ,didnt work?
function [Delta]= finddeflexion(Length)
E= 4.2*(10.^10);
I = 1*(10.^-5);
W = 8500;
prompt = "What is the length of the blade? ";
Length = input(prompt);
Delta = W*(Length^3)/(8*E*I);
when i typed it like this it gave me error sayin to type the function part like so and i dont understand why
function [Delta]= finddeflexion(~)
the code then works finefunction [Delta]= finddeflexion(Length)
E= 4.2*(10.^10);
I = 1*(10.^-5);
W = 8500;
prompt = "What is the length of the blade? ";
Length = input(prompt);
Delta = W*(Length^3)/(8*E*I);
when i typed it like this it gave me error sayin to type the function part like so and i dont understand why
function [Delta]= finddeflexion(~)
the code then works fine function [Delta]= finddeflexion(Length)
E= 4.2*(10.^10);
I = 1*(10.^-5);
W = 8500;
prompt = "What is the length of the blade? ";
Length = input(prompt);
Delta = W*(Length^3)/(8*E*I);
when i typed it like this it gave me error sayin to type the function part like so and i dont understand why
function [Delta]= finddeflexion(~)
the code then works fine matlab MATLAB Answers — New Questions
Pass the text of fprintf to the plot’s text
Would it be possible to pass the text of fprintf to the plot’s text?
x = rand(1,10);
plot(x)
m = mean(x);
sd = std(x);
a = fprintf(‘the mean is %1.2fn’,m);
b = fprintf(‘the standard deviation is %1.2fn’,sd);
text(2,0.5,[a b])Would it be possible to pass the text of fprintf to the plot’s text?
x = rand(1,10);
plot(x)
m = mean(x);
sd = std(x);
a = fprintf(‘the mean is %1.2fn’,m);
b = fprintf(‘the standard deviation is %1.2fn’,sd);
text(2,0.5,[a b]) Would it be possible to pass the text of fprintf to the plot’s text?
x = rand(1,10);
plot(x)
m = mean(x);
sd = std(x);
a = fprintf(‘the mean is %1.2fn’,m);
b = fprintf(‘the standard deviation is %1.2fn’,sd);
text(2,0.5,[a b]) text, fprintf, plot MATLAB Answers — New Questions
trying to use syms and i typed in syms(‘y’) says error
y = syms(‘y’)
Error using syms
Using input and output arguments simultaneously is not supported.y = syms(‘y’)
Error using syms
Using input and output arguments simultaneously is not supported. y = syms(‘y’)
Error using syms
Using input and output arguments simultaneously is not supported. matlab MATLAB Answers — New Questions
Trying to enter a transfer function in simulink (tauD s + 1)
I’m trying to enter a transfer function into matlab simulink. This one tauD s + 1. I tried to enter it by entering in the numerator [tauD 1] and in the denominator [1]. But then it will give me an error that says that the order of the numerator and denominator aren’t equal. Anyone any ideas how to enter this function? Maybe i’m doing this wrong, any help is appreciated!I’m trying to enter a transfer function into matlab simulink. This one tauD s + 1. I tried to enter it by entering in the numerator [tauD 1] and in the denominator [1]. But then it will give me an error that says that the order of the numerator and denominator aren’t equal. Anyone any ideas how to enter this function? Maybe i’m doing this wrong, any help is appreciated! I’m trying to enter a transfer function into matlab simulink. This one tauD s + 1. I tried to enter it by entering in the numerator [tauD 1] and in the denominator [1]. But then it will give me an error that says that the order of the numerator and denominator aren’t equal. Anyone any ideas how to enter this function? Maybe i’m doing this wrong, any help is appreciated! simulink, matlab MATLAB Answers — New Questions
How to read values from excel file with mobile matlab app?
Hi, I want to read values from Excel file with the Matlab mobile app but It seems to do not read correctly! With the same code on PC works fine! What can be the reason? filename = ‘Acceleration.xls’;
sheet = ‘Raw Data’;
xlRange = ‘D:D’;
columnD = xlsread(filename,sheet,xlRange)Hi, I want to read values from Excel file with the Matlab mobile app but It seems to do not read correctly! With the same code on PC works fine! What can be the reason? filename = ‘Acceleration.xls’;
sheet = ‘Raw Data’;
xlRange = ‘D:D’;
columnD = xlsread(filename,sheet,xlRange) Hi, I want to read values from Excel file with the Matlab mobile app but It seems to do not read correctly! With the same code on PC works fine! What can be the reason? filename = ‘Acceleration.xls’;
sheet = ‘Raw Data’;
xlRange = ‘D:D’;
columnD = xlsread(filename,sheet,xlRange) read, excel, mobile app MATLAB Answers — New Questions
How to find the minimum difference between the 3 elements of a vector in app designer?
I need to group the elements of a matrix 3 by 3 with the minimum difference between them. I found something like that: min(min(abs(X(1)-X2))), but l have 3 values.I need to group the elements of a matrix 3 by 3 with the minimum difference between them. I found something like that: min(min(abs(X(1)-X2))), but l have 3 values. I need to group the elements of a matrix 3 by 3 with the minimum difference between them. I found something like that: min(min(abs(X(1)-X2))), but l have 3 values. matlab, matrix, appdesigner, app designer MATLAB Answers — New Questions
Is this code suitable for solving a system of ODEs ?
Can i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
endCan i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
end Can i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
end ode, neural network MATLAB Answers — New Questions
Is this code suitable for solving a system of ODEs ?
Can i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
endCan i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
end Can i use this code for a system of ODE and in what way ?
x = linspace(0,1,10000)’;
inputSize = 1;
layers = [
featureInputLayer(inputSize,Normalization="none")
fullyConnectedLayer(10)
sigmoidLayer
fullyConnectedLayer(1)
sigmoidLayer];
dlnet = dlnetwork(layers);
numEpochs = 15;
miniBatchSize =100;
initialLearnRate = 0.1;
learnRateDropFactor = 0.3;
learnRateDropPeriod =5 ;
momentum = 0.9;
icCoeff = 7;
ads = arrayDatastore(x,IterationDimension=1);
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");
figure
set(gca,YScale="log")
lineLossTrain = animatedline(Color=[0.85 0.325 0.098]);
ylim([0 inf])
xlabel("Iteration")
ylabel("Loss (log scale)")
grid on
velocity = [];
iteration = 0;
learnRate = initialLearnRate;
start = tic;
% Loop over epochs.
for epoch = 1:numEpochs
% Shuffle data.
mbq.shuffle
% Loop over mini-batches.
while hasdata(mbq)
iteration = iteration + 1;
% Read mini-batch of data.
dlX = next(mbq);
% Evaluate the model gradients and loss using dlfeval and the modelGradients function.
[gradients,loss] = dlfeval(@modelGradients3, dlnet, dlX, icCoeff);
% Update network parameters using the SGDM optimizer.
[dlnet,velocity] = sgdmupdate(dlnet,gradients,velocity,learnRate,momentum);
% To plot, convert the loss to double.
loss = double(gather(extractdata(loss)));
% Display the training progress.
D = duration(0,0,toc(start),Format="mm:ss.SS");
addpoints(lineLossTrain,iteration,loss)
title("Epoch: " + epoch + " of " + numEpochs + ", Elapsed: " + string(D))
drawnow
end
% Reduce the learning rate.
if mod(epoch,learnRateDropPeriod)==0
learnRate = learnRate*learnRateDropFactor;
end
end
ModelGradients
function [gradients,loss] = modelGradients2(dlnet, dlX, icCoeff)
y = forward(dlnet,dlX);
% Evaluate the gradient of y with respect to x.
% Since another derivative will be taken, set EnableHigherDerivatives to true.
dy = dlgradient(sum(y,"all"),dlX,EnableHigherDerivatives=true);
% Define ODE loss.
eq = dy + y/5 – exp(-(dlX / 5)) .* cos(dlX);
% Define initial condition loss.
ic = forward(dlnet,dlarray(0,"CB")) – 0 ;
% Specify the loss as a weighted sum of the ODE loss and the initial condition loss.
loss = mean(eq.^2,"all") + icCoeff * ic.^2;
% Evaluate model gradients.
gradients = dlgradient(loss, dlnet.Learnables);
end ode, neural network MATLAB Answers — New Questions
Searching a string on a table to get time
Hi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
ThanksHi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
Thanks Hi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
Thanks strings, table MATLAB Answers — New Questions
attach variabe in image
hi need to show the a variable ( D ) that change in runtime i can show that but i need put it on frame that i made it before …i attached my image code ..
thanks in advancehi need to show the a variable ( D ) that change in runtime i can show that but i need put it on frame that i made it before …i attached my image code ..
thanks in advance hi need to show the a variable ( D ) that change in runtime i can show that but i need put it on frame that i made it before …i attached my image code ..
thanks in advance image processing, tracking, cars MATLAB Answers — New Questions
Error : Unable to use a value of type optim.problemdef.OptimizationVariable as an index.
Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance!Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! optimization, solve, error MATLAB Answers — New Questions
Error : Unable to use a value of type optim.problemdef.OptimizationVariable as an index.
Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance!Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! optimization, solve, error MATLAB Answers — New Questions
Error : Unable to use a value of type optim.problemdef.OptimizationVariable as an index.
Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance!Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! Hello !
I am working on a problem-based optimization task where I need to assign 4 subtasks to 4 different nodes. My approach involves defining an optimization variable as a vector with integer elements ranging from 1 to 4, each representing the node assigned to a subtask.
Here’s a snippet of my current setup:
numSubtasks = 4;
numNodes = 4;
taskAssignmentVector = optimvar(‘taskAssignmentVector’, numSubtasks, ‘Type’, ‘integer’, ‘LowerBound’, 1, ‘UpperBound’, numSubtasks);
My goal is to reshape this vector into a 4×4 binary assignment matrix within the optimization framework. Each row of this matrix should correspond to a subtask, and each column to a node, with ‘1’ indicating the assignment.
I attempted to implement this by creating a function to generate the assignment matrix based on the vector, but I’m facing challenges in using the optimization variable as an index, leading to errors.
AssignedMatrix = zeros(numSubtasks, numNodes);
for s = 1:numSubtasks
nodeAssigned = taskAssignmentVector(s); % Node assigned for each subtask
AssignedMatrix(s, nodeAssigned) = 1;
end
Could you please advise on the best approach to reshape this vector into a matrix form within the problem-based optimization framework? I am looking for a way to link the task assignments in the vector with a binary matrix that I can use in my objective function and constraints.
Thank you for your assistance! optimization, solve, error MATLAB Answers — New Questions
Function that makes Anonymous Functions
I want to create a MATLAB function that takes a set of data, fits a curve with the least error, and returns the fitted curve as an anonymous function. When I attempted this, the anonymous function contained variables instead of numerical coefficients. Is there a way to modify the function so that it generates an anonymous function with specific numerical coefficients?I want to create a MATLAB function that takes a set of data, fits a curve with the least error, and returns the fitted curve as an anonymous function. When I attempted this, the anonymous function contained variables instead of numerical coefficients. Is there a way to modify the function so that it generates an anonymous function with specific numerical coefficients? I want to create a MATLAB function that takes a set of data, fits a curve with the least error, and returns the fitted curve as an anonymous function. When I attempted this, the anonymous function contained variables instead of numerical coefficients. Is there a way to modify the function so that it generates an anonymous function with specific numerical coefficients? anonymous function, matlab function, function MATLAB Answers — New Questions
Struggling to Solve 2nd Order ODE with Multiple Initial Values
I’m currently trying to solve a 2nd order ODE with dsolve and cannot get it to properly output a solution…
Here are my ODE, initial conditions, and code…
ODE:
Initial Conditions:
: Where
My code:
clear all;
syms R(r)
eqn = diff(R,2) == R-R^3-(1/r)*diff(R);
V = odeToVectorField(eqn)
M = matlabFunction(V,’vars’,{‘r’,’Y’})
interval = [0 20];
yInit = [2.2 2.2];
ySol = ode45(M,interval,yInit);
figure(2);
tValues = linspace(0,20,100);
yValues = deval(ySol,tValues,1);
plot(tValues,yValues)
When I run this I don’t get an error, but my yValues always have the first value equal to my initial condition and the rest are NaN’s.
My questions:
1: How do I specify that my initial conditions are R'(0)=0 and R(large-number)=0 within the syntax of ODE45?
2: Since I assume the 1/r in my ODE is the cause of the NaN’s, how do I get around this?
3: Is there a simpler way to solve this system?
Thanks in advance for your help.
-DavidI’m currently trying to solve a 2nd order ODE with dsolve and cannot get it to properly output a solution…
Here are my ODE, initial conditions, and code…
ODE:
Initial Conditions:
: Where
My code:
clear all;
syms R(r)
eqn = diff(R,2) == R-R^3-(1/r)*diff(R);
V = odeToVectorField(eqn)
M = matlabFunction(V,’vars’,{‘r’,’Y’})
interval = [0 20];
yInit = [2.2 2.2];
ySol = ode45(M,interval,yInit);
figure(2);
tValues = linspace(0,20,100);
yValues = deval(ySol,tValues,1);
plot(tValues,yValues)
When I run this I don’t get an error, but my yValues always have the first value equal to my initial condition and the rest are NaN’s.
My questions:
1: How do I specify that my initial conditions are R'(0)=0 and R(large-number)=0 within the syntax of ODE45?
2: Since I assume the 1/r in my ODE is the cause of the NaN’s, how do I get around this?
3: Is there a simpler way to solve this system?
Thanks in advance for your help.
-David I’m currently trying to solve a 2nd order ODE with dsolve and cannot get it to properly output a solution…
Here are my ODE, initial conditions, and code…
ODE:
Initial Conditions:
: Where
My code:
clear all;
syms R(r)
eqn = diff(R,2) == R-R^3-(1/r)*diff(R);
V = odeToVectorField(eqn)
M = matlabFunction(V,’vars’,{‘r’,’Y’})
interval = [0 20];
yInit = [2.2 2.2];
ySol = ode45(M,interval,yInit);
figure(2);
tValues = linspace(0,20,100);
yValues = deval(ySol,tValues,1);
plot(tValues,yValues)
When I run this I don’t get an error, but my yValues always have the first value equal to my initial condition and the rest are NaN’s.
My questions:
1: How do I specify that my initial conditions are R'(0)=0 and R(large-number)=0 within the syntax of ODE45?
2: Since I assume the 1/r in my ODE is the cause of the NaN’s, how do I get around this?
3: Is there a simpler way to solve this system?
Thanks in advance for your help.
-David differential equations, ode45 MATLAB Answers — New Questions
Is there anyway to increase the calculation speed of this sqrt integral2 without loosing accuracy?
Is there anyway to increase the calculation speed of this integral2?
g = @(xx,yy)sqrt((xx.*1.103872343207215e+1-yy.*3.605544873768034e-1+xx.^2.*yy.^2.*2.981255793882863e+2-xx.^2.*yy.^3.*7.145239549149272e-1+xx.^3.*yy.^2.*3.193184083673463e+2-xx.^2.*yy.^4.*1.40779965937169e+2-xx.^3.*yy.^3.*1.013059778118534e+1-xx.^4.*yy.^2.*9.292071372439611e+2+xx.^2.*yy.^5.*2.992332140731769e-1-xx.^3.*yy.^4.*1.369974107594584e+2-xx.^4.*yy.^3.*1.294220577933953-xx.^5.*yy.^2.*6.874377148048132e+2+xx.^2.*yy.^6.*6.543517412058207+xx.^3.*yy.^5.*9.4787478195207+xx.^4.*yy.^4.*4.219568904511715e+2+xx.^5.*yy.^3.*1.604618144716224e+1+xx.^6.*yy.^2.*1.052720200159863e+3+xx.^2.*yy.^7.*3.440257778168581e-1+xx.^3.*yy.^6.*3.97973617078252+xx.^4.*yy.^5.*8.158402880998847e-1+xx.^5.*yy.^4.*2.976761849175189e+2+xx.^6.*yy.^3.*1.431304162141321+xx.^7.*yy.^2.*4.87380378442101e+2-xx.^2.*yy.^8.*9.031661549154107-xx.^3.*yy.^7.*5.380951726564079-xx.^4.*yy.^6.*1.613413488924491e+1-xx.^5.*yy.^5.*2.095373277916843e+1-xx.^6.*yy.^4.*4.672406815181154e+2-xx.^7.*yy.^3.*1.396213341785615e+1-xx.^8.*yy.^2.*3.994601481287452e+2-xx.^2.*yy.^9.*2.294996536301288e-1-xx.^3.*yy.^8.*1.429845294263658e+1-xx.^4.*yy.^7.*9.050942192417836e-1-xx.^5.*yy.^6.*1.728805725264949e+1-xx.^6.*yy.^5.*1.34544008057555e-1-xx.^7.*yy.^4.*1.978746300893805e+2-xx.^8.*yy.^3.*2.258089732983687e-1-xx.^9.*yy.^2.*1.016436433222759e+2+xx.^3.*yy.^9.*1.828012711482035+xx.^4.*yy.^8.*3.336707091297534e+1+xx.^5.*yy.^7.*1.59217667567015e+1+xx.^6.*yy.^6.*1.57263834379615e+1+xx.^7.*yy.^5.*2.306992085826472e+1+xx.^8.*yy.^4.*1.745855936499575e+2+xx.^9.*yy.^3.*5.058823046755644+xx.^4.*yy.^9.*5.981939447987676e-1+xx.^5.*yy.^8.*3.596210086309369e+1+xx.^6.*yy.^7.*1.112016367919001e-1+xx.^7.*yy.^6.*1.495088302611445e+1-xx.^8.*yy.^5.*4.545223953790024e-1+xx.^9.*yy.^4.*3.373349362223411e+1-xx.^5.*yy.^9.*5.481785841428752-xx.^6.*yy.^8.*4.129058490033813e+1-xx.^7.*yy.^7.*1.994978298913851e+1-xx.^8.*yy.^6.*5.268976105202482-xx.^9.*yy.^5.*9.463935378555124-xx.^6.*yy.^9.*3.818431611067075e-1-xx.^7.*yy.^8.*3.411790228342504e+1+xx.^8.*yy.^7.*3.655275161975917e-1-xx.^9.*yy.^6.*3.422670732987394+xx.^7.*yy.^9.*6.935438665851035+xx.^8.*yy.^8.*1.650057442285759e+1+xx.^9.*yy.^7.*8.679731905869081+xx.^8.*yy.^9.*1.417469705276344e-2+xx.^9.*yy.^8.*1.111802135132597e+1-xx.^9.*yy.^9.*3.053749060430634-xx.*yy.*1.358041539872225-xx.*yy.^2.*1.761743113711948e+1+xx.^2.*yy.*3.007646166548722e-1+xx.*yy.^3.*2.987672996272836+xx.^3.*yy.*4.204788976746628+xx.*yy.^4.*3.4624013480431+xx.^4.*yy.*7.852805642778767e-1-xx.*yy.^5.*2.130815820353545-xx.^5.*yy.*5.532429583266559+xx.*yy.^6.*1.780044557350331-xx.^6.*yy.*1.026118629770241+xx.*yy.^7.*7.290080029920991e-1+xx.^7.*yy.*3.906556882879037+xx.*yy.^8.*1.336261799653921+xx.^8.*yy.*3.006291554277033e-1-xx.*yy.^9.*2.278236390391508e-1-xx.^9.*yy.*1.220870513639053-xx.^2.*1.548574693140216e+2-xx.^3.*1.720022808360341e+2+xx.^4.*4.900173107690596e+2+xx.^5.*3.710874862768505e+2-xx.^6.*5.599153171793714e+2-xx.^7.*2.703387290954101e+2+xx.^8.*2.136429561611328e+2+xx.^9.*6.021479908170309e+1-yy.^2.*2.217850749090318e+1+yy.^3.*8.032281878547765e-1+yy.^4.*1.147823900997428e+1-yy.^5.*5.259371043980779e-1-yy.^6.*8.669015228839822e-1+yy.^7.*8.425893861929189e-2+yy.^8.*4.546501004086849e-1-yy.^9.*9.955346991849411e-4+1.11125199034042e+1).*(xx.*8.917450828091442e-1-yy.*1.832764070999146e-3-xx.^2.*yy.^2.*3.149250096599649+xx.^2.*yy.^3.*3.432275747499679e-1+xx.^3.*yy.^2.*7.108205033182954e+1+xx.^2.*yy.^4.*3.910407900960859-xx.^3.*yy.^3.*1.007615333683764+xx.^4.*yy.^2.*7.301846550389142e+1-xx.^2.*yy.^5.*5.774881479713465e-1-xx.^3.*yy.^4.*1.040150888639639e+2-xx.^4.*yy.^3.*4.127436011116915-xx.^5.*yy.^2.*5.064993011991733e+2-xx.^2.*yy.^6.*1.840393391604457+xx.^3.*yy.^5.*1.597111669874699-xx.^4.*yy.^4.*9.955144214033603e+1+xx.^5.*yy.^3.*2.138303646817599-xx.^6.*yy.^2.*4.921591873960447e+2+xx.^2.*yy.^7.*5.225563086072636e-1+xx.^3.*yy.^6.*6.988888963931489e+1+xx.^4.*yy.^5.*7.079509787256945+xx.^5.*yy.^4.*7.302234063822373e+2+xx.^6.*yy.^3.*1.863040142690569e+1+xx.^7.*yy.^2.*1.76818389645896e+3+xx.^2.*yy.^8.*2.453279080016533e-1-xx.^3.*yy.^7.*1.163087952436314+xx.^4.*yy.^6.*5.915918234243827e+1-xx.^5.*yy.^5.*3.35018410738197+xx.^6.*yy.^4.*6.841086500842017e+2+xx.^7.*yy.^3.*1.252957342057255+xx.^8.*yy.^2.*1.480467010634292e+3-xx.^2.*yy.^9.*3.032655221718485e-1-xx.^3.*yy.^8.*2.278036773045523e+1-xx.^4.*yy.^7.*6.723071064431262-xx.^5.*yy.^6.*4.795297487798922e+2-xx.^6.*yy.^5.*3.326364713317154e+1-xx.^7.*yy.^4.*2.521032212095309e+3-xx.^8.*yy.^3.*4.653269694282666e+1-xx.^9.*yy.^2.*3.447954066931935e+3-xx.^2.*yy.^10.*1.673760709754303e-1+xx.^3.*yy.^9.*3.536004285541229e-1-xx.^4.*yy.^8.*1.647455285154051e+1+xx.^5.*yy.^7.*1.959490888593118-xx.^6.*yy.^6.*4.244258590721315e+2-xx.^7.*yy.^5.*1.851249760126308-xx.^8.*yy.^4.*2.060464579497394e+3-xx.^9.*yy.^3.*1.15097316035386e+1-xx.^10.*yy.^2.*2.38844937500287e+3+xx.^2.*yy.^11.*1.285283229959356e-1+xx.^3.*yy.^10.*5.985563635425356+xx.^4.*yy.^9.*4.224198125183847+xx.^5.*yy.^8.*1.530130293824737e+2+xx.^6.*yy.^7.*3.420937255464183e+1+xx.^7.*yy.^6.*1.628542058641167e+3+xx.^8.*yy.^5.*8.744487892771101e+1+xx.^9.*yy.^4.*4.871207293139532e+3+xx.^10.*yy.^3.*7.1312618419082e+1+xx.^11.*yy.^2.*3.949541181898515e+3+xx.^2.*yy.^12.*1.088122026806739e-1-xx.^3.*yy.^11.*2.535201427281161e-2+xx.^4.*yy.^10.*5.9004576328881+xx.^5.*yy.^9.*2.41233360867424e-1+xx.^6.*yy.^8.*1.299219303681419e+2+xx.^7.*yy.^7.*3.651593703534549+xx.^8.*yy.^6.*1.289366818512573e+3+xx.^9.*yy.^5.*1.728631843992101e+1+xx.^10.*yy.^4.*3.302797117233668e+3+xx.^11.*yy.^3.*1.883167226905925e+1+xx.^12.*yy.^2.*2.213047026124823e+3-xx.^2.*yy.^13.*3.515509262970026e-2-xx.^3.*yy.^12.*1.990127958180967-xx.^4.*yy.^11.*1.899800493738188-xx.^5.*yy.^10.*4.316621149718254e+1-xx.^6.*yy.^9.*2.381209633537286e+1-xx.^7.*yy.^8.*5.144972151621673e+2-xx.^8.*yy.^7.*9.767466929700799e+1-xx.^9.*yy.^6.*3.106243948572863e+3-xx.^10.*yy.^5.*1.41702297922157e+2-xx.^11.*yy.^4.*5.533605835398259e+3-xx.^12.*yy.^3.*6.786183956102263e+1-xx.^13.*yy.^2.*2.639229675258195e+3+xx.^2.*yy.^14.*7.731813451389398e-4+xx.^3.*yy.^13.*4.865422726462125e-3-xx.^4.*yy.^12.*2.445679991191839-xx.^5.*yy.^11.*6.715940725269066e-1-xx.^6.*yy.^10.*4.507673288076278e+1-xx.^7.*yy.^9.*5.603093601746989-xx.^8.*yy.^8.*4.109282146089062e+2-xx.^9.*yy.^7.*1.753996470905003e+1-xx.^10.*yy.^6.*2.05796865030684e+3-xx.^11.*yy.^5.*2.793033132389915e+1-xx.^12.*yy.^4.*3.023652971671623e+3-xx.^13.*yy.^3.*1.446278259530199e+1-xx.^14.*yy.^2.*1.175938086326686e+3+xx.^2.*yy.^15.*5.01490593227162e-3+xx.^3.*yy.^14.*1.226130225377401e-1+xx.^4.*yy.^13.*5.205137916111856e-1+xx.^5.*yy.^12.*1.508082715349343e+1+xx.^6.*yy.^11.*1.135783574844549e+1+xx.^7.*yy.^10.*1.550603977802377e+2+xx.^8.*yy.^9.*7.38498642874362e+1+xx.^9.*yy.^8.*9.780906748278276e+2+xx.^10.*yy.^7.*1.703675468456969e+2+xx.^11.*yy.^6.*3.48881762178512e+3+xx.^12.*yy.^5.*1.428822558885717e+2+xx.^13.*yy.^4.*3.667162483559571e+3+xx.^14.*yy.^3.*3.837413530633986e+1+xx.^15.*yy.^2.*9.503660390569385e+2+xx.^2.*yy.^16.*5.861221821537304e-3-xx.^3.*yy.^15.*2.037315527441673e-4+xx.^4.*yy.^14.*7.64869899364752e-2+xx.^5.*yy.^13.*1.907444769558822e-1+xx.^6.*yy.^12.*1.708589308022411e+1+xx.^7.*yy.^11.*4.065934064451773+xx.^8.*yy.^10.*1.491040426535532e+2+xx.^9.*yy.^9.*1.595803178073279e+1+xx.^10.*yy.^8.*6.744049813455803e+2+xx.^11.*yy.^7.*2.607330069477239e+1+xx.^12.*yy.^6.*1.859959336144574e+3+xx.^13.*yy.^5.*2.106027647564672e+1+xx.^14.*yy.^4.*1.578290455337145e+3+xx.^15.*yy.^3.*5.404759849680721+xx.^16.*yy.^2.*3.312168568189724e+2-xx.^2.*yy.^17.*1.209189583631184e-3-xx.^3.*yy.^16.*5.542030145778944e-2-xx.^4.*yy.^15.*7.890299096297505e-2-xx.^5.*yy.^14.*8.483322346337942e-1-xx.^6.*yy.^13.*3.107942149637959-xx.^7.*yy.^12.*5.564407009824581e+1-xx.^8.*yy.^11.*3.650661663212293e+1-xx.^9.*yy.^10.*3.135855585359998e+2-xx.^10.*yy.^9.*1.365638754511626e+2-xx.^11.*yy.^8.*1.099176627885069e+3-xx.^12.*yy.^7.*1.829398379551916e+2-xx.^13.*yy.^6.*2.286445876513336e+3-xx.^14.*yy.^5.*8.599320413293898e+1-xx.^15.*yy.^4.*1.308610165671812e+3-xx.^16.*yy.^3.*1.145401808951412e+1-xx.^17.*yy.^2.*1.419636251155902e+2+xx.^2.*yy.^18.*8.813655028507696e-7-xx.^3.*yy.^17.*1.594025887336131e-3-xx.^4.*yy.^16.*1.074352580846769e-1-xx.^5.*yy.^15.*3.328937208257363e-2-xx.^6.*yy.^14.*7.772215192279019e-1-xx.^7.*yy.^13.*1.176397856728984-xx.^8.*yy.^12.*5.503214239313669e+1-xx.^9.*yy.^11.*1.006936419795361e+1-xx.^10.*yy.^10.*2.635384382933626e+2-xx.^11.*yy.^9.*2.135812279225621e+1-xx.^12.*yy.^8.*6.248915151960172e+2-xx.^13.*yy.^7.*1.892072024283776e+1-xx.^14.*yy.^6.*9.501742999811358e+2-xx.^15.*yy.^5.*7.651190531025566-xx.^16.*yy.^4.*4.335602806008366e+2-xx.^17.*yy.^3.*7.754902865214392e-1-xx.^18.*yy.^2.*3.805352147351891e+1+xx.^3.*yy.^18.*1.055806479643397e-4+xx.^4.*yy.^17.*2.113472311575987e-2+xx.^5.*yy.^16.*4.859441895485767e-1+xx.^6.*yy.^15.*5.04519123868697e-1+xx.^7.*yy.^14.*2.975139612246843+xx.^8.*yy.^13.*9.972525025258876+xx.^9.*yy.^12.*1.14241908354265e+2+xx.^10.*yy.^11.*6.878430806750447e+1+xx.^11.*yy.^10.*3.740510789006829e+2+xx.^12.*yy.^9.*1.526436852440644e+2+xx.^13.*yy.^8.*7.22397895624235e+2+xx.^14.*yy.^7.*1.164418673445259e+2+xx.^15.*yy.^6.*8.059991480707276e+2+xx.^16.*yy.^5.*2.767809505586303e+1+xx.^17.*yy.^4.*1.933951468944043e+2+xx.^18.*yy.^3.*1.308041198296645+xx.^4.*yy.^18.*1.053414956120493e-4+xx.^5.*yy.^17.*2.064844552181837e-2+xx.^6.*yy.^16.*7.311122078559425e-1+xx.^7.*yy.^15.*2.068006677205367e-1+xx.^8.*yy.^14.*2.929492444862385+xx.^9.*yy.^13.*2.988342727601186+xx.^10.*yy.^12.*9.644324674983939e+1+xx.^11.*yy.^11.*1.305508809759776e+1+xx.^12.*yy.^10.*2.681367496312035e+2+xx.^13.*yy.^9.*1.503082047430628e+1+xx.^14.*yy.^8.*3.278088783118031e+2+xx.^15.*yy.^7.*6.634680801390892+xx.^16.*yy.^6.*2.526711036194698e+2+xx.^17.*yy.^5.*1.045007940823613+xx.^18.*yy.^4.*4.812290504794675e+1-xx.^5.*yy.^18.*1.50178494658072e-3-xx.^6.*yy.^17.*1.444998993096548e-1-xx.^7.*yy.^16.*2.012430010644059-xx.^8.*yy.^15.*1.736908330974427-xx.^9.*yy.^14.*5.995675469831725-xx.^10.*yy.^13.*1.880438280990048e+1-xx.^11.*yy.^12.*1.374982347789386e+2-xx.^12.*yy.^11.*7.754411397871978e+1-xx.^13.*yy.^10.*2.610329616357622e+2-xx.^14.*yy.^9.*9.995500470504359e+1-xx.^15.*yy.^8.*2.556878311939802e+2-xx.^16.*yy.^7.*3.961883526311578e+1-xx.^17.*yy.^6.*1.173608324930028e+2-xx.^18.*yy.^5.*3.536053671430259-xx.^6.*yy.^18.*9.220149238483281e-4-xx.^7.*yy.^17.*1.014690476686303e-1-xx.^8.*yy.^16.*2.473189356253753-xx.^9.*yy.^15.*5.594697728012737e-1-xx.^10.*yy.^14.*5.664508747841497-xx.^11.*yy.^13.*3.965075348636596-xx.^12.*yy.^12.*9.783286253951298e+1-xx.^13.*yy.^11.*9.179583293626597-xx.^14.*yy.^10.*1.573007989970698e+2-xx.^15.*yy.^9.*5.235877836375165-xx.^16.*yy.^8.*9.009099148888656e+1-xx.^17.*yy.^7.*8.544704478967668e-1-xx.^18.*yy.^6.*2.674768472208937e+1+xx.^7.*yy.^18.*8.789660503979215e-3+xx.^8.*yy.^17.*5.154726443207739e-1+xx.^9.*yy.^16.*4.575501924068617+xx.^10.*yy.^15.*3.519392032862595+xx.^11.*yy.^14.*7.244553726468354+xx.^12.*yy.^13.*2.129145940801576e+1+xx.^13.*yy.^12.*9.652573649437794e+1+xx.^14.*yy.^11.*5.089115632054402e+1+xx.^15.*yy.^10.*9.845644712361996e+1+xx.^16.*yy.^9.*3.474525767319002e+1+xx.^17.*yy.^8.*3.73992298363824e+1+xx.^18.*yy.^7.*5.405894441477231+xx.^8.*yy.^18.*2.917787272284469e-3+xx.^9.*yy.^17.*2.572393452106676e-1+xx.^10.*yy.^16.*4.733102430610986+xx.^11.*yy.^15.*8.181721343591682e-1+xx.^12.*yy.^14.*6.193203199800339+xx.^13.*yy.^13.*2.853719379455096+xx.^14.*yy.^12.*5.718940055267839e+1+xx.^15.*yy.^11.*3.241086639512342+xx.^16.*yy.^10.*4.931962357420912e+1+xx.^17.*yy.^9.*6.747402570722794e-1+xx.^18.*yy.^8.*1.000453477214209e+1-xx.^9.*yy.^18.*2.770194324088346e-2-xx.^10.*yy.^17.*1.060768626920755-xx.^11.*yy.^16.*6.063659935013136-xx.^12.*yy.^15.*4.298729062320957-xx.^13.*yy.^14.*5.188023946675464-xx.^14.*yy.^13.*1.408951687993052e+1-xx.^15.*yy.^12.*3.658477349173497e+1-xx.^16.*yy.^11.*1.763694828691533e+1-xx.^17.*yy.^10.*1.546810666592484e+1-xx.^18.*yy.^9.*4.825340323808244-xx.^10.*yy.^18.*4.375685387384132e-3-xx.^11.*yy.^17.*3.713267341545781e-1-xx.^12.*yy.^16.*5.390084222106306-xx.^13.*yy.^15.*6.738582988011823e-1-xx.^14.*yy.^14.*3.859376170867516-xx.^15.*yy.^13.*1.037177872154021-xx.^16.*yy.^12.*1.775828191771638e+1-xx.^17.*yy.^11.*4.29668961753619e-1-xx.^18.*yy.^10.*6.377690249692412+xx.^11.*yy.^18.*5.061696088482958e-2+xx.^12.*yy.^17.*1.300627194368403+xx.^13.*yy.^16.*4.682344463791613+xx.^14.*yy.^15.*3.094039065852764+xx.^15.*yy.^14.*2.03153119138446+xx.^16.*yy.^13.*4.946110325242825+xx.^17.*yy.^12.*5.777902331673031+xx.^18.*yy.^11.*2.424963328716446+xx.^12.*yy.^18.*3.183114231013491e-3+xx.^13.*yy.^17.*3.092145947884248e-1+xx.^14.*yy.^16.*3.629527888134607+xx.^15.*yy.^15.*2.949491814312678e-1+xx.^16.*yy.^14.*1.2714196413809+xx.^17.*yy.^13.*1.440966441698496e-1+xx.^18.*yy.^12.*2.241647785000835-xx.^13.*yy.^18.*5.349374321560299e-2-xx.^14.*yy.^17.*9.33783004746455e-1-xx.^15.*yy.^16.*1.957315224018444-xx.^16.*yy.^15.*1.199954149395863-xx.^17.*yy.^14.*3.355010021173755e-1-xx.^18.*yy.^13.*6.934728168026845e-1-xx.^14.*yy.^18.*9.373212372286827e-4-xx.^15.*yy.^17.*1.387400101197578e-1-xx.^16.*yy.^16.*1.336780615484007-xx.^17.*yy.^15.*5.351190538689366e-2-xx.^18.*yy.^14.*1.702723527279216e-1+xx.^15.*yy.^18.*3.026462613229377e-2+xx.^16.*yy.^17.*3.601327004082595e-1+xx.^17.*yy.^16.*3.430316844923598e-1+xx.^18.*yy.^15.*1.915157980525296e-1+xx.^16.*yy.^18.*2.672769955889301e-5+xx.^17.*yy.^17.*2.60341252165812e-2+xx.^18.*yy.^16.*2.078858690727986e-1-xx.^17.*yy.^18.*7.079740141201421e-3-xx.^18.*yy.^17.*5.710577672108429e-2+xx.^18.*yy.^18.*1.167810588291038e-6-xx.*yy.*3.075366976262442e-2-xx.*yy.^2.*3.526499241348434-xx.^2.*yy.*8.22091599289123e-2+xx.*yy.^3.*1.279267114308256e-1+xx.^3.*yy.*2.422755366776858e-1+xx.*yy.^4.*5.274972053599984+xx.^4.*yy.*9.838541330816038e-1-xx.*yy.^5.*2.057588038303203e-1-xx.^5.*yy.*4.953532667643909e-1-xx.*yy.^6.*3.667311777247011-xx.^6.*yy.*4.373943336369689+xx.*yy.^7.*1.591772639121506e-1-xx.^7.*yy.*4.450755114932008e-1+xx.*yy.^8.*1.241212300797983+xx.^8.*yy.*1.066815031820515e+1-xx.*yy.^9.*6.133207109844262e-2+xx.^9.*yy.*3.188597989877851-xx.*yy.^10.*3.006491051813672e-1-xx.^10.*yy.*1.585254055500515e+1+xx.*yy.^11.*1.34537384760043e-2-xx.^11.*yy.*5.153376996842015+xx.*yy.^12.*9.083199337053412e-2+xx.^12.*yy.*1.452649282223464e+1-xx.*yy.^13.*3.117573298460605e-3+xx.^13.*yy.*3.98291350637101-xx.*yy.^14.*6.304899409665063e-3-xx.^14.*yy.*7.82968931460302+xx.*yy.^15.*4.110970690634906e-4-xx.^15.*yy.*1.512490222340712+xx.*yy.^16.*2.003209230634498e-3+xx.^16.*yy.*2.180160034236967-xx.*yy.^17.*6.692898196101731e-6+xx.^17.*yy.*2.232626342763958e-1+xx.*yy.^18.*3.833781977872521e-7-xx.^18.*yy.*2.184421777805796e-1+xx.^2.*8.858362630041713e-1-xx.^3.*1.82382173556976e+1-xx.^4.*1.957558756949681e+1+xx.^5.*1.312418883880755e+2+xx.^6.*1.305923371426672e+2-xx.^7.*4.615843547867497e+2-xx.^8.*3.929721561768615e+2+xx.^9.*9.056915732081774e+2+xx.^10.*6.372469002766035e+2-xx.^11.*1.043360695274391e+3-xx.^12.*5.955720645853718e+2+xx.^13.*7.011815709552087e+2+xx.^14.*3.203552367072348e+2-xx.^15.*2.540433444872568e+2-xx.^16.*9.173269575880823e+1+xx.^17.*3.82198342698243e+1+xx.^18.*1.077219415605556e+1+yy.^2.*6.121374088507809e-5+yy.^3.*7.566679105625542e-3-yy.^4.*2.616937320847826e-4-yy.^5.*1.204865172584651e-2+yy.^6.*4.468547430148061e-4+yy.^7.*9.176084750846805e-3-yy.^8.*3.785602968701871e-4-yy.^9.*3.422992169154646e-3+yy.^10.*1.62999960348087e-4+yy.^11.*6.876030356471064e-4-yy.^12.*3.352881389468098e-5-yy.^13.*1.388009800634545e-4+yy.^14.*3.333314996184432e-6+yy.^15.*1.360695926359456e-5-yy.^16.*1.655644414705918e-7-yy.^17.*7.64905319289316e-7+yy.^18.*1.674878549087182e-9-4.550268315834584e-7).^2.*(-8.845979223770551e-5));
integral2(g,-1,1,-1,1)Is there anyway to increase the calculation speed of this integral2?
g = @(xx,yy)sqrt((xx.*1.103872343207215e+1-yy.*3.605544873768034e-1+xx.^2.*yy.^2.*2.981255793882863e+2-xx.^2.*yy.^3.*7.145239549149272e-1+xx.^3.*yy.^2.*3.193184083673463e+2-xx.^2.*yy.^4.*1.40779965937169e+2-xx.^3.*yy.^3.*1.013059778118534e+1-xx.^4.*yy.^2.*9.292071372439611e+2+xx.^2.*yy.^5.*2.992332140731769e-1-xx.^3.*yy.^4.*1.369974107594584e+2-xx.^4.*yy.^3.*1.294220577933953-xx.^5.*yy.^2.*6.874377148048132e+2+xx.^2.*yy.^6.*6.543517412058207+xx.^3.*yy.^5.*9.4787478195207+xx.^4.*yy.^4.*4.219568904511715e+2+xx.^5.*yy.^3.*1.604618144716224e+1+xx.^6.*yy.^2.*1.052720200159863e+3+xx.^2.*yy.^7.*3.440257778168581e-1+xx.^3.*yy.^6.*3.97973617078252+xx.^4.*yy.^5.*8.158402880998847e-1+xx.^5.*yy.^4.*2.976761849175189e+2+xx.^6.*yy.^3.*1.431304162141321+xx.^7.*yy.^2.*4.87380378442101e+2-xx.^2.*yy.^8.*9.031661549154107-xx.^3.*yy.^7.*5.380951726564079-xx.^4.*yy.^6.*1.613413488924491e+1-xx.^5.*yy.^5.*2.095373277916843e+1-xx.^6.*yy.^4.*4.672406815181154e+2-xx.^7.*yy.^3.*1.396213341785615e+1-xx.^8.*yy.^2.*3.994601481287452e+2-xx.^2.*yy.^9.*2.294996536301288e-1-xx.^3.*yy.^8.*1.429845294263658e+1-xx.^4.*yy.^7.*9.050942192417836e-1-xx.^5.*yy.^6.*1.728805725264949e+1-xx.^6.*yy.^5.*1.34544008057555e-1-xx.^7.*yy.^4.*1.978746300893805e+2-xx.^8.*yy.^3.*2.258089732983687e-1-xx.^9.*yy.^2.*1.016436433222759e+2+xx.^3.*yy.^9.*1.828012711482035+xx.^4.*yy.^8.*3.336707091297534e+1+xx.^5.*yy.^7.*1.59217667567015e+1+xx.^6.*yy.^6.*1.57263834379615e+1+xx.^7.*yy.^5.*2.306992085826472e+1+xx.^8.*yy.^4.*1.745855936499575e+2+xx.^9.*yy.^3.*5.058823046755644+xx.^4.*yy.^9.*5.981939447987676e-1+xx.^5.*yy.^8.*3.596210086309369e+1+xx.^6.*yy.^7.*1.112016367919001e-1+xx.^7.*yy.^6.*1.495088302611445e+1-xx.^8.*yy.^5.*4.545223953790024e-1+xx.^9.*yy.^4.*3.373349362223411e+1-xx.^5.*yy.^9.*5.481785841428752-xx.^6.*yy.^8.*4.129058490033813e+1-xx.^7.*yy.^7.*1.994978298913851e+1-xx.^8.*yy.^6.*5.268976105202482-xx.^9.*yy.^5.*9.463935378555124-xx.^6.*yy.^9.*3.818431611067075e-1-xx.^7.*yy.^8.*3.411790228342504e+1+xx.^8.*yy.^7.*3.655275161975917e-1-xx.^9.*yy.^6.*3.422670732987394+xx.^7.*yy.^9.*6.935438665851035+xx.^8.*yy.^8.*1.650057442285759e+1+xx.^9.*yy.^7.*8.679731905869081+xx.^8.*yy.^9.*1.417469705276344e-2+xx.^9.*yy.^8.*1.111802135132597e+1-xx.^9.*yy.^9.*3.053749060430634-xx.*yy.*1.358041539872225-xx.*yy.^2.*1.761743113711948e+1+xx.^2.*yy.*3.007646166548722e-1+xx.*yy.^3.*2.987672996272836+xx.^3.*yy.*4.204788976746628+xx.*yy.^4.*3.4624013480431+xx.^4.*yy.*7.852805642778767e-1-xx.*yy.^5.*2.130815820353545-xx.^5.*yy.*5.532429583266559+xx.*yy.^6.*1.780044557350331-xx.^6.*yy.*1.026118629770241+xx.*yy.^7.*7.290080029920991e-1+xx.^7.*yy.*3.906556882879037+xx.*yy.^8.*1.336261799653921+xx.^8.*yy.*3.006291554277033e-1-xx.*yy.^9.*2.278236390391508e-1-xx.^9.*yy.*1.220870513639053-xx.^2.*1.548574693140216e+2-xx.^3.*1.720022808360341e+2+xx.^4.*4.900173107690596e+2+xx.^5.*3.710874862768505e+2-xx.^6.*5.599153171793714e+2-xx.^7.*2.703387290954101e+2+xx.^8.*2.136429561611328e+2+xx.^9.*6.021479908170309e+1-yy.^2.*2.217850749090318e+1+yy.^3.*8.032281878547765e-1+yy.^4.*1.147823900997428e+1-yy.^5.*5.259371043980779e-1-yy.^6.*8.669015228839822e-1+yy.^7.*8.425893861929189e-2+yy.^8.*4.546501004086849e-1-yy.^9.*9.955346991849411e-4+1.11125199034042e+1).*(xx.*8.917450828091442e-1-yy.*1.832764070999146e-3-xx.^2.*yy.^2.*3.149250096599649+xx.^2.*yy.^3.*3.432275747499679e-1+xx.^3.*yy.^2.*7.108205033182954e+1+xx.^2.*yy.^4.*3.910407900960859-xx.^3.*yy.^3.*1.007615333683764+xx.^4.*yy.^2.*7.301846550389142e+1-xx.^2.*yy.^5.*5.774881479713465e-1-xx.^3.*yy.^4.*1.040150888639639e+2-xx.^4.*yy.^3.*4.127436011116915-xx.^5.*yy.^2.*5.064993011991733e+2-xx.^2.*yy.^6.*1.840393391604457+xx.^3.*yy.^5.*1.597111669874699-xx.^4.*yy.^4.*9.955144214033603e+1+xx.^5.*yy.^3.*2.138303646817599-xx.^6.*yy.^2.*4.921591873960447e+2+xx.^2.*yy.^7.*5.225563086072636e-1+xx.^3.*yy.^6.*6.988888963931489e+1+xx.^4.*yy.^5.*7.079509787256945+xx.^5.*yy.^4.*7.302234063822373e+2+xx.^6.*yy.^3.*1.863040142690569e+1+xx.^7.*yy.^2.*1.76818389645896e+3+xx.^2.*yy.^8.*2.453279080016533e-1-xx.^3.*yy.^7.*1.163087952436314+xx.^4.*yy.^6.*5.915918234243827e+1-xx.^5.*yy.^5.*3.35018410738197+xx.^6.*yy.^4.*6.841086500842017e+2+xx.^7.*yy.^3.*1.252957342057255+xx.^8.*yy.^2.*1.480467010634292e+3-xx.^2.*yy.^9.*3.032655221718485e-1-xx.^3.*yy.^8.*2.278036773045523e+1-xx.^4.*yy.^7.*6.723071064431262-xx.^5.*yy.^6.*4.795297487798922e+2-xx.^6.*yy.^5.*3.326364713317154e+1-xx.^7.*yy.^4.*2.521032212095309e+3-xx.^8.*yy.^3.*4.653269694282666e+1-xx.^9.*yy.^2.*3.447954066931935e+3-xx.^2.*yy.^10.*1.673760709754303e-1+xx.^3.*yy.^9.*3.536004285541229e-1-xx.^4.*yy.^8.*1.647455285154051e+1+xx.^5.*yy.^7.*1.959490888593118-xx.^6.*yy.^6.*4.244258590721315e+2-xx.^7.*yy.^5.*1.851249760126308-xx.^8.*yy.^4.*2.060464579497394e+3-xx.^9.*yy.^3.*1.15097316035386e+1-xx.^10.*yy.^2.*2.38844937500287e+3+xx.^2.*yy.^11.*1.285283229959356e-1+xx.^3.*yy.^10.*5.985563635425356+xx.^4.*yy.^9.*4.224198125183847+xx.^5.*yy.^8.*1.530130293824737e+2+xx.^6.*yy.^7.*3.420937255464183e+1+xx.^7.*yy.^6.*1.628542058641167e+3+xx.^8.*yy.^5.*8.744487892771101e+1+xx.^9.*yy.^4.*4.871207293139532e+3+xx.^10.*yy.^3.*7.1312618419082e+1+xx.^11.*yy.^2.*3.949541181898515e+3+xx.^2.*yy.^12.*1.088122026806739e-1-xx.^3.*yy.^11.*2.535201427281161e-2+xx.^4.*yy.^10.*5.9004576328881+xx.^5.*yy.^9.*2.41233360867424e-1+xx.^6.*yy.^8.*1.299219303681419e+2+xx.^7.*yy.^7.*3.651593703534549+xx.^8.*yy.^6.*1.289366818512573e+3+xx.^9.*yy.^5.*1.728631843992101e+1+xx.^10.*yy.^4.*3.302797117233668e+3+xx.^11.*yy.^3.*1.883167226905925e+1+xx.^12.*yy.^2.*2.213047026124823e+3-xx.^2.*yy.^13.*3.515509262970026e-2-xx.^3.*yy.^12.*1.990127958180967-xx.^4.*yy.^11.*1.899800493738188-xx.^5.*yy.^10.*4.316621149718254e+1-xx.^6.*yy.^9.*2.381209633537286e+1-xx.^7.*yy.^8.*5.144972151621673e+2-xx.^8.*yy.^7.*9.767466929700799e+1-xx.^9.*yy.^6.*3.106243948572863e+3-xx.^10.*yy.^5.*1.41702297922157e+2-xx.^11.*yy.^4.*5.533605835398259e+3-xx.^12.*yy.^3.*6.786183956102263e+1-xx.^13.*yy.^2.*2.639229675258195e+3+xx.^2.*yy.^14.*7.731813451389398e-4+xx.^3.*yy.^13.*4.865422726462125e-3-xx.^4.*yy.^12.*2.445679991191839-xx.^5.*yy.^11.*6.715940725269066e-1-xx.^6.*yy.^10.*4.507673288076278e+1-xx.^7.*yy.^9.*5.603093601746989-xx.^8.*yy.^8.*4.109282146089062e+2-xx.^9.*yy.^7.*1.753996470905003e+1-xx.^10.*yy.^6.*2.05796865030684e+3-xx.^11.*yy.^5.*2.793033132389915e+1-xx.^12.*yy.^4.*3.023652971671623e+3-xx.^13.*yy.^3.*1.446278259530199e+1-xx.^14.*yy.^2.*1.175938086326686e+3+xx.^2.*yy.^15.*5.01490593227162e-3+xx.^3.*yy.^14.*1.226130225377401e-1+xx.^4.*yy.^13.*5.205137916111856e-1+xx.^5.*yy.^12.*1.508082715349343e+1+xx.^6.*yy.^11.*1.135783574844549e+1+xx.^7.*yy.^10.*1.550603977802377e+2+xx.^8.*yy.^9.*7.38498642874362e+1+xx.^9.*yy.^8.*9.780906748278276e+2+xx.^10.*yy.^7.*1.703675468456969e+2+xx.^11.*yy.^6.*3.48881762178512e+3+xx.^12.*yy.^5.*1.428822558885717e+2+xx.^13.*yy.^4.*3.667162483559571e+3+xx.^14.*yy.^3.*3.837413530633986e+1+xx.^15.*yy.^2.*9.503660390569385e+2+xx.^2.*yy.^16.*5.861221821537304e-3-xx.^3.*yy.^15.*2.037315527441673e-4+xx.^4.*yy.^14.*7.64869899364752e-2+xx.^5.*yy.^13.*1.907444769558822e-1+xx.^6.*yy.^12.*1.708589308022411e+1+xx.^7.*yy.^11.*4.065934064451773+xx.^8.*yy.^10.*1.491040426535532e+2+xx.^9.*yy.^9.*1.595803178073279e+1+xx.^10.*yy.^8.*6.744049813455803e+2+xx.^11.*yy.^7.*2.607330069477239e+1+xx.^12.*yy.^6.*1.859959336144574e+3+xx.^13.*yy.^5.*2.106027647564672e+1+xx.^14.*yy.^4.*1.578290455337145e+3+xx.^15.*yy.^3.*5.404759849680721+xx.^16.*yy.^2.*3.312168568189724e+2-xx.^2.*yy.^17.*1.209189583631184e-3-xx.^3.*yy.^16.*5.542030145778944e-2-xx.^4.*yy.^15.*7.890299096297505e-2-xx.^5.*yy.^14.*8.483322346337942e-1-xx.^6.*yy.^13.*3.107942149637959-xx.^7.*yy.^12.*5.564407009824581e+1-xx.^8.*yy.^11.*3.650661663212293e+1-xx.^9.*yy.^10.*3.135855585359998e+2-xx.^10.*yy.^9.*1.365638754511626e+2-xx.^11.*yy.^8.*1.099176627885069e+3-xx.^12.*yy.^7.*1.829398379551916e+2-xx.^13.*yy.^6.*2.286445876513336e+3-xx.^14.*yy.^5.*8.599320413293898e+1-xx.^15.*yy.^4.*1.308610165671812e+3-xx.^16.*yy.^3.*1.145401808951412e+1-xx.^17.*yy.^2.*1.419636251155902e+2+xx.^2.*yy.^18.*8.813655028507696e-7-xx.^3.*yy.^17.*1.594025887336131e-3-xx.^4.*yy.^16.*1.074352580846769e-1-xx.^5.*yy.^15.*3.328937208257363e-2-xx.^6.*yy.^14.*7.772215192279019e-1-xx.^7.*yy.^13.*1.176397856728984-xx.^8.*yy.^12.*5.503214239313669e+1-xx.^9.*yy.^11.*1.006936419795361e+1-xx.^10.*yy.^10.*2.635384382933626e+2-xx.^11.*yy.^9.*2.135812279225621e+1-xx.^12.*yy.^8.*6.248915151960172e+2-xx.^13.*yy.^7.*1.892072024283776e+1-xx.^14.*yy.^6.*9.501742999811358e+2-xx.^15.*yy.^5.*7.651190531025566-xx.^16.*yy.^4.*4.335602806008366e+2-xx.^17.*yy.^3.*7.754902865214392e-1-xx.^18.*yy.^2.*3.805352147351891e+1+xx.^3.*yy.^18.*1.055806479643397e-4+xx.^4.*yy.^17.*2.113472311575987e-2+xx.^5.*yy.^16.*4.859441895485767e-1+xx.^6.*yy.^15.*5.04519123868697e-1+xx.^7.*yy.^14.*2.975139612246843+xx.^8.*yy.^13.*9.972525025258876+xx.^9.*yy.^12.*1.14241908354265e+2+xx.^10.*yy.^11.*6.878430806750447e+1+xx.^11.*yy.^10.*3.740510789006829e+2+xx.^12.*yy.^9.*1.526436852440644e+2+xx.^13.*yy.^8.*7.22397895624235e+2+xx.^14.*yy.^7.*1.164418673445259e+2+xx.^15.*yy.^6.*8.059991480707276e+2+xx.^16.*yy.^5.*2.767809505586303e+1+xx.^17.*yy.^4.*1.933951468944043e+2+xx.^18.*yy.^3.*1.308041198296645+xx.^4.*yy.^18.*1.053414956120493e-4+xx.^5.*yy.^17.*2.064844552181837e-2+xx.^6.*yy.^16.*7.311122078559425e-1+xx.^7.*yy.^15.*2.068006677205367e-1+xx.^8.*yy.^14.*2.929492444862385+xx.^9.*yy.^13.*2.988342727601186+xx.^10.*yy.^12.*9.644324674983939e+1+xx.^11.*yy.^11.*1.305508809759776e+1+xx.^12.*yy.^10.*2.681367496312035e+2+xx.^13.*yy.^9.*1.503082047430628e+1+xx.^14.*yy.^8.*3.278088783118031e+2+xx.^15.*yy.^7.*6.634680801390892+xx.^16.*yy.^6.*2.526711036194698e+2+xx.^17.*yy.^5.*1.045007940823613+xx.^18.*yy.^4.*4.812290504794675e+1-xx.^5.*yy.^18.*1.50178494658072e-3-xx.^6.*yy.^17.*1.444998993096548e-1-xx.^7.*yy.^16.*2.012430010644059-xx.^8.*yy.^15.*1.736908330974427-xx.^9.*yy.^14.*5.995675469831725-xx.^10.*yy.^13.*1.880438280990048e+1-xx.^11.*yy.^12.*1.374982347789386e+2-xx.^12.*yy.^11.*7.754411397871978e+1-xx.^13.*yy.^10.*2.610329616357622e+2-xx.^14.*yy.^9.*9.995500470504359e+1-xx.^15.*yy.^8.*2.556878311939802e+2-xx.^16.*yy.^7.*3.961883526311578e+1-xx.^17.*yy.^6.*1.173608324930028e+2-xx.^18.*yy.^5.*3.536053671430259-xx.^6.*yy.^18.*9.220149238483281e-4-xx.^7.*yy.^17.*1.014690476686303e-1-xx.^8.*yy.^16.*2.473189356253753-xx.^9.*yy.^15.*5.594697728012737e-1-xx.^10.*yy.^14.*5.664508747841497-xx.^11.*yy.^13.*3.965075348636596-xx.^12.*yy.^12.*9.783286253951298e+1-xx.^13.*yy.^11.*9.179583293626597-xx.^14.*yy.^10.*1.573007989970698e+2-xx.^15.*yy.^9.*5.235877836375165-xx.^16.*yy.^8.*9.009099148888656e+1-xx.^17.*yy.^7.*8.544704478967668e-1-xx.^18.*yy.^6.*2.674768472208937e+1+xx.^7.*yy.^18.*8.789660503979215e-3+xx.^8.*yy.^17.*5.154726443207739e-1+xx.^9.*yy.^16.*4.575501924068617+xx.^10.*yy.^15.*3.519392032862595+xx.^11.*yy.^14.*7.244553726468354+xx.^12.*yy.^13.*2.129145940801576e+1+xx.^13.*yy.^12.*9.652573649437794e+1+xx.^14.*yy.^11.*5.089115632054402e+1+xx.^15.*yy.^10.*9.845644712361996e+1+xx.^16.*yy.^9.*3.474525767319002e+1+xx.^17.*yy.^8.*3.73992298363824e+1+xx.^18.*yy.^7.*5.405894441477231+xx.^8.*yy.^18.*2.917787272284469e-3+xx.^9.*yy.^17.*2.572393452106676e-1+xx.^10.*yy.^16.*4.733102430610986+xx.^11.*yy.^15.*8.181721343591682e-1+xx.^12.*yy.^14.*6.193203199800339+xx.^13.*yy.^13.*2.853719379455096+xx.^14.*yy.^12.*5.718940055267839e+1+xx.^15.*yy.^11.*3.241086639512342+xx.^16.*yy.^10.*4.931962357420912e+1+xx.^17.*yy.^9.*6.747402570722794e-1+xx.^18.*yy.^8.*1.000453477214209e+1-xx.^9.*yy.^18.*2.770194324088346e-2-xx.^10.*yy.^17.*1.060768626920755-xx.^11.*yy.^16.*6.063659935013136-xx.^12.*yy.^15.*4.298729062320957-xx.^13.*yy.^14.*5.188023946675464-xx.^14.*yy.^13.*1.408951687993052e+1-xx.^15.*yy.^12.*3.658477349173497e+1-xx.^16.*yy.^11.*1.763694828691533e+1-xx.^17.*yy.^10.*1.546810666592484e+1-xx.^18.*yy.^9.*4.825340323808244-xx.^10.*yy.^18.*4.375685387384132e-3-xx.^11.*yy.^17.*3.713267341545781e-1-xx.^12.*yy.^16.*5.390084222106306-xx.^13.*yy.^15.*6.738582988011823e-1-xx.^14.*yy.^14.*3.859376170867516-xx.^15.*yy.^13.*1.037177872154021-xx.^16.*yy.^12.*1.775828191771638e+1-xx.^17.*yy.^11.*4.29668961753619e-1-xx.^18.*yy.^10.*6.377690249692412+xx.^11.*yy.^18.*5.061696088482958e-2+xx.^12.*yy.^17.*1.300627194368403+xx.^13.*yy.^16.*4.682344463791613+xx.^14.*yy.^15.*3.094039065852764+xx.^15.*yy.^14.*2.03153119138446+xx.^16.*yy.^13.*4.946110325242825+xx.^17.*yy.^12.*5.777902331673031+xx.^18.*yy.^11.*2.424963328716446+xx.^12.*yy.^18.*3.183114231013491e-3+xx.^13.*yy.^17.*3.092145947884248e-1+xx.^14.*yy.^16.*3.629527888134607+xx.^15.*yy.^15.*2.949491814312678e-1+xx.^16.*yy.^14.*1.2714196413809+xx.^17.*yy.^13.*1.440966441698496e-1+xx.^18.*yy.^12.*2.241647785000835-xx.^13.*yy.^18.*5.349374321560299e-2-xx.^14.*yy.^17.*9.33783004746455e-1-xx.^15.*yy.^16.*1.957315224018444-xx.^16.*yy.^15.*1.199954149395863-xx.^17.*yy.^14.*3.355010021173755e-1-xx.^18.*yy.^13.*6.934728168026845e-1-xx.^14.*yy.^18.*9.373212372286827e-4-xx.^15.*yy.^17.*1.387400101197578e-1-xx.^16.*yy.^16.*1.336780615484007-xx.^17.*yy.^15.*5.351190538689366e-2-xx.^18.*yy.^14.*1.702723527279216e-1+xx.^15.*yy.^18.*3.026462613229377e-2+xx.^16.*yy.^17.*3.601327004082595e-1+xx.^17.*yy.^16.*3.430316844923598e-1+xx.^18.*yy.^15.*1.915157980525296e-1+xx.^16.*yy.^18.*2.672769955889301e-5+xx.^17.*yy.^17.*2.60341252165812e-2+xx.^18.*yy.^16.*2.078858690727986e-1-xx.^17.*yy.^18.*7.079740141201421e-3-xx.^18.*yy.^17.*5.710577672108429e-2+xx.^18.*yy.^18.*1.167810588291038e-6-xx.*yy.*3.075366976262442e-2-xx.*yy.^2.*3.526499241348434-xx.^2.*yy.*8.22091599289123e-2+xx.*yy.^3.*1.279267114308256e-1+xx.^3.*yy.*2.422755366776858e-1+xx.*yy.^4.*5.274972053599984+xx.^4.*yy.*9.838541330816038e-1-xx.*yy.^5.*2.057588038303203e-1-xx.^5.*yy.*4.953532667643909e-1-xx.*yy.^6.*3.667311777247011-xx.^6.*yy.*4.373943336369689+xx.*yy.^7.*1.591772639121506e-1-xx.^7.*yy.*4.450755114932008e-1+xx.*yy.^8.*1.241212300797983+xx.^8.*yy.*1.066815031820515e+1-xx.*yy.^9.*6.133207109844262e-2+xx.^9.*yy.*3.188597989877851-xx.*yy.^10.*3.006491051813672e-1-xx.^10.*yy.*1.585254055500515e+1+xx.*yy.^11.*1.34537384760043e-2-xx.^11.*yy.*5.153376996842015+xx.*yy.^12.*9.083199337053412e-2+xx.^12.*yy.*1.452649282223464e+1-xx.*yy.^13.*3.117573298460605e-3+xx.^13.*yy.*3.98291350637101-xx.*yy.^14.*6.304899409665063e-3-xx.^14.*yy.*7.82968931460302+xx.*yy.^15.*4.110970690634906e-4-xx.^15.*yy.*1.512490222340712+xx.*yy.^16.*2.003209230634498e-3+xx.^16.*yy.*2.180160034236967-xx.*yy.^17.*6.692898196101731e-6+xx.^17.*yy.*2.232626342763958e-1+xx.*yy.^18.*3.833781977872521e-7-xx.^18.*yy.*2.184421777805796e-1+xx.^2.*8.858362630041713e-1-xx.^3.*1.82382173556976e+1-xx.^4.*1.957558756949681e+1+xx.^5.*1.312418883880755e+2+xx.^6.*1.305923371426672e+2-xx.^7.*4.615843547867497e+2-xx.^8.*3.929721561768615e+2+xx.^9.*9.056915732081774e+2+xx.^10.*6.372469002766035e+2-xx.^11.*1.043360695274391e+3-xx.^12.*5.955720645853718e+2+xx.^13.*7.011815709552087e+2+xx.^14.*3.203552367072348e+2-xx.^15.*2.540433444872568e+2-xx.^16.*9.173269575880823e+1+xx.^17.*3.82198342698243e+1+xx.^18.*1.077219415605556e+1+yy.^2.*6.121374088507809e-5+yy.^3.*7.566679105625542e-3-yy.^4.*2.616937320847826e-4-yy.^5.*1.204865172584651e-2+yy.^6.*4.468547430148061e-4+yy.^7.*9.176084750846805e-3-yy.^8.*3.785602968701871e-4-yy.^9.*3.422992169154646e-3+yy.^10.*1.62999960348087e-4+yy.^11.*6.876030356471064e-4-yy.^12.*3.352881389468098e-5-yy.^13.*1.388009800634545e-4+yy.^14.*3.333314996184432e-6+yy.^15.*1.360695926359456e-5-yy.^16.*1.655644414705918e-7-yy.^17.*7.64905319289316e-7+yy.^18.*1.674878549087182e-9-4.550268315834584e-7).^2.*(-8.845979223770551e-5));
integral2(g,-1,1,-1,1) Is there anyway to increase the calculation speed of this integral2?
g = @(xx,yy)sqrt((xx.*1.103872343207215e+1-yy.*3.605544873768034e-1+xx.^2.*yy.^2.*2.981255793882863e+2-xx.^2.*yy.^3.*7.145239549149272e-1+xx.^3.*yy.^2.*3.193184083673463e+2-xx.^2.*yy.^4.*1.40779965937169e+2-xx.^3.*yy.^3.*1.013059778118534e+1-xx.^4.*yy.^2.*9.292071372439611e+2+xx.^2.*yy.^5.*2.992332140731769e-1-xx.^3.*yy.^4.*1.369974107594584e+2-xx.^4.*yy.^3.*1.294220577933953-xx.^5.*yy.^2.*6.874377148048132e+2+xx.^2.*yy.^6.*6.543517412058207+xx.^3.*yy.^5.*9.4787478195207+xx.^4.*yy.^4.*4.219568904511715e+2+xx.^5.*yy.^3.*1.604618144716224e+1+xx.^6.*yy.^2.*1.052720200159863e+3+xx.^2.*yy.^7.*3.440257778168581e-1+xx.^3.*yy.^6.*3.97973617078252+xx.^4.*yy.^5.*8.158402880998847e-1+xx.^5.*yy.^4.*2.976761849175189e+2+xx.^6.*yy.^3.*1.431304162141321+xx.^7.*yy.^2.*4.87380378442101e+2-xx.^2.*yy.^8.*9.031661549154107-xx.^3.*yy.^7.*5.380951726564079-xx.^4.*yy.^6.*1.613413488924491e+1-xx.^5.*yy.^5.*2.095373277916843e+1-xx.^6.*yy.^4.*4.672406815181154e+2-xx.^7.*yy.^3.*1.396213341785615e+1-xx.^8.*yy.^2.*3.994601481287452e+2-xx.^2.*yy.^9.*2.294996536301288e-1-xx.^3.*yy.^8.*1.429845294263658e+1-xx.^4.*yy.^7.*9.050942192417836e-1-xx.^5.*yy.^6.*1.728805725264949e+1-xx.^6.*yy.^5.*1.34544008057555e-1-xx.^7.*yy.^4.*1.978746300893805e+2-xx.^8.*yy.^3.*2.258089732983687e-1-xx.^9.*yy.^2.*1.016436433222759e+2+xx.^3.*yy.^9.*1.828012711482035+xx.^4.*yy.^8.*3.336707091297534e+1+xx.^5.*yy.^7.*1.59217667567015e+1+xx.^6.*yy.^6.*1.57263834379615e+1+xx.^7.*yy.^5.*2.306992085826472e+1+xx.^8.*yy.^4.*1.745855936499575e+2+xx.^9.*yy.^3.*5.058823046755644+xx.^4.*yy.^9.*5.981939447987676e-1+xx.^5.*yy.^8.*3.596210086309369e+1+xx.^6.*yy.^7.*1.112016367919001e-1+xx.^7.*yy.^6.*1.495088302611445e+1-xx.^8.*yy.^5.*4.545223953790024e-1+xx.^9.*yy.^4.*3.373349362223411e+1-xx.^5.*yy.^9.*5.481785841428752-xx.^6.*yy.^8.*4.129058490033813e+1-xx.^7.*yy.^7.*1.994978298913851e+1-xx.^8.*yy.^6.*5.268976105202482-xx.^9.*yy.^5.*9.463935378555124-xx.^6.*yy.^9.*3.818431611067075e-1-xx.^7.*yy.^8.*3.411790228342504e+1+xx.^8.*yy.^7.*3.655275161975917e-1-xx.^9.*yy.^6.*3.422670732987394+xx.^7.*yy.^9.*6.935438665851035+xx.^8.*yy.^8.*1.650057442285759e+1+xx.^9.*yy.^7.*8.679731905869081+xx.^8.*yy.^9.*1.417469705276344e-2+xx.^9.*yy.^8.*1.111802135132597e+1-xx.^9.*yy.^9.*3.053749060430634-xx.*yy.*1.358041539872225-xx.*yy.^2.*1.761743113711948e+1+xx.^2.*yy.*3.007646166548722e-1+xx.*yy.^3.*2.987672996272836+xx.^3.*yy.*4.204788976746628+xx.*yy.^4.*3.4624013480431+xx.^4.*yy.*7.852805642778767e-1-xx.*yy.^5.*2.130815820353545-xx.^5.*yy.*5.532429583266559+xx.*yy.^6.*1.780044557350331-xx.^6.*yy.*1.026118629770241+xx.*yy.^7.*7.290080029920991e-1+xx.^7.*yy.*3.906556882879037+xx.*yy.^8.*1.336261799653921+xx.^8.*yy.*3.006291554277033e-1-xx.*yy.^9.*2.278236390391508e-1-xx.^9.*yy.*1.220870513639053-xx.^2.*1.548574693140216e+2-xx.^3.*1.720022808360341e+2+xx.^4.*4.900173107690596e+2+xx.^5.*3.710874862768505e+2-xx.^6.*5.599153171793714e+2-xx.^7.*2.703387290954101e+2+xx.^8.*2.136429561611328e+2+xx.^9.*6.021479908170309e+1-yy.^2.*2.217850749090318e+1+yy.^3.*8.032281878547765e-1+yy.^4.*1.147823900997428e+1-yy.^5.*5.259371043980779e-1-yy.^6.*8.669015228839822e-1+yy.^7.*8.425893861929189e-2+yy.^8.*4.546501004086849e-1-yy.^9.*9.955346991849411e-4+1.11125199034042e+1).*(xx.*8.917450828091442e-1-yy.*1.832764070999146e-3-xx.^2.*yy.^2.*3.149250096599649+xx.^2.*yy.^3.*3.432275747499679e-1+xx.^3.*yy.^2.*7.108205033182954e+1+xx.^2.*yy.^4.*3.910407900960859-xx.^3.*yy.^3.*1.007615333683764+xx.^4.*yy.^2.*7.301846550389142e+1-xx.^2.*yy.^5.*5.774881479713465e-1-xx.^3.*yy.^4.*1.040150888639639e+2-xx.^4.*yy.^3.*4.127436011116915-xx.^5.*yy.^2.*5.064993011991733e+2-xx.^2.*yy.^6.*1.840393391604457+xx.^3.*yy.^5.*1.597111669874699-xx.^4.*yy.^4.*9.955144214033603e+1+xx.^5.*yy.^3.*2.138303646817599-xx.^6.*yy.^2.*4.921591873960447e+2+xx.^2.*yy.^7.*5.225563086072636e-1+xx.^3.*yy.^6.*6.988888963931489e+1+xx.^4.*yy.^5.*7.079509787256945+xx.^5.*yy.^4.*7.302234063822373e+2+xx.^6.*yy.^3.*1.863040142690569e+1+xx.^7.*yy.^2.*1.76818389645896e+3+xx.^2.*yy.^8.*2.453279080016533e-1-xx.^3.*yy.^7.*1.163087952436314+xx.^4.*yy.^6.*5.915918234243827e+1-xx.^5.*yy.^5.*3.35018410738197+xx.^6.*yy.^4.*6.841086500842017e+2+xx.^7.*yy.^3.*1.252957342057255+xx.^8.*yy.^2.*1.480467010634292e+3-xx.^2.*yy.^9.*3.032655221718485e-1-xx.^3.*yy.^8.*2.278036773045523e+1-xx.^4.*yy.^7.*6.723071064431262-xx.^5.*yy.^6.*4.795297487798922e+2-xx.^6.*yy.^5.*3.326364713317154e+1-xx.^7.*yy.^4.*2.521032212095309e+3-xx.^8.*yy.^3.*4.653269694282666e+1-xx.^9.*yy.^2.*3.447954066931935e+3-xx.^2.*yy.^10.*1.673760709754303e-1+xx.^3.*yy.^9.*3.536004285541229e-1-xx.^4.*yy.^8.*1.647455285154051e+1+xx.^5.*yy.^7.*1.959490888593118-xx.^6.*yy.^6.*4.244258590721315e+2-xx.^7.*yy.^5.*1.851249760126308-xx.^8.*yy.^4.*2.060464579497394e+3-xx.^9.*yy.^3.*1.15097316035386e+1-xx.^10.*yy.^2.*2.38844937500287e+3+xx.^2.*yy.^11.*1.285283229959356e-1+xx.^3.*yy.^10.*5.985563635425356+xx.^4.*yy.^9.*4.224198125183847+xx.^5.*yy.^8.*1.530130293824737e+2+xx.^6.*yy.^7.*3.420937255464183e+1+xx.^7.*yy.^6.*1.628542058641167e+3+xx.^8.*yy.^5.*8.744487892771101e+1+xx.^9.*yy.^4.*4.871207293139532e+3+xx.^10.*yy.^3.*7.1312618419082e+1+xx.^11.*yy.^2.*3.949541181898515e+3+xx.^2.*yy.^12.*1.088122026806739e-1-xx.^3.*yy.^11.*2.535201427281161e-2+xx.^4.*yy.^10.*5.9004576328881+xx.^5.*yy.^9.*2.41233360867424e-1+xx.^6.*yy.^8.*1.299219303681419e+2+xx.^7.*yy.^7.*3.651593703534549+xx.^8.*yy.^6.*1.289366818512573e+3+xx.^9.*yy.^5.*1.728631843992101e+1+xx.^10.*yy.^4.*3.302797117233668e+3+xx.^11.*yy.^3.*1.883167226905925e+1+xx.^12.*yy.^2.*2.213047026124823e+3-xx.^2.*yy.^13.*3.515509262970026e-2-xx.^3.*yy.^12.*1.990127958180967-xx.^4.*yy.^11.*1.899800493738188-xx.^5.*yy.^10.*4.316621149718254e+1-xx.^6.*yy.^9.*2.381209633537286e+1-xx.^7.*yy.^8.*5.144972151621673e+2-xx.^8.*yy.^7.*9.767466929700799e+1-xx.^9.*yy.^6.*3.106243948572863e+3-xx.^10.*yy.^5.*1.41702297922157e+2-xx.^11.*yy.^4.*5.533605835398259e+3-xx.^12.*yy.^3.*6.786183956102263e+1-xx.^13.*yy.^2.*2.639229675258195e+3+xx.^2.*yy.^14.*7.731813451389398e-4+xx.^3.*yy.^13.*4.865422726462125e-3-xx.^4.*yy.^12.*2.445679991191839-xx.^5.*yy.^11.*6.715940725269066e-1-xx.^6.*yy.^10.*4.507673288076278e+1-xx.^7.*yy.^9.*5.603093601746989-xx.^8.*yy.^8.*4.109282146089062e+2-xx.^9.*yy.^7.*1.753996470905003e+1-xx.^10.*yy.^6.*2.05796865030684e+3-xx.^11.*yy.^5.*2.793033132389915e+1-xx.^12.*yy.^4.*3.023652971671623e+3-xx.^13.*yy.^3.*1.446278259530199e+1-xx.^14.*yy.^2.*1.175938086326686e+3+xx.^2.*yy.^15.*5.01490593227162e-3+xx.^3.*yy.^14.*1.226130225377401e-1+xx.^4.*yy.^13.*5.205137916111856e-1+xx.^5.*yy.^12.*1.508082715349343e+1+xx.^6.*yy.^11.*1.135783574844549e+1+xx.^7.*yy.^10.*1.550603977802377e+2+xx.^8.*yy.^9.*7.38498642874362e+1+xx.^9.*yy.^8.*9.780906748278276e+2+xx.^10.*yy.^7.*1.703675468456969e+2+xx.^11.*yy.^6.*3.48881762178512e+3+xx.^12.*yy.^5.*1.428822558885717e+2+xx.^13.*yy.^4.*3.667162483559571e+3+xx.^14.*yy.^3.*3.837413530633986e+1+xx.^15.*yy.^2.*9.503660390569385e+2+xx.^2.*yy.^16.*5.861221821537304e-3-xx.^3.*yy.^15.*2.037315527441673e-4+xx.^4.*yy.^14.*7.64869899364752e-2+xx.^5.*yy.^13.*1.907444769558822e-1+xx.^6.*yy.^12.*1.708589308022411e+1+xx.^7.*yy.^11.*4.065934064451773+xx.^8.*yy.^10.*1.491040426535532e+2+xx.^9.*yy.^9.*1.595803178073279e+1+xx.^10.*yy.^8.*6.744049813455803e+2+xx.^11.*yy.^7.*2.607330069477239e+1+xx.^12.*yy.^6.*1.859959336144574e+3+xx.^13.*yy.^5.*2.106027647564672e+1+xx.^14.*yy.^4.*1.578290455337145e+3+xx.^15.*yy.^3.*5.404759849680721+xx.^16.*yy.^2.*3.312168568189724e+2-xx.^2.*yy.^17.*1.209189583631184e-3-xx.^3.*yy.^16.*5.542030145778944e-2-xx.^4.*yy.^15.*7.890299096297505e-2-xx.^5.*yy.^14.*8.483322346337942e-1-xx.^6.*yy.^13.*3.107942149637959-xx.^7.*yy.^12.*5.564407009824581e+1-xx.^8.*yy.^11.*3.650661663212293e+1-xx.^9.*yy.^10.*3.135855585359998e+2-xx.^10.*yy.^9.*1.365638754511626e+2-xx.^11.*yy.^8.*1.099176627885069e+3-xx.^12.*yy.^7.*1.829398379551916e+2-xx.^13.*yy.^6.*2.286445876513336e+3-xx.^14.*yy.^5.*8.599320413293898e+1-xx.^15.*yy.^4.*1.308610165671812e+3-xx.^16.*yy.^3.*1.145401808951412e+1-xx.^17.*yy.^2.*1.419636251155902e+2+xx.^2.*yy.^18.*8.813655028507696e-7-xx.^3.*yy.^17.*1.594025887336131e-3-xx.^4.*yy.^16.*1.074352580846769e-1-xx.^5.*yy.^15.*3.328937208257363e-2-xx.^6.*yy.^14.*7.772215192279019e-1-xx.^7.*yy.^13.*1.176397856728984-xx.^8.*yy.^12.*5.503214239313669e+1-xx.^9.*yy.^11.*1.006936419795361e+1-xx.^10.*yy.^10.*2.635384382933626e+2-xx.^11.*yy.^9.*2.135812279225621e+1-xx.^12.*yy.^8.*6.248915151960172e+2-xx.^13.*yy.^7.*1.892072024283776e+1-xx.^14.*yy.^6.*9.501742999811358e+2-xx.^15.*yy.^5.*7.651190531025566-xx.^16.*yy.^4.*4.335602806008366e+2-xx.^17.*yy.^3.*7.754902865214392e-1-xx.^18.*yy.^2.*3.805352147351891e+1+xx.^3.*yy.^18.*1.055806479643397e-4+xx.^4.*yy.^17.*2.113472311575987e-2+xx.^5.*yy.^16.*4.859441895485767e-1+xx.^6.*yy.^15.*5.04519123868697e-1+xx.^7.*yy.^14.*2.975139612246843+xx.^8.*yy.^13.*9.972525025258876+xx.^9.*yy.^12.*1.14241908354265e+2+xx.^10.*yy.^11.*6.878430806750447e+1+xx.^11.*yy.^10.*3.740510789006829e+2+xx.^12.*yy.^9.*1.526436852440644e+2+xx.^13.*yy.^8.*7.22397895624235e+2+xx.^14.*yy.^7.*1.164418673445259e+2+xx.^15.*yy.^6.*8.059991480707276e+2+xx.^16.*yy.^5.*2.767809505586303e+1+xx.^17.*yy.^4.*1.933951468944043e+2+xx.^18.*yy.^3.*1.308041198296645+xx.^4.*yy.^18.*1.053414956120493e-4+xx.^5.*yy.^17.*2.064844552181837e-2+xx.^6.*yy.^16.*7.311122078559425e-1+xx.^7.*yy.^15.*2.068006677205367e-1+xx.^8.*yy.^14.*2.929492444862385+xx.^9.*yy.^13.*2.988342727601186+xx.^10.*yy.^12.*9.644324674983939e+1+xx.^11.*yy.^11.*1.305508809759776e+1+xx.^12.*yy.^10.*2.681367496312035e+2+xx.^13.*yy.^9.*1.503082047430628e+1+xx.^14.*yy.^8.*3.278088783118031e+2+xx.^15.*yy.^7.*6.634680801390892+xx.^16.*yy.^6.*2.526711036194698e+2+xx.^17.*yy.^5.*1.045007940823613+xx.^18.*yy.^4.*4.812290504794675e+1-xx.^5.*yy.^18.*1.50178494658072e-3-xx.^6.*yy.^17.*1.444998993096548e-1-xx.^7.*yy.^16.*2.012430010644059-xx.^8.*yy.^15.*1.736908330974427-xx.^9.*yy.^14.*5.995675469831725-xx.^10.*yy.^13.*1.880438280990048e+1-xx.^11.*yy.^12.*1.374982347789386e+2-xx.^12.*yy.^11.*7.754411397871978e+1-xx.^13.*yy.^10.*2.610329616357622e+2-xx.^14.*yy.^9.*9.995500470504359e+1-xx.^15.*yy.^8.*2.556878311939802e+2-xx.^16.*yy.^7.*3.961883526311578e+1-xx.^17.*yy.^6.*1.173608324930028e+2-xx.^18.*yy.^5.*3.536053671430259-xx.^6.*yy.^18.*9.220149238483281e-4-xx.^7.*yy.^17.*1.014690476686303e-1-xx.^8.*yy.^16.*2.473189356253753-xx.^9.*yy.^15.*5.594697728012737e-1-xx.^10.*yy.^14.*5.664508747841497-xx.^11.*yy.^13.*3.965075348636596-xx.^12.*yy.^12.*9.783286253951298e+1-xx.^13.*yy.^11.*9.179583293626597-xx.^14.*yy.^10.*1.573007989970698e+2-xx.^15.*yy.^9.*5.235877836375165-xx.^16.*yy.^8.*9.009099148888656e+1-xx.^17.*yy.^7.*8.544704478967668e-1-xx.^18.*yy.^6.*2.674768472208937e+1+xx.^7.*yy.^18.*8.789660503979215e-3+xx.^8.*yy.^17.*5.154726443207739e-1+xx.^9.*yy.^16.*4.575501924068617+xx.^10.*yy.^15.*3.519392032862595+xx.^11.*yy.^14.*7.244553726468354+xx.^12.*yy.^13.*2.129145940801576e+1+xx.^13.*yy.^12.*9.652573649437794e+1+xx.^14.*yy.^11.*5.089115632054402e+1+xx.^15.*yy.^10.*9.845644712361996e+1+xx.^16.*yy.^9.*3.474525767319002e+1+xx.^17.*yy.^8.*3.73992298363824e+1+xx.^18.*yy.^7.*5.405894441477231+xx.^8.*yy.^18.*2.917787272284469e-3+xx.^9.*yy.^17.*2.572393452106676e-1+xx.^10.*yy.^16.*4.733102430610986+xx.^11.*yy.^15.*8.181721343591682e-1+xx.^12.*yy.^14.*6.193203199800339+xx.^13.*yy.^13.*2.853719379455096+xx.^14.*yy.^12.*5.718940055267839e+1+xx.^15.*yy.^11.*3.241086639512342+xx.^16.*yy.^10.*4.931962357420912e+1+xx.^17.*yy.^9.*6.747402570722794e-1+xx.^18.*yy.^8.*1.000453477214209e+1-xx.^9.*yy.^18.*2.770194324088346e-2-xx.^10.*yy.^17.*1.060768626920755-xx.^11.*yy.^16.*6.063659935013136-xx.^12.*yy.^15.*4.298729062320957-xx.^13.*yy.^14.*5.188023946675464-xx.^14.*yy.^13.*1.408951687993052e+1-xx.^15.*yy.^12.*3.658477349173497e+1-xx.^16.*yy.^11.*1.763694828691533e+1-xx.^17.*yy.^10.*1.546810666592484e+1-xx.^18.*yy.^9.*4.825340323808244-xx.^10.*yy.^18.*4.375685387384132e-3-xx.^11.*yy.^17.*3.713267341545781e-1-xx.^12.*yy.^16.*5.390084222106306-xx.^13.*yy.^15.*6.738582988011823e-1-xx.^14.*yy.^14.*3.859376170867516-xx.^15.*yy.^13.*1.037177872154021-xx.^16.*yy.^12.*1.775828191771638e+1-xx.^17.*yy.^11.*4.29668961753619e-1-xx.^18.*yy.^10.*6.377690249692412+xx.^11.*yy.^18.*5.061696088482958e-2+xx.^12.*yy.^17.*1.300627194368403+xx.^13.*yy.^16.*4.682344463791613+xx.^14.*yy.^15.*3.094039065852764+xx.^15.*yy.^14.*2.03153119138446+xx.^16.*yy.^13.*4.946110325242825+xx.^17.*yy.^12.*5.777902331673031+xx.^18.*yy.^11.*2.424963328716446+xx.^12.*yy.^18.*3.183114231013491e-3+xx.^13.*yy.^17.*3.092145947884248e-1+xx.^14.*yy.^16.*3.629527888134607+xx.^15.*yy.^15.*2.949491814312678e-1+xx.^16.*yy.^14.*1.2714196413809+xx.^17.*yy.^13.*1.440966441698496e-1+xx.^18.*yy.^12.*2.241647785000835-xx.^13.*yy.^18.*5.349374321560299e-2-xx.^14.*yy.^17.*9.33783004746455e-1-xx.^15.*yy.^16.*1.957315224018444-xx.^16.*yy.^15.*1.199954149395863-xx.^17.*yy.^14.*3.355010021173755e-1-xx.^18.*yy.^13.*6.934728168026845e-1-xx.^14.*yy.^18.*9.373212372286827e-4-xx.^15.*yy.^17.*1.387400101197578e-1-xx.^16.*yy.^16.*1.336780615484007-xx.^17.*yy.^15.*5.351190538689366e-2-xx.^18.*yy.^14.*1.702723527279216e-1+xx.^15.*yy.^18.*3.026462613229377e-2+xx.^16.*yy.^17.*3.601327004082595e-1+xx.^17.*yy.^16.*3.430316844923598e-1+xx.^18.*yy.^15.*1.915157980525296e-1+xx.^16.*yy.^18.*2.672769955889301e-5+xx.^17.*yy.^17.*2.60341252165812e-2+xx.^18.*yy.^16.*2.078858690727986e-1-xx.^17.*yy.^18.*7.079740141201421e-3-xx.^18.*yy.^17.*5.710577672108429e-2+xx.^18.*yy.^18.*1.167810588291038e-6-xx.*yy.*3.075366976262442e-2-xx.*yy.^2.*3.526499241348434-xx.^2.*yy.*8.22091599289123e-2+xx.*yy.^3.*1.279267114308256e-1+xx.^3.*yy.*2.422755366776858e-1+xx.*yy.^4.*5.274972053599984+xx.^4.*yy.*9.838541330816038e-1-xx.*yy.^5.*2.057588038303203e-1-xx.^5.*yy.*4.953532667643909e-1-xx.*yy.^6.*3.667311777247011-xx.^6.*yy.*4.373943336369689+xx.*yy.^7.*1.591772639121506e-1-xx.^7.*yy.*4.450755114932008e-1+xx.*yy.^8.*1.241212300797983+xx.^8.*yy.*1.066815031820515e+1-xx.*yy.^9.*6.133207109844262e-2+xx.^9.*yy.*3.188597989877851-xx.*yy.^10.*3.006491051813672e-1-xx.^10.*yy.*1.585254055500515e+1+xx.*yy.^11.*1.34537384760043e-2-xx.^11.*yy.*5.153376996842015+xx.*yy.^12.*9.083199337053412e-2+xx.^12.*yy.*1.452649282223464e+1-xx.*yy.^13.*3.117573298460605e-3+xx.^13.*yy.*3.98291350637101-xx.*yy.^14.*6.304899409665063e-3-xx.^14.*yy.*7.82968931460302+xx.*yy.^15.*4.110970690634906e-4-xx.^15.*yy.*1.512490222340712+xx.*yy.^16.*2.003209230634498e-3+xx.^16.*yy.*2.180160034236967-xx.*yy.^17.*6.692898196101731e-6+xx.^17.*yy.*2.232626342763958e-1+xx.*yy.^18.*3.833781977872521e-7-xx.^18.*yy.*2.184421777805796e-1+xx.^2.*8.858362630041713e-1-xx.^3.*1.82382173556976e+1-xx.^4.*1.957558756949681e+1+xx.^5.*1.312418883880755e+2+xx.^6.*1.305923371426672e+2-xx.^7.*4.615843547867497e+2-xx.^8.*3.929721561768615e+2+xx.^9.*9.056915732081774e+2+xx.^10.*6.372469002766035e+2-xx.^11.*1.043360695274391e+3-xx.^12.*5.955720645853718e+2+xx.^13.*7.011815709552087e+2+xx.^14.*3.203552367072348e+2-xx.^15.*2.540433444872568e+2-xx.^16.*9.173269575880823e+1+xx.^17.*3.82198342698243e+1+xx.^18.*1.077219415605556e+1+yy.^2.*6.121374088507809e-5+yy.^3.*7.566679105625542e-3-yy.^4.*2.616937320847826e-4-yy.^5.*1.204865172584651e-2+yy.^6.*4.468547430148061e-4+yy.^7.*9.176084750846805e-3-yy.^8.*3.785602968701871e-4-yy.^9.*3.422992169154646e-3+yy.^10.*1.62999960348087e-4+yy.^11.*6.876030356471064e-4-yy.^12.*3.352881389468098e-5-yy.^13.*1.388009800634545e-4+yy.^14.*3.333314996184432e-6+yy.^15.*1.360695926359456e-5-yy.^16.*1.655644414705918e-7-yy.^17.*7.64905319289316e-7+yy.^18.*1.674878549087182e-9-4.550268315834584e-7).^2.*(-8.845979223770551e-5));
integral2(g,-1,1,-1,1) integration MATLAB Answers — New Questions
Searching a string on a table to get time
Hi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
ThanksHi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
Thanks Hi,
I have an excel spreadsheet (attached). The table is basically information from a ticket system. The column are as follows: ID, creation date & time, several comments (each one in a different column) and ticket closing date & time.
The first step I do is reading it: Tbl = readtable(filename, ‘ReadVariableNames’, false);
I want to calculate:
1) the time between when the ticket was acknowledged and the creation time
2) the time between when the ticket is asked to be closed and when it is actually closed.
A ticket is acknowledged in different ways, but it always says "your ticket".
A ticket is asked to be closed in different ways, it says: "can this be closed?", ”can we close this?", "is this still an issue?" or "are you happy to close this?"
So, what I’m thinking is: searching the table for key phrases (like "your ticket"), and then reading the time of the corresponding cell. However, how can I do this without using a for loop to go through the columns?
Thanks strings, table MATLAB Answers — New Questions
Plot 3D Dome – no topo60c file available
I am using the example of how to plot a dome as a mesh over a globe, found here:
https://www.mathworks.com/help/map/plotting-a-3-d-dome-as-a-mesh-over-a-globe.html
It works great, however, I don’t have access to the topo60c .mat file (I have looked, including the USGS site). topo60c is not anywhere in my matlabroot, or in the map toolbox examples or elsewhere on my system. So there is no surface texture, just a wire frame.
I found another Matlab example that converts a .jpg file to a .mat file, at this location:
https://www.mathworks.com/matlabcentral/answers/245042-how-to-convert-jpg-image-files-to-mat-files
With this, I was able to convert my 1024px-Land_ocean_ice_2048.jpg file to the equivalent .mat file (I think).
I modified the original sample code:
load topo60c
geoshow(topo60c,topo60cR,"DisplayType","texturemap")
to this:
load(image_mat)
geoshow(img_data,"DisplayType","texturemap")
where image_mat is the full path to my 1024px-Land_ocean_ice_2048.mat file.
However, when I try to run this code, I get an error message:
Function UPDATEGEOSTRUCT expected input number 1, S, to be a structure.
I can find the coastlines and rivers .mat data, and they load and display successfully.
When I compare the coastlines .mat file and my texturemap .mat file, I notice some differences. Opening coastlines.mat with Matlab, the Import Wizard reveals two structures:
Name Size Bytes Class
coastlat 9865×1 78920 double
coastlon 9865×1 78920 double
My texturemap file looks like this:
Name Size Bytes Class
img_data 1024x2048x3 6291456 uint8
img.data sure looks like a structure to me. What am I missing? Is the uint8 an issue?
I would rather use my texture map, since it is much higher resolution than topo60c.I am using the example of how to plot a dome as a mesh over a globe, found here:
https://www.mathworks.com/help/map/plotting-a-3-d-dome-as-a-mesh-over-a-globe.html
It works great, however, I don’t have access to the topo60c .mat file (I have looked, including the USGS site). topo60c is not anywhere in my matlabroot, or in the map toolbox examples or elsewhere on my system. So there is no surface texture, just a wire frame.
I found another Matlab example that converts a .jpg file to a .mat file, at this location:
https://www.mathworks.com/matlabcentral/answers/245042-how-to-convert-jpg-image-files-to-mat-files
With this, I was able to convert my 1024px-Land_ocean_ice_2048.jpg file to the equivalent .mat file (I think).
I modified the original sample code:
load topo60c
geoshow(topo60c,topo60cR,"DisplayType","texturemap")
to this:
load(image_mat)
geoshow(img_data,"DisplayType","texturemap")
where image_mat is the full path to my 1024px-Land_ocean_ice_2048.mat file.
However, when I try to run this code, I get an error message:
Function UPDATEGEOSTRUCT expected input number 1, S, to be a structure.
I can find the coastlines and rivers .mat data, and they load and display successfully.
When I compare the coastlines .mat file and my texturemap .mat file, I notice some differences. Opening coastlines.mat with Matlab, the Import Wizard reveals two structures:
Name Size Bytes Class
coastlat 9865×1 78920 double
coastlon 9865×1 78920 double
My texturemap file looks like this:
Name Size Bytes Class
img_data 1024x2048x3 6291456 uint8
img.data sure looks like a structure to me. What am I missing? Is the uint8 an issue?
I would rather use my texture map, since it is much higher resolution than topo60c. I am using the example of how to plot a dome as a mesh over a globe, found here:
https://www.mathworks.com/help/map/plotting-a-3-d-dome-as-a-mesh-over-a-globe.html
It works great, however, I don’t have access to the topo60c .mat file (I have looked, including the USGS site). topo60c is not anywhere in my matlabroot, or in the map toolbox examples or elsewhere on my system. So there is no surface texture, just a wire frame.
I found another Matlab example that converts a .jpg file to a .mat file, at this location:
https://www.mathworks.com/matlabcentral/answers/245042-how-to-convert-jpg-image-files-to-mat-files
With this, I was able to convert my 1024px-Land_ocean_ice_2048.jpg file to the equivalent .mat file (I think).
I modified the original sample code:
load topo60c
geoshow(topo60c,topo60cR,"DisplayType","texturemap")
to this:
load(image_mat)
geoshow(img_data,"DisplayType","texturemap")
where image_mat is the full path to my 1024px-Land_ocean_ice_2048.mat file.
However, when I try to run this code, I get an error message:
Function UPDATEGEOSTRUCT expected input number 1, S, to be a structure.
I can find the coastlines and rivers .mat data, and they load and display successfully.
When I compare the coastlines .mat file and my texturemap .mat file, I notice some differences. Opening coastlines.mat with Matlab, the Import Wizard reveals two structures:
Name Size Bytes Class
coastlat 9865×1 78920 double
coastlon 9865×1 78920 double
My texturemap file looks like this:
Name Size Bytes Class
img_data 1024x2048x3 6291456 uint8
img.data sure looks like a structure to me. What am I missing? Is the uint8 an issue?
I would rather use my texture map, since it is much higher resolution than topo60c. matlab, geoshow, topo60c, surf() MATLAB Answers — New Questions
How do I resolve the horzcat and linearArray Error?
The research paper I am doing requires me to provide data for certain design questions.These questions are based upon human body communication.For my group specifically we must investigate the power transfer between the transmitter and receiver of our device mainly observing the coils.The coils we used to model each were planar and helix for receiver and transmitter respectively under lc passive circuitry.The code that mathworks has I tried making variations to.So the code only allowed for the transmitter and receiver antenna geometry to be the same so the error that is arising is due to trying to replace one of the identical coils with a helix.If that is not possible I would like to know if there is a way to use the rf pcb toolbox spiral inductors instead.Example instead of spiralobj how can I use Ind.The research paper I am doing requires me to provide data for certain design questions.These questions are based upon human body communication.For my group specifically we must investigate the power transfer between the transmitter and receiver of our device mainly observing the coils.The coils we used to model each were planar and helix for receiver and transmitter respectively under lc passive circuitry.The code that mathworks has I tried making variations to.So the code only allowed for the transmitter and receiver antenna geometry to be the same so the error that is arising is due to trying to replace one of the identical coils with a helix.If that is not possible I would like to know if there is a way to use the rf pcb toolbox spiral inductors instead.Example instead of spiralobj how can I use Ind. The research paper I am doing requires me to provide data for certain design questions.These questions are based upon human body communication.For my group specifically we must investigate the power transfer between the transmitter and receiver of our device mainly observing the coils.The coils we used to model each were planar and helix for receiver and transmitter respectively under lc passive circuitry.The code that mathworks has I tried making variations to.So the code only allowed for the transmitter and receiver antenna geometry to be the same so the error that is arising is due to trying to replace one of the identical coils with a helix.If that is not possible I would like to know if there is a way to use the rf pcb toolbox spiral inductors instead.Example instead of spiralobj how can I use Ind. #rftoolbox, #rfpcbtoolbox, #antennacatalog, #spiralinductors MATLAB Answers — New Questions