How to Plot 3D surface

18 Ansichten (letzte 30 Tage)
Basheer
Basheer am 19 Jan. 2016
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

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by