필터 지우기
필터 지우기

need to draw lattice diagram in matlab for txt file

조회 수: 7 (최근 30일)
Venkatkumar M
Venkatkumar M 2020년 6월 30일
답변: Mohsen 2023년 5월 18일
I need to draw Bewley lattice diagram for given data using matlab code could anyone please idea.
I have attached txt file which has 3 coloumns each coloumn is total volatge at one node in transmission line so far each column i need draw a latice diagram.
fnm = 'sourceoc.txt ';
D4 = load(fnm);
m=(D4(:,1));
n=(D4(:,2));
o=(D4(:,3));
c=3e8;
f=2e9;
lambda=c/f;
dx=lambda/10;
dt=dx/c;
ts = 1:size(D4,1);
L = numel(ts) ;
Ts = dt;
from here plot has to be drawn?
Could anyone please help in developing the code?
  댓글 수: 2
Mike Sasena
Mike Sasena 2020년 8월 17일
Hi Venkatkumar,
This looks like a power electronics issue, so I'm assing Simscape Electrical to the product list so that team can more easily find your question. You'll also need to check the attached file. It's all zeros. You probably saved it with a formatting which truncated all the significant digits past the 4th decimal place. Lastly, your sample code show "ts = 1:size(D2,1)", but never defines the variable D2. Can you clarify that code?
Venkatkumar M
Venkatkumar M 2020년 8월 17일
its not D2 its D4.
its comes zeros and values,you can see values in between

댓글을 달려면 로그인하십시오.

채택된 답변

Joel Van Sickel
Joel Van Sickel 2020년 9월 2일
Hello Venkatkumar,
our tools don't support plotting Beweley lattice diagrams so you will have to come up with your own way of plotting them. You will need to calculate the locations of the arrows.
and in general, the plot command has many feautres for editing line format that can be used for the diagram. You should probably translate location in the matrix to a certain number of pixels when calculating where your arrows should go. If you are not familiar with plotting in Matlab, here is a basic overview: http://www.math.lsa.umich.edu/~tjacks/tutorial.pdf
Regards,
Joel

추가 답변 (2개)

Mohsen
Mohsen 2023년 5월 18일
temperature = [100 90 80 70 60 50 40 30 20 10 0];
time = [0 10 20 30 40 50 60 70 80 90 100];
coefficients = polyfit(time, temperature, 1);
x_values = linspace(0, 100, 100);
y_values = polyval(coefficients, x_values);
plot(time, temperature, 'o', x_values, y_values);
xlabel('time');
ylabel('temperature');

Mohsen
Mohsen 2023년 5월 18일
temperature = [100 90 80 70 60 50 40 30 20 10 0];
time = [0 10 20 30 40 50 60 70 80 90 100];
coefficients = polyfit(time, temperature, 1);
x_values = linspace(0, 100, 100);
y_values = polyval(coefficients, x_values);
plot(time, temperature, 'o', x_values, y_values);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by