finding curvature of plot

5 views (last 30 days)
phuah yun
phuah yun on 1 Nov 2018
Reopened: madhan ravi on 2 Nov 2018
i started with calling out my txt file this way:
[z,x,y] = textread ('D:\Matlab\315 Big.txt' ,'%f %f %f', 100); or
load('D:\Matlab\315 Big.txt');or
M =load('D:\Matlab\315 Big.txt');
and then i continue on with the whole page of function for curvature following the link. however it prompts:function k=LineCurvature2D(Vertices,Lines) ↑ Error: Function definition not supported in this context. Create functions in code file.
how should i proceed? i am totally clueless about Matlab.
  6 Comments
Bruno Luong
Bruno Luong on 1 Nov 2018
  • Remove function code in your script.
  • But save function code in LineCurvature2D.m

Sign in to comment.

Accepted Answer

KSSV
KSSV on 2 Nov 2018
Edited: KSSV on 2 Nov 2018
  1. Download the function and save it in a folder
  2. Copy your 315 Big.txt file in this folder.
  3. Open MATLAB, go to the folder where you have saved the function and txt file.
  4. Now type the following:
Vertices =load('315 Big.txt');
Vertices(:,1) = [] ; % because all zeros
k=LineCurvature2D(Vertices) ;
k
  3 Comments
KSSV
KSSV on 2 Nov 2018
Edited: KSSV on 2 Nov 2018
Jesus Christ.........you got it..yes those are the curvatures. :)
Now you have to accept the answer.
phuah yun
phuah yun on 2 Nov 2018
thank you so much~

Sign in to comment.

More Answers (0)

Categories

Find more on Surfaces, Volumes, and Polygons in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!