How to Plot 3D surface
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hello I have excel sheel has three columns, xyz, I wanna import the data and plot z(surface) based on the mesh xy. how can I do it? I tried to write a code as in pic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% excel sheet has 3 columns as below
% x Y z
% - - -
% - - -
% - - -
% - - -
% how to plot Z as surfece on mesh XY ?
%
%********** IMPORT FILE FROM XLS SHEET***************%
filename = 'num.xlsx';
sheet = 1;
xlRange = 'A1:B1:C100';%%we can use another column insted of C
subsetA = xlsread(filename, sheet, xlRange);
%%ZZ=reshape(subsetA(:,100),100,100) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[X,Y] = meshgrid(0:0.15:20,0:0.15:20); Z=reshape(X,Y,Z); %H = h.reshape(10,1); surf(X,Y,Z) %%%%%%%%%%%%%%%%%%%%%%%%
thx
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets 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!