Create a Function and Graph of two variables from a set of data points

조회 수: 14 (최근 30일)
Manolis Ellinas
Manolis Ellinas 2022년 12월 26일
답변: Vijay 2022년 12월 29일
Hello everyone,
I have a set of data points in excel that represent the Resistance (R) of a Grounding Grid in relation to the soil resistivity of the upper layer (ρ1) and lower layer (ρ2). Is it possible to create a function of the R = f(ρ1,ρ2) and export a relevant graph ?
Bellow you may find the data set in excel. As you can see the relation of R=f(ρ2) is 3rd order polyonimial so i assume that the function of R=f(ρ1,ρ2) should also be polyonimial (?)
Is it possible to create this kind of function and then draw a graph ?
Thank you.

답변 (1개)

Vijay
Vijay 2022년 12월 29일
Yes, you can fit the data using polynomial curve fitting.
You need to first import the data into MATLAB from Excel file then use polyfit function to get a polynomial that fits the data after that you can use plot function to plot the function.
Please use the links below for more information
  1. How to Import Excel Data into MATLAB - Video - MATLAB (mathworks.com)
  2. Polynomial curve fitting - MATLAB polyfit - MathWorks India
  3. 2-D line plot - MATLAB plot - MathWorks India

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by