Plot multiple lines in Matlab with animation
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
I am trying to plot a line, and then another line
I already wrote the code, but the figure plotted not as I want (I attached what i want)
Any help please :
clc;
close all;
clear all;
nodal_coo=[0 0;1 0;2 0;3 0];
element_coon=[1 2;2 3;3 4];
disp=[0,0,.24,0,-0.2076,.1245,0,-2076,-.1245,0,0,-2491];
NE=3;
for i=1:NE
ncon(1)=element_coon(i,1)
ncon(2)=element_coon(i,2)
eldof=[3*element_coon(i,1)-2;3*element_coon(i,1)-1;3*element_coon(i,1);3*element_coon(i,1)-2;3*element_coon(i,1)-1;...
3*element_coon(i,1)]
del(:,i)=disp(eldof); % DISPLACEMENTS OBTAINED in arry form
end
f=figure;
hold on;
for i=1:NE
line(nodal_coo(element_coon(i,:),1),nodal_coo(element_coon(i,:),2),'linewidth',5,'color','b');
line(nodal_coo(element_coon(i,:),1)+del([1,4],i),nodal_coo(element_coon(i,:),2)+del([2,5],i),'linewidth',10,'color','r');
end
댓글 수: 2
Nora Khaled
2021년 2월 6일
could you add more explanation? what are the coordinate in your attached picture?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!