【发布时间】:2017-01-20 13:24:04
【问题描述】:
我正在尝试在 Matlab 中编写代码来计算影响区域类型的问题。这是我的数据(加权、x 坐标、y 坐标)的结果:
M =
15072.00 486.00 -292
13269.00 486.00 -292
12843.00 414.00 -267
10969.00 496.00 -287
9907.00 411.00 -274
9718.00 440.00 -265
9233.00 446.00 -253
9138.00 462.00 -275
8830.00 496.00 -257
8632.00 432.00 -253
R =
-13891.00 452.00 -398
-13471.00 461.00 -356
-12035.00 492.00 -329
-11309.00 413.00 -353
-11079.00 467.00 -375
-10659.00 493.00 -333
-10643.00 495.00 -338
-10121.00 455.00 -346
-9795.00 456.00 -367
-8927.00 485.00 -361
-8765.00 467.00 -351
我想创建一个函数来计算任何给定位置的权重总和,基于每个坐标的 30 影响圆。
我曾想过使用 for 循环来独立计算每个点并对结果求和,但似乎不必要地复杂且效率低下。
我也想过为每个圆圈分配颜色强度并覆盖它们,但我不知道如何根据值更改颜色强度,这是我迄今为止的尝试(我希望看到结果):
function [] = Influence()
M = xlsread('MR.xlsx','A4:C310');
R = xlsread('MR.xlsx','E4:G368');
%these are my values around 300 coordinates
%M are negative values and R positive, I want to see which are dominant in their regions
hold on
scatter(M(:,2),M(:,3),3000,'b','filled')
scatter(R(:,2),R(:,3),3000,'y','filled')
axis([350 650 -450 -200])
hold off
end
%had to use a scalar of 3000 for some reason as it isnt correlated to the graph size
感谢您的任何想法/解决方案
【问题讨论】:
标签: matlab function plot sum area