how to applay heatmap for trajectory line?

1 回表示 (過去 30 日間)
ryunosuke tazawa
ryunosuke tazawa 2022 年 5 月 3 日
I want to know how to heatmap line on trajectory(x-y corrdinate)?
How can I deal with duplicate data?
%% フラクタル次元結果 ヒートマップで描画
clear all;
close all;
%% data for heatmap
load('FractalDimension_Double5','f')
FraD5 = f;
%% trajectory data
load('Double5.mat')
%% XY-coordinate
X1 = sin(Theta1);
Y1 = -cos(Theta1);
X2 = X1 + sin(Theta2);
Y2 = Y1 - cos(Theta2);
Tra = [X1,Y1,X2,Y2];
x1 = zeros(10000,1);
y1 = zeros(10000,1);
x2 = zeros(10000,1);
y2 = zeros(10000,1);
F = zeros(10000,1);
for i=1:10000
x1(i) = X1(i);
y1(i) = Y1(i);
x2(i) = X2(i);
y2(i) = Y2(i);
F(i) = FraD5(i);
end
%% draw trajectory
figure(1)
plot(x1,y1,'bo','MarkerFaceColor','b','MarkerSize',5)
hold on
plot(x2,y2,'bo','MarkerFaceColor','b','MarkerSize',5)
grid on
%% I want to draw heatmap curve on trajectory
figure(2)
%[x1i,y1i] = meshgrid(x1,y1);
%[x2i,y2i] = meshgrid(x2,y2);
%f = scatteredInterpolant(x1,y1,F);
%h = scatteredInterpolant(x2,y2,F);
%Fi=f(x1i,y1i);
%Fi =h(x2i,y2i);
%J = figure(2);
%scatter(x1,y1,70,F,'filled')
%hold on
%scatter(x2,y2,70,F,'filled')
%J = gca;
%J.FontSize = 20;
%J.FontName = 'Times New Roman';
%ylabel('Y','fontSize',18);
%xlabel('Y','fontSize',18);
%colormap(jet(256))
%colorbar

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by