Using file for graph
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
minsick
am 7 Apr. 2020
Beantwortet: Ameer Hamza
am 7 Apr. 2020
I am looking for make 3 dimensional graph with data file
There are three paramter (file name, x, y).
Could you share matlab code or example?
please find attached file
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/282430/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 7 Apr. 2020
Try this
filenames = {'11.txt','22.txt','33.txt'};
data = cell(1,numel(filenames));
for i=1:numel(filenames)
data{i} = readmatrix(filenames{i});
end
fig = figure();
ax = axes();
hold(ax);
grid on
view(3);
for i=1:numel(filenames)
plot3(data{i}(:,1), data{i}(:,2), i*ones(size(data{i}(:,1))), 'LineWidth', 1)
end
ax.ZTick = 1:3;
ax.ZTickLabel = filenames;
xlabel('x');
ylabel('y');
zlabel('filenames');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!