Clear Filters
Clear Filters

how to get Coordinatee in this program

3 views (last 30 days)
adem ski
adem ski on 8 May 2021
hi i want help for get coordinatee for each maille in this program
for exampl the first maille
1 2
8 9
the second
2 3
9 10
clc
clear all
close all
format short
a=6;b=6;
dx=1; %Le nombre de division suivant x nelx
dy=1;
global T_Coord scalex scaley
xlimit=-2;
ylimit=-2;
Nx=(a/dx)+1; %Le nombre de node suivant X
Ny=(b/dy)+1; %Le nombre de node suivant y
Nt=Nx*Ny; %Le nombre de node total
Nmx=(a/dx);
Nmy=(a/dy);
Nmt=Nmx*Nmy;
Cx=0;
Cy=0;
NumNd=0;
for Ix=xlimit:(a+xlimit);
Cx=(Ix);
for Iy=ylimit:(b+ylimit);
Cy=(Iy);
NumNd=NumNd+1;
T_Coord(1,NumNd)=NumNd;
T_Coord(2,NumNd)=Cx;
T_Coord(3,NumNd)=Cy;
end
end
figure
hold on
x=T_Coord(2,:);
y=T_Coord(3,:);
Coord=[x;y]';
plot((x),(y),'.')
sx=x(1,end)+scalex;
sy=y(1,end)+scaley;
axis ([sx -scaley sy]);
%
title ('Maillage');
%
for ti=1:Nt;
text(Coord(ti,2),Coord(ti,1),num2str(ti),'Color','k','FontSize',12)
end

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!