3D graph from txt file
Ältere Kommentare anzeigen
Hi All, I try to make 3D graph from text file 'output.txt'. This text file has 6 columns separated by commas and numerous rows. I need 3D graph from first 3 columns, say CX, CY, CZ, which have numerous rows. My code is below, but the graph displays only 1 point, which corresponds to the first row. Would anyone now, please, how to include data from all rows, so they are displayed in the graph? Thank you, Helena
fid = fopen('output.txt');
CX = [];
CY = [];
CZ = [];
temp = textscan(fid, '%f, %f, %f');
disp (temp);
CX(:,1) = cell2mat(temp(1));
CY(:,1) = cell2mat(temp(2));
CZ(:,1) = cell2mat(temp(3));
disp (CX);
disp (CY);
disp (CZ);
fclose(fid);
plot3(CY,CZ,CX,'*');
xlabel('Pressure deficit [100 m]');
ylabel('Water quality deficit [mg/L]');
zlabel('Pump energy costs [AUD]');
grid on;
axis square;
Akzeptierte Antwort
Weitere Antworten (1)
son nguyen xuan
am 21 Aug. 2019
0 Stimmen
how can i get range of color for plot3?
thanks
Kategorien
Mehr zu Block and Blockset Authoring finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!