data extract from 3d line plot?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
![Capture_1.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/257465/Capture_1.jpeg)
0 Commenti
Risposte (2)
Max Murphy
il 28 Dic 2019
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');
0 Commenti
Image Analyst
il 28 Dic 2019
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?
0 Commenti
Vedere anche
Categorie
Scopri di più su Line 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!