need to draw lattice diagram in matlab for txt file

18 visualizzazioni (ultimi 30 giorni)
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 Commenti
Mike Sasena
Mike Sasena il 17 Ago 2020
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 il 17 Ago 2020
its not D2 its D4.
its comes zeros and values,you can see values in between

Accedi per commentare.

Risposta accettata

Joel Van Sickel
Joel Van Sickel il 2 Set 2020
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

Più risposte (2)

Mohsen
Mohsen il 18 Mag 2023
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 il 18 Mag 2023
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);

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by