フィルターのクリア

Hi, I want to draw graph in MATLAB with given data like given figure

1 回表示 (過去 30 日間)
Ghulam Murtaza
Ghulam Murtaza 2021 年 10 月 11 日
回答済み: yanqi liu 2021 年 11 月 5 日

回答 (2 件)

TJ Plummer
TJ Plummer 2021 年 11 月 3 日
編集済み: TJ Plummer 2021 年 11 月 3 日
Your image looks like sets of triangles. Let each triangle have 3 x and 3 y and you can call the following script for each triangle:
% create you triangle points, one created here
x=[1 10 5];
y=[10 25 45];
% create figure and hold on it
figure; hold on;
% below can be placed in a function
plot([x(1) x(2)], [y(1) y(2)], 'bo-');
plot([x(2) x(3)], [y(2) y(3)], 'bo-');
plot([x(1) x(3)], [y(1) y(3)], 'bo-');
for i=1:3
text(x(i), y(i), ['\{' num2str(x(i)) ', ' num2str(y(i)) '\}']);
end

yanqi liu
yanqi liu 2021 年 11 月 5 日
clc; clear all; close all;
G = digraph(1,2:5);
G = addedge(G,2,6:15);
G = addedge(G,15,16:20)
G =
digraph with properties: Edges: [19×1 table] Nodes: [20×0 table]
plot(G,'Layout','force')

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by