How to Plot 3D surface

20 ビュー (過去 30 日間)
Basheer
Basheer 2016 年 1 月 19 日
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 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by