data extract from 3d line plot?

1 回表示 (過去 30 日間)
Golak Mahanta
Golak Mahanta 2019 年 12 月 28 日
回答済み: Image Analyst 2019 年 12 月 28 日
Capture_1.jpg

回答 (2 件)

Max Murphy
Max Murphy 2019 年 12 月 28 日
See example code and modify according to your data:
%% Make test data
fig = figure;
ax = axes(fig);
nPoint = 1001;
nSeries = 5;
k = ones(nSeries,1) * linspace(0,100,nPoint);
theta = randn(nSeries,1);
% Toy x-data
x = cos(k.*2*pi*0.1+2*pi.*theta).^(randi(4,5,1)).*(randn(nSeries,1) * 10);
% Toy y-data
y = randn(nSeries,nPoint) .* (randn(nSeries,1) * 10);
% Toy z-data
z = sin(k.*2*pi*0.1 + 2*pi.*theta).*(randn(nSeries,1) * 10);
% Labels
lab = cell(nSeries,1);
for i = 1:nSeries
lab{i} = sprintf('TestData %g',i);
end
% Plot them
plot3(ax,x.',y.',z.');
legend(lab);
%% Get 3D data
% Can use 'gca' here if don't have 'ax' handle
c = findobj(ax,'Type','line');
% c = findobj(gca,'Type','line'); % should work for your data
% This returns data in cell array, where each element matches
X = get(c,'XData'); % X{1,1} corresponds to Y{1,1} and Z{1,1}
Y = get(c,'YData'); % Y{2,1} corresponds to X{2,1} and Z{2,1} etc
Z = get(c,'ZData');

Image Analyst
Image Analyst 2019 年 12 月 28 日
If all you have is that one 2-D image, you can't. Exactly what data do you have? Are you the one who plotted it? If not, can you get it from them. Otherwise can you get the formulas that made those curves?

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by