please someone help me with this as soon as possible as i have a submission due.
I am new to Matlab,and i dont know why this error pops up in mycod.This code is same to all other students and they are able to run it and i am not.
1)L2_1D_P3 file (which i run )
clear;format long;
Lx=1;
XSeed= 11;
diffusivity_function=struct('type','scalar','d',1.0);
load_type=struct('case','homogeneous','value',1.0);
dim=1;dofs_per_node=1;
EleType='L2';
NGPTS=3;
Nele= XSeed-1;
NumNodes=XSeed;
Coord=zeros(NumNodes,dim);
for row =1:XSeed
Coord(row)=Lx*(row-1)/(XSeed-1);
end
Connectivity=zeros(Nele,2);
for ele = 1:Nele
Connectivity(ele,:)=[ele,ele+1];
end
Constraints=[1,1,0];
NCons= size(Constraints,1);
[U] = Driver_Steady_Diffusion(Connectivity,Constraints,...
Coord,dim,dofs_per_node,diffusivity_function,EleType,load_type,NCons,...
Nele,NGPTS,NumNodes);
plot(Coord,U,'k*','MarkerSize',20);hold on;
plot(Coord,Coord.*(Lx-Coord/2),'b-','LineWidth',2);
Legend('Numerical','Analytical','FontSize',20);
xlabel('x','FontSize',20);
ylabel('c(x)','FontSize',20);
2) Get_Volumetric source(where the error is)
function [f]= Get_VolumetricSource(load_type,x)
if strcmpi(load_type.case,'homogeneous')
f=load_type.value;
return;
end
my error message: when i run for L2_1D_P3 file
L2_1D_P3
__________________________________________
Diffusion Simulation Status Report
__________________________________________
Step1:Create GlobalId Vector
Step2:Create constraints vector
Step3: Calculate global stiffness matrix and load vector;
Dot indexing is not supported for variables of this type.
Error in Get_VolumetricSource (line 5)
if strcmpi(load_type.case,'homogeneous')
Error in CalculateLocalMatrices (line 34)
rlocal=rlocal+w(gpt)*N'*Get_VolumetricSource(load_type,x)*detJ;
Error in CalculateGlobalMatrices (line 30)
[klocal,rlocal]=CalculateLocalMatrices(diffusivity_function,EleNodes,EleType,...
Error in Driver_Steady_Diffusion (line 36)
[K_FF,K_FP,R_F]=CalculateGlobalMatrices(Connectivity,...
Error in L2_1D_P3 (line 39)
[U] = Driver_Steady_Diffusion(Connectivity,Constraints,...
8 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840710
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840710
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840721
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840721
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840729
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840729
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840731
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840731
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840738
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840738
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840743
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840743
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840745
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840745
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840759
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/522825-dot-indexing-is-not-supported-for-variables-of-this-type#comment_840759
Sign in to comment.